diff options
author | Andreas Bolka <a@bolka.at> | 2009-06-30 02:12:10 +0000 |
---|---|---|
committer | Andreas Bolka <a@bolka.at> | 2009-06-30 02:12:10 +0000 |
commit | 95418011056f99128ce9c27da67dba929c1a64fc (patch) | |
tree | 3ab93494de7d4708ac831781892cd69e2d57786a /llvm/test/Analysis/LoopDependenceAnalysis/local-array.ll | |
parent | 75630b355a92a35c85d0a3172d53c6206dbcd8ce (diff) | |
download | bcm5719-llvm-95418011056f99128ce9c27da67dba929c1a64fc.tar.gz bcm5719-llvm-95418011056f99128ce9c27da67dba929c1a64fc.zip |
Array accesses are independent if the underlying arrays differ.
llvm-svn: 74499
Diffstat (limited to 'llvm/test/Analysis/LoopDependenceAnalysis/local-array.ll')
-rw-r--r-- | llvm/test/Analysis/LoopDependenceAnalysis/local-array.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/Analysis/LoopDependenceAnalysis/local-array.ll b/llvm/test/Analysis/LoopDependenceAnalysis/local-array.ll new file mode 100644 index 00000000000..c42e0fad438 --- /dev/null +++ b/llvm/test/Analysis/LoopDependenceAnalysis/local-array.ll @@ -0,0 +1,24 @@ +; RUN: llvm-as < %s | opt -disable-output -analyze -lda > %t +; RUN: grep {instructions: 2} %t | count 1 +; RUN: grep {0,1: dependent} %t | count 1 + +; x[5] = x[6] // with x being an array on the stack + +define void @foo(...) nounwind { +entry: + %xptr = alloca [256 x i32], align 4 + %x.ld.addr = getelementptr [256 x i32]* %xptr, i64 0, i64 6 + %x.st.addr = getelementptr [256 x i32]* %xptr, i64 0, i64 5 + br label %for.body + +for.body: + %i = phi i64 [ 0, %entry ], [ %i.next, %for.body ] + %x = load i32* %x.ld.addr + store i32 %x, i32* %x.st.addr + %i.next = add i64 %i, 1 + %exitcond = icmp eq i64 %i.next, 256 + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} |