[LoopVectorize] Teach Loop Vectorizor about interleaved memory accesses.
[oota-llvm.git] / test / Transforms / DeadStoreElimination / PartialStore.ll
index 4799ef3383bc2073d515b05695103396dece550f..d85b4de0ab983d0bf2c77acd68a435092705d79c 100644 (file)
@@ -30,8 +30,8 @@ define i32 @test3(double %__x) {
   %__u = alloca { [3 x i32] }
   %tmp.1 = bitcast { [3 x i32] }* %__u to double*
   store double %__x, double* %tmp.1
-  %tmp.4 = getelementptr { [3 x i32] }* %__u, i32 0, i32 0, i32 1
-  %tmp.5 = load i32* %tmp.4
+  %tmp.4 = getelementptr { [3 x i32] }, { [3 x i32] }* %__u, i32 0, i32 0, i32 1
+  %tmp.5 = load i32, i32* %tmp.4
   %tmp.6 = icmp slt i32 %tmp.5, 0
   %tmp.7 = zext i1 %tmp.6 to i32
   ret i32 %tmp.7
@@ -44,10 +44,10 @@ define void @test4(i8* %P) {
 ; CHECK-NEXT: store double
 
   store i8 19, i8* %P  ;; dead
-  %A = getelementptr i8* %P, i32 3
-  
+  %A = getelementptr i8, i8* %P, i32 3
+
   store i8 42, i8* %A  ;; dead
-  
+
   %Q = bitcast i8* %P to double*
   store double 0.0, double* %Q
   ret void
@@ -58,10 +58,10 @@ declare void @test5a(i32*)
 define void @test5(i32 %i) nounwind ssp {
   %A = alloca i32
   %B = bitcast i32* %A to i8*
-  %C = getelementptr i8* %B, i32 %i
+  %C = getelementptr i8, i8* %B, i32 %i
   store i8 10, i8* %C        ;; Dead store to variable index.
   store i32 20, i32* %A
-  
+
   call void @test5a(i32* %A)
   ret void
 ; CHECK-LABEL: @test5(
@@ -69,3 +69,19 @@ define void @test5(i32 %i) nounwind ssp {
 ; CHECK-NEXT: store i32 20
 ; CHECK-NEXT: call void @test5a
 }
+
+declare void @test5a_as1(i32*)
+define void @test5_addrspacecast(i32 %i) nounwind ssp {
+  %A = alloca i32
+  %B = addrspacecast i32* %A to i8 addrspace(1)*
+  %C = getelementptr i8, i8 addrspace(1)* %B, i32 %i
+  store i8 10, i8 addrspace(1)* %C        ;; Dead store to variable index.
+  store i32 20, i32* %A
+
+  call void @test5a(i32* %A)
+  ret void
+; CHECK-LABEL: @test5_addrspacecast(
+; CHECK-NEXT: alloca
+; CHECK-NEXT: store i32 20
+; CHECK-NEXT: call void @test5a
+}