Displaying 20 results from an estimated 6000 matches similar to: "[LLVMdev] -indvars issues?"
2012 Mar 08
0
[LLVMdev] -indvars issues?
On 03/08/2012 06:23 PM, Gavin Harrison wrote:
> Hi,
>
> Is the -indvars pass functional? I've done some small test to check it,
> but this fails to canonicalize:
>
>> int *x;
>> int *y;
>> int i;
>> ...
>> for (i = 1; i < 100; i+=2) {
>> x[i] = y[i] + 3;
>> }
>
> The IR produced after -indvars:
>
>> br label %for.cond
2016 Aug 17
2
Loop vectorization with the loop containing bitcast
Hi ,
The following loop fails to be vectorized since the load c[i] is casted as i64 and the store c[i] is double. The loop access analysis gives up since they are in different types.
Since these two memory operations are in the same size, I believe the loop access analysis should return forward dependence and thus the loop can be vectorized.
Any comments?
Thanks,
Jin
#define N 1000
double
2013 Jun 18
2
[LLVMdev] -indvars issues?
It seems there is no -enable-iv-rewrite now in llvm3.2, and it suggest
-enable-load-pre, but it still does not work.
So, how to active the transform?
--
View this message in context: http://llvm.1065342.n5.nabble.com/indvars-issues-tp4646p58587.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.
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
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
2017 Dec 19
2
MemorySSA question
On Tue, Dec 19, 2017 at 9:10 AM, Siddharth Bhat via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> I could be entirely wrong, but from my understanding of memorySSA, each
> def defines an "abstract heap state" which has the coarsest possible
> definition - any write will be modelled as a "new heap state".
>
This is true for def-def relationships, but
2013 Oct 28
2
[LLVMdev] Loop vectorizer dosen't find loop bounds
I am trying to vectorize the function
void bar(float *c, float *a, float *b)
{
const int width = 256;
for (int i = 0 ; i < 256 ; ++i ) {
c[ i ] = a[ i ] + b[ i ];
c[ width + i ] = a[ width + i ] + b[ width + i ];
}
}
using the following commands
clang -emit-llvm -S loop.c
opt loop.ll -O3 -debug-only=loop-vectorize -S -o -
LV: Checking a loop in
2013 Oct 28
0
[LLVMdev] Loop vectorizer dosen't find loop bounds
----- Original Message -----
> I am trying to vectorize the function
>
> void bar(float *c, float *a, float *b)
> {
> const int width = 256;
> for (int i = 0 ; i < 256 ; ++i ) {
> c[ i ] = a[ i ] + b[ i ];
> c[ width + i ] = a[ width + i ] + b[ width + i ];
> }
> }
>
> using the following commands
>
> clang
2013 Oct 28
2
[LLVMdev] Loop vectorizer dosen't find loop bounds
Bingo! That works (when coming from C source)
Now, I have a serious problem. I am not coming from C but I build the
function with the builder. I am also forced to change the signature and
load the pointers a,b,c afterwards:
define void @bar([8 x i8]* nocapture readonly %arg_ptr) #0 {
entrypoint:
%0 = bitcast [8 x i8]* %arg_ptr to i32*
%1 = load i32* %0, align 4
%2 = getelementptr [8 x
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
2013 Jul 11
1
[LLVMdev] Scalar Evolution and Loop Trip Count.
Hi,
Scalar evolution seems to be wrapping around the trip count in the
following loop.
void add (int *restrict a, int *restrict b, int *restrict c) {
char i;
for (i = 0; i < 255; i++)
a[i] = b[i] + c[i];
}
When I run scalar evolution on the bit code, I get a backedge-taken
count which is obviously wrong.
$> cat loop.ll
; Function Attrs: nounwind
define void @add(i32* noalias
2013 Oct 28
0
[LLVMdev] Loop vectorizer dosen't find loop bounds
----- Original Message -----
> Bingo! That works (when coming from C source)
>
> Now, I have a serious problem. I am not coming from C but I build the
> function with the builder. I am also forced to change the signature
> and
> load the pointers a,b,c afterwards:
>
> define void @bar([8 x i8]* nocapture readonly %arg_ptr) #0 {
> entrypoint:
> %0 = bitcast [8 x
2013 Oct 29
2
[LLVMdev] Loop vectorizer dosen't find loop bounds
Thanks for the alternatives!
I am trying the 'extracting sub-function' approach. However, it seems I
can't get the 'subfunction' to pass the verifier. This is my subfunction:
define void @main_extern([8 x i8]* %arg_ptr) {
entrypoint:
%0 = getelementptr [8 x i8]* %arg_ptr, i32 0
%1 = bitcast [8 x i8]* %0 to i64*
%2 = load i64* %1
%3 = getelementptr [8 x i8]*
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 Jun 25
2
[LLVMdev] SimplifyIndVar looses nsw flags
Hello,
I'm using LLVM to reason about memory safety of programs. One goal is to
prove that certain array accesses are always safe.
Currently, one of these proofs fails because of a missing no-signed-wrap
(nsw) flag. I found that it has been "lost" during the SimplifyIndVar pass.
Here's the example:
int foo(int a[]) {
int sum = 0;
for (int i = 0; i < 1000; ++i)
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
2019 Nov 10
2
Reassociation is blocking a vectorization
Hi Devs,
I am looking at the bug
https://bugs.llvm.org/show_bug.cgi?id=43953
and found that following piece of ir
%arrayidx = getelementptr inbounds float, float* %Vec0, i64 %idxprom
%0 = load float, float* %arrayidx, align 4, !tbaa !2
%arrayidx2 = getelementptr inbounds float, float* %Vec1, i64 %idxprom
%1 = load float, float* %arrayidx2, align 4, !tbaa !2
%sub = fsub fast float %0, %1
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
2013 Feb 25
0
[LLVMdev] loop metdata instruction
On 2/25/2013 2:08 PM, Redmond, Paul wrote:
>
> I've been looking through past threads looking for an answer to why the loop metadata is attached to the loop latch branch. What is the reason for putting the metadata inside the loop rather than outside (for example on the branch into the loop header.)
Latch is a branch to the header. What branch in particular do you have
in mind?
Loop