summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2012-08-10 03:26:36 +0000
committerPete Cooper <peter_cooper@apple.com>2012-08-10 03:26:36 +0000
commit3eeba88631db6da7d45df67f677556297bd93f75 (patch)
tree1e67ecc8219d5c709e7766646ef6cf9bc12c3509 /test/Transforms
parent15121ca0d18e6a0f6a16f8a696f4efc3782dc965 (diff)
downloadllvm-3eeba88631db6da7d45df67f677556297bd93f75.tar.gz
llvm-3eeba88631db6da7d45df67f677556297bd93f75.tar.bz2
llvm-3eeba88631db6da7d45df67f677556297bd93f75.tar.xz
Fix crash when when do lto on Bullet. Dynamic GEPs in SROA were incorrectly being applied to all accesses to an alloca, not just the ones which read from the GEP. Thanks to Evan for reducing the test. rdar://11861001
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/ScalarRepl/crash.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Transforms/ScalarRepl/crash.ll b/test/Transforms/ScalarRepl/crash.ll
index cd4dc328e6..58c5a3a052 100644
--- a/test/Transforms/ScalarRepl/crash.ll
+++ b/test/Transforms/ScalarRepl/crash.ll
@@ -260,5 +260,27 @@ entry:
ret void
}
+; rdar://11861001 - The dynamic GEP here was incorrectly making all accesses
+; to the alloca think they were also dynamic. Inserts and extracts created to
+; access the vector were all being based from the dynamic access, even in BBs
+; not dominated by the GEP.
+define fastcc void @test() optsize inlinehint ssp align 2 {
+entry:
+ %alloc.0.0 = alloca <4 x float>, align 16
+ %bitcast = bitcast <4 x float>* %alloc.0.0 to [4 x float]*
+ %idx3 = getelementptr inbounds [4 x float]* %bitcast, i32 0, i32 3
+ store float 0.000000e+00, float* %idx3, align 4
+ br label %for.body10
+
+for.body10: ; preds = %for.body10, %entry
+ %loopidx = phi i32 [ 0, %entry ], [ undef, %for.body10 ]
+ %unusedidx = getelementptr inbounds <4 x float>* %alloc.0.0, i32 0, i32 %loopidx
+ br i1 undef, label %for.end, label %for.body10
+
+for.end: ; preds = %for.body10
+ store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00>, <4 x float>* %alloc.0.0, align 16
+ ret void
+}
+
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind