summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-10-30 20:52:40 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-10-30 20:52:40 +0000
commit70dace3052984e843202ec98844a2a6636debb89 (patch)
tree2a32dbbcbbc18876f946ba06d0f4d8d5ba48a208 /test
parentdaeec8fad3a3038247df1e5081b74454e7ee9315 (diff)
downloadllvm-70dace3052984e843202ec98844a2a6636debb89.tar.gz
llvm-70dace3052984e843202ec98844a2a6636debb89.tar.bz2
llvm-70dace3052984e843202ec98844a2a6636debb89.tar.xz
Fix PR14212: For some strange reason I treated vectors differently from
integers in that the code to handle split alloca-wide integer loads or stores doesn't come first. It should, for the same reasons as with integers, and the PR attests to that. Also had to fix a busted assert in that this test case also covers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/SROA/vector-promotion.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/SROA/vector-promotion.ll b/test/Transforms/SROA/vector-promotion.ll
index 92051c62a7..02e084bf11 100644
--- a/test/Transforms/SROA/vector-promotion.ll
+++ b/test/Transforms/SROA/vector-promotion.ll
@@ -205,3 +205,18 @@ define i64 @test6(<4 x i64> %x, <4 x i64> %y, i64 %n) {
%res = load i64* %addr, align 4
ret i64 %res
}
+
+define i32 @PR14212() {
+; CHECK: @PR14212
+; This caused a crash when "splitting" the load of the i32 in order to promote
+; the store of <3 x i8> properly. Heavily reduced from an OpenCL test case.
+entry:
+ %retval = alloca <3 x i8>, align 4
+; CHECK-NOT: alloca
+
+ store <3 x i8> undef, <3 x i8>* %retval, align 4
+ %cast = bitcast <3 x i8>* %retval to i32*
+ %load = load i32* %cast, align 4
+ ret i32 %load
+; CHECK: ret i32
+}