Displaying 20 results from an estimated 4000 matches similar to: "[LLVMdev] Preserving NSW/NUW bits"
2015 Jul 16
2
[LLVMdev] Improving loop vectorizer support for loops with a volatile iteration variable
----- Original Message -----
> From: "Chandler Carruth" <chandlerc at google.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "Hyojin Sung" <hsung at us.ibm.com>, llvmdev at cs.uiuc.edu
> Sent: Thursday, July 16, 2015 1:06:03 AM
> Subject: Re: [LLVMdev] Improving loop vectorizer support for loops
> with a volatile iteration
2015 Jul 16
2
[LLVMdev] Improving loop vectorizer support for loops with a volatile iteration variable
----- Original Message -----
> From: "Chandler Carruth" <chandlerc at google.com>
> To: "Hyojin Sung" <hsung at us.ibm.com>, llvmdev at cs.uiuc.edu
> Sent: Wednesday, July 15, 2015 7:34:54 PM
> Subject: Re: [LLVMdev] Improving loop vectorizer support for loops
> with a volatile iteration variable
> On Wed, Jul 15, 2015 at 12:55 PM Hyojin Sung
2015 Apr 25
3
[LLVMdev] alias analysis on llvm internal globals
Hi
I have this program in which fooBuf can only take on NULL or the
address of local_fooBuf, and fooBuf and local_fooBuf have scope of the
foo function.
Therefore there is no way for the fooPtr argument to alias with
fooBuf. However, LLVM basicaa and globalsmodref-aa say the 2 pointers
may alias.
I am thinking whether i should implement a limited form of point-to
alias on the fooBuf pointer in
2016 May 19
4
GEP index canonicalization
Hi,
InstCombine canonicalizes index operands (unless they are into struct
types) to pointer size. The comment says: "If we are using a wider
index than needed for this platform, shrink it to what we need. If
narrower, sign-extend it to what we need. This explicit cast can make
subsequent optimizations more obvious.".
For our architecture, the canonicalization is a bit
2014 Jan 16
3
[LLVMdev] Loop unrolling opportunity in SPEC's libquantum with profile info
On Wed, Jan 15, 2014 at 5:30 PM, Nadav Rotem <nrotem at apple.com> wrote:
> Was the vectorizer successful in unrolling the loop in quantum_sigma_x? I
> wonder if 'size’ is typically high or low.
No. The vectorizer stated that it wasn't going to bother with the loop
because it wasn't profitable. Specifically:
LV: Checking a loop in "quantum_sigma_x"
LV: Found a
2015 Jul 16
4
[LLVMdev] Improving loop vectorizer support for loops with a volatile iteration variable
----- Original Message -----
> From: "Hal Finkel" <hfinkel at anl.gov>
> To: "Chandler Carruth" <chandlerc at google.com>
> Cc: llvmdev at cs.uiuc.edu
> Sent: Thursday, July 16, 2015 1:58:02 AM
> Subject: Re: [LLVMdev] Improving loop vectorizer support for loops
> with a volatile iteration variable
> ----- Original Message -----
> >
2015 Aug 13
2
[LLVMdev] Improving loop vectorizer support for loops with a volatile iteration variable
Hi Gerolf,
I think we have several (perhaps separable) issues here:
1. Do we have a canonical form for loops, preserved through the optimizer, that allows naturally-constructed loop nests to remain separable?
2. Do we forbid non-lowering transformations that turn vectorizable loops into non-vectorizable loops?
3. How do we detect cases where transformations cause a negative answer to either
2014 Jan 07
2
[LLVMdev] A question about everyone's favorite constructs: NSW and NUW
On Jan 6, 2014, at 9:41 PM, Andrew Trick <atrick at apple.com> wrote:
>
> On Jan 4, 2014, at 5:29 PM, Chandler Carruth <chandlerc at gmail.com> wrote:
>
>> So, I know there are a lot of mixed feelings about NSW and NUW, but I'm running into a common pattern where they really help:
>>
>> void f(char *array, int i) {
>> // do some stuff...
2016 Aug 25
4
Canonicalize induction variables
But even for a very simple loop:
int test1 (int *x, int *y, int *z, int k) {
int sum = 0;
for (int i = 10; i < k; i++) {
z[i] = x[i] / y[i];
}
return sum;
}
The initial value of induction variable is not zero after compiling with
-O3 -mcpu=power8 x.cpp -S -c -emit-llvm -fno-unroll-loops (see bottom of
the email for IR)
Also I can write somewhat more complicated loop where step
2013 Oct 31
2
[LLVMdev] SCEV and GEP NSW flag
Andy, et al.,
If I start with C code like this:
void foo(long k, int * restrict a, int * restrict b, int * restrict c) {
if (k > 0) {
for (int i = 0; i < 2047; i++) {
a[i] = a[i + k] + b[i] * c[i];
}
}
}
Clang -O3 will produce code like this:
entry:
%cmp = icmp sgt i64 %k, 0
br i1 %cmp, label %for.body.preheader, label %if.end
for.body.preheader:
br label
2014 Jan 05
4
[LLVMdev] A question about everyone's favorite constructs: NSW and NUW
So, I know there are a lot of mixed feelings about NSW and NUW, but I'm
running into a common pattern where they really help:
void f(char *array, int i) {
// do some stuff...
g(array[i++]);
// do some more stuff...
g(array[i++]);
// more of the same
}
So, this kind of code comes up pretty frequently. Unrolled loops with an
int IV[1], encoding, decoding, compression, etc. What
2013 Nov 02
0
[LLVMdev] SCEV and GEP NSW flag
On Oct 31, 2013, at 1:24 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> Andy, et al.,
>
> If I start with C code like this:
>
> void foo(long k, int * restrict a, int * restrict b, int * restrict c) {
> if (k > 0) {
> for (int i = 0; i < 2047; i++) {
> a[i] = a[i + k] + b[i] * c[i];
> }
> }
> }
>
> Clang -O3 will produce code like
2013 Nov 02
2
[LLVMdev] SCEV and GEP NSW flag
----- Original Message -----
>
> On Oct 31, 2013, at 1:24 PM, Hal Finkel <hfinkel at anl.gov> wrote:
>
> > Andy, et al.,
> >
> > If I start with C code like this:
> >
> > void foo(long k, int * restrict a, int * restrict b, int * restrict
> > c) {
> > if (k > 0) {
> > for (int i = 0; i < 2047; i++) {
> > a[i] =
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.
2015 Aug 22
2
loop unrolling introduces conditional branch
Thanks for your point that out. I just add DataLayout in my code such as
"mod->setDataLayout("e-m:e-i64:64-f80:128-n8:16:32:64-S128");", still no
luck.
I'm really confused about this. Do I need to add more passes before
-loop-unroll?
On Sat, Aug 22, 2015 at 11:36 AM, Mehdi Amini <mehdi.amini at apple.com> wrote:
>
> On Aug 22, 2015, at 7:27 AM, Xiangyang
2016 Aug 25
3
Canonicalize induction variables
I just subscribed this group. This is my first time to post a question
(not sure if this is a right place for discussion) after I have a brief
look at LLVM OPT (dev trunk). I would expect loop simplification and
induction variable canonicalization pass (IndVarSimplify pass) should be
able to convert the following loops into a simple canonical form, i.e.,
there is a canonical induction variable
2015 Aug 20
2
loop unrolling introduces conditional branch
Hi,
I want to use loop unrolling pass, however, I find that loop unrolling will
introduces conditional branch at end of every "unrolled" part. For example,
consider the following code
*void foo( int n, int array_x[])*
*{*
* for (int i=0; i < n; i++)*
* array_x[i] = i; *
*}*
Then I use this command "opt-3.5 try.bc -mem2reg -loops -loop-simplify
-loop-rotate -lcssa
2013 Nov 13
2
[LLVMdev] SCEV getMulExpr() not propagating Wrap flags
Hi folks,
I'm trying to analyse this piece of IR:
for.body: ; preds = %for.body,
%entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%0 = shl nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i32* %b, i64 %0
%1 = load i32* %arrayidx, align 4, !tbaa !1
%add = add nsw i32 %1, %I
%arrayidx3 = getelementptr
2011 Aug 11
0
[LLVMdev] nsw/nuw for trunc
On Aug 11, 2011, at 7:31 AM, Florian Merz wrote:
> If we had nsw and nuw flags for truncations we'd know when to check for this
> kind of overflow and when not. The compiler likely doesn't need these flags and
> can still ignore them, for us they would be useful.
Duncan's point is that this is totally different from the semantics of
nsw/nuw on other instructions, which
2017 Dec 19
4
MemorySSA question
Hi,
I am new to MemorySSA and wanted to understand its capabilities. Hence I
wrote the following program (test.c):
int N;
void test(int *restrict a, int *restrict b, int *restrict c, int *restrict
d, int *restrict e) {
int i;
for (i = 0; i < N; i = i + 5) {
a[i] = b[i] + c[i];
}
for (i = 0; i < N - 5; i = i + 5) {
e[i] = a[i] * d[i];
}
}
I compiled this program using