diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-08-19 21:43:16 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-08-19 21:43:16 +0000 |
| commit | 74742a1bb0b38058a75ec5bdd9ffa082c5331d44 (patch) | |
| tree | fa331c19c983f293de64127676d2f395d7822513 /llvm/test | |
| parent | 9309322454e363ce4121529b643f4700d8ab33bd (diff) | |
| download | bcm5719-llvm-74742a1bb0b38058a75ec5bdd9ffa082c5331d44.tar.gz bcm5719-llvm-74742a1bb0b38058a75ec5bdd9ffa082c5331d44.zip | |
Fix assert with GEP ptr vector indexing structs
Also fix it calculating the wrong value. The struct index
is not a ConstantInt, so it was being interpreted as an array
index.
llvm-svn: 188713
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/getelementptr.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/getelementptr.ll b/llvm/test/Transforms/InstCombine/getelementptr.ll index a0e3375cf8a..92be87c58f8 100644 --- a/llvm/test/Transforms/InstCombine/getelementptr.ll +++ b/llvm/test/Transforms/InstCombine/getelementptr.ll @@ -129,6 +129,17 @@ define i1 @test13(i64 %X, %S* %P) { ; CHECK: %C = icmp eq i64 %X, -1 } +define <2 x i1> @test13_vector(<2 x i64> %X, <2 x %S*> %P) nounwind { +; CHECK-LABEL: @test13_vector( +; CHECK-NEXT: shl nuw <2 x i64> %X, <i64 2, i64 2> +; CHECK-NEXT: add <2 x i64> %A.idx, <i64 4, i64 4> +; CHECK-NEXT: icmp eq <2 x i64> %A.offs, zeroinitializer + %A = getelementptr inbounds <2 x %S*> %P, <2 x i64> zeroinitializer, <2 x i32> <i32 1, i32 1>, <2 x i64> %X + %B = getelementptr inbounds <2 x %S*> %P, <2 x i64> <i64 0, i64 0>, <2 x i32> <i32 0, i32 0> + %C = icmp eq <2 x i32*> %A, %B + ret <2 x i1> %C +} + define i1 @test13_i32(i32 %X, %S* %P) { ; CHECK-LABEL: @test13_i32( ; CHECK: %C = icmp eq i32 %X, -1 |

