Displaying 20 results from an estimated 1000 matches similar to: "Reassociation is blocking a vectorization"
2014 Feb 19
2
[LLVMdev] better code for IV
Hi Andrew,
The issue below refers to LSR, so I'll appreciate your feedback. It also refers to instruction combining and might impact backends other than X86, so if you know of others that might be interested you are more than welcome to add them.
Thanks, Anat
_____________________________________________
From: Shemer, Anat
Sent: Tuesday, February 18, 2014 15:07
To: 'llvmdev at
2013 Feb 05
3
[LLVMdev] Vectorizing global struct pointers
Hi all,
One of the reasons the Livermore Loops couldn't be vectorized is that it
was using global structures to hold the arrays. Today, I'm investigating
why is that so and how to fix it.
My investigation brought me
to LoopVectorizationLegality::canVectorizeMemory():
if (WriteObjects.count(*it)) {
DEBUG(dbgs() << "LV: Found a possible read/write reorder:"
2017 May 19
4
memcmp code fragment
Hi,
Look at the following code:
Look at the following C code seqence:
unsigned char mainGtU ( unsigned int i1,
unsigned int i2,
unsigned char* block)
{
unsigned char c1, c2;
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
c1 = block[i1]; c2 = block[i2];
if (c1 != c2) return (c1 > c2);
i1++; i2++;
..
..
2018 Jun 13
2
Question about a May-alias case
Hello All,
I have a question about a May-alias case. Let's look at one simple C
example.
char *buf[4];
char c;
void test(int idx) {
char *a = buf[3 - idx];
char *b = buf[idx];
*a = *b;
c++;
*a = *b;
}
We can imagine the second "*a = *b" could be removed. Let's look at the
IR snippet with -O3 for above example.
1 define void @test(i32 %idx) {
2 entry:
2013 Nov 11
2
[LLVMdev] What's the Alias Analysis does clang use ?
Hi, LLVM community:
I found basicaa seems not to tell must-not-alias for __restrict__ arguments
in c/c++. It only compares two pointers and the underlying objects they
point to. I wonder how clang does alias analysis
for c/c++ keyword restrict.
let assume we compile the following code:
$cat myalias.cc
float foo(float * __restrict__ v0, float * __restrict__ v1, float *
__restrict__ v2, float *
2013 Feb 05
0
[LLVMdev] Vectorizing global struct pointers
If I understand you correctly, conceptually you want two different objects to be returned for Foo.bl and Foo.al?
Here is my take on this (take this with a grain of salt, Dan is the expert on this):
http://llvm.org/docs/GetElementPtr.html#what-happens-if-an-array-index-is-out-of-bounds
LLVM's semantic allows for arrays to be accessed out of bounds - this allows you to walk from the first
2015 Dec 09
2
Field sensitive alias analysis?
Hi Daniel,
I see your point about LLVM and C/C++ type agnostic. I think TBAA was
invented to partially cover this gap and give optimization opportunities
when LLVM types are not sufficient but C/C++ types have required
information.
What do you think about following example:
struct S {
int a[10];
int b;
};
int foo(struct S *ps, int i) {
ps->a[i] = 1;
ps->b = 2;
return
2013 Nov 12
0
[LLVMdev] What's the Alias Analysis does clang use ?
Hi,
Your problem is that the function arguments, which are makes as noalias, are not being directly used as the base objects of the array accesses:
> %v0.addr = alloca float*, align 8
> %v1.addr = alloca float*, align 8
> %v2.addr = alloca float*, align 8
> %t.addr = alloca float*, align 8
...
> store float* %v0, float** %v0.addr, align 8
> store float* %v1, float** %v1.addr,
2013 Oct 28
2
[LLVMdev] loop vectorizer says Bad stride
Verifying function
running passes ...
LV: Checking a loop in "bar"
LV: Found a loop: L0
LV: Found an induction variable.
LV: We need to do 0 pointer comparisons.
LV: Checking memory dependencies
LV: Bad stride - Not an AddRecExpr pointer %13 = getelementptr float*
%arg2, i32 %1 SCEV: ((4 * (sext i32 {(256 + %arg0),+,1}<nw><%L0> to
i64)) + %arg2)
LV: Src Scev: {((4 * (sext
2013 Oct 28
0
[LLVMdev] loop vectorizer says Bad stride
Frank,
It looks like the loop vectorizer is unable to tell that the two stores in your code never overlap. This is probably because of the sign-extend in your code. Can you extend the indices to 64bit ?
Thanks,
Nadav
On Oct 28, 2013, at 1:38 PM, Frank Winter <fwinter at jlab.org> wrote:
> Verifying function
> running passes ...
> LV: Checking a loop in "bar"
> LV:
2015 Dec 08
2
Field sensitive alias analysis?
Jeroen, thank you for very useful link with the context. Indeed union cases
are very complicated and I see places in code when TBAA gives up.
Daniel, I completely agree that TBAA has limited power and can solve
relatively simple cases only. So anything more complicated that involves
intermediate variables that points to struct or array elements cannot be
solved by TBAA alone. Differentiating
2013 Aug 10
2
[LLVMdev] Address space extension
> -----Original Message-----
> From: Michele Scandale [mailto:michele.scandale at gmail.com]
> Sent: Saturday, August 10, 2013 6:29 AM
> To: Micah Villmow
> Cc: LLVM Developers Mailing List
> Subject: Re: [LLVMdev] Address space extension
>
> On 08/10/2013 02:47 PM, Micah Villmow wrote:
> > Michele,
> > The information you are trying to gather is fundamentally
2016 May 07
3
[GSoC 2016] Introduction - Polly as an Analysis pass in LLVM
Dear All,
I am glad to be part of GSoC 2016 with LLVM organization. I am a first year
PhD student at IIT Hyderabad, India and my research area is compiler
optimizations using polyhedral model.
My GSoC 2016 project is to implement Polly as an Analysis pass in LLVM [1].
We have a discussion on Polly-dev mailing list [2] on taking a better
approach to implement this project. Based upon this
2017 Aug 08
2
[ScalarEvolution][SCEV] no-wrap flags dependent on order of getSCEV() calls
Hi all,
I'm looking into resolving a FIXME in the LoopDataPrefetch (and
FalkorMarkStridedAccesses) pass by marking both of these passes as
preserving the ScalarEvolution analysis. Unfortunately, when this
change is made, LSR will generate different code. One of the root
causes seems to be that SCEV will return different nsw/nuw flags for the
same Value, depending on what order the
2012 Aug 24
6
updating elements of a vector sequentially - is there a faster way?
I would like to know whether there is a faster way to do the below
operation (updating vec1).
My objective is to update the elements of a vector (vec1), where a
particular element i is dependent on the previous one. I need to do this on
vectors that are 1 million or longer and need to repeat that process
several hundred times. The for loop works but is slow. If there is a faster
way, please let
2002 Jun 18
5
insert number in vector
Hello R-users,
I need to create a vector inserting an 1 after each value of another vector.
For example:
vec1<-c(2,3,4)
I need to create a vector with the values 2,1,3,1,4
Does anyone know how create this vector without loops (vec1 could have 1000
elements)
Thank you,
Juan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2013 Feb 17
6
histogram
HI Elisa,
You could use ?cut()
vec1<-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45)
label1<-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x) x),lapply(seq(5,50,5),function(x) x),SIMPLIFY=FALSE),function(i) paste(i[1],"<x<=",i[2],sep="")))
2015 Aug 22
3
loop unrolling introduces conditional branch
Hi, Mehdi,
For example, I have this very simple source code:
void foo( int n, int array_x[])
{
for (int i=0; i < n; i++)
array_x[i] = i;
}
After I use "clang -emit-llvm -o bc_from_clang.bc -c try.cc", I get
bc_from_clang.bc. With my code (using LLVM IRbuilder API), I get
bc_from_api.bc. Attachment please find thse two files. I also past the IR
here.
2011 Aug 19
3
[LLVMdev] Why int variable get promoted to i64
Hi, all
I found in some cases the int variable get promoted to i64,
although I think it should i32. I use the online demo
(http://llvm.org/demo). And below is the test case.
------------- test case -------------
int test(int x[], int y[], int n) {
int i = 0;
int sum = 0;
for ( ; i < n; i++) {
sum += x[i] * y[i];
}
return sum;
}
-------------------------------------
No
2024 Jun 16
1
slowness when I use a list comprehension
This can be vectorized. Try
ix <- seq_along(vec2)
S_diff2 <- sapply(seq_len(N1-(N2-1)*ratio_sampling), \(j)
sum((vec1[(ix-1)*ratio_sampling+j] - vec2[ix])**2))
On Sun, Jun 16, 2024 at 11:27?AM Laurent Rhelp <laurentRHelp at free.fr> wrote:
>
> Dear RHelp-list,
>
> I try to use the package comprehenr to replace a for loop by a list
> comprehension.
>
> I