summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-07-15 00:56:40 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-07-15 00:56:40 +0000
commit70f4db88d5b749a697d49fee7ceedb59bfba2b75 (patch)
tree7c3aa98ef4aab437adc68a6474b307130e8dc204 /llvm/test/Transforms
parent7a63c3b3899fd33b51c2d32f08cad34b5ee5a46f (diff)
downloadbcm5719-llvm-70f4db88d5b749a697d49fee7ceedb59bfba2b75.tar.gz
bcm5719-llvm-70f4db88d5b749a697d49fee7ceedb59bfba2b75.zip
Teach GetUnderlyingObject / BasicAA about addrspacecast
llvm-svn: 213025
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/DeadStoreElimination/PartialStore.ll22
-rw-r--r--llvm/test/Transforms/DeadStoreElimination/simple.ll17
2 files changed, 36 insertions, 3 deletions
diff --git a/llvm/test/Transforms/DeadStoreElimination/PartialStore.ll b/llvm/test/Transforms/DeadStoreElimination/PartialStore.ll
index 4799ef3383b..80c2bfae846 100644
--- a/llvm/test/Transforms/DeadStoreElimination/PartialStore.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/PartialStore.ll
@@ -45,9 +45,9 @@ define void @test4(i8* %P) {
store i8 19, i8* %P ;; dead
%A = getelementptr i8* %P, i32 3
-
+
store i8 42, i8* %A ;; dead
-
+
%Q = bitcast i8* %P to double*
store double 0.0, double* %Q
ret void
@@ -61,7 +61,7 @@ define void @test5(i32 %i) nounwind ssp {
%C = getelementptr 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 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
+}
diff --git a/llvm/test/Transforms/DeadStoreElimination/simple.ll b/llvm/test/Transforms/DeadStoreElimination/simple.ll
index cdfe2268eff..1e813852b04 100644
--- a/llvm/test/Transforms/DeadStoreElimination/simple.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/simple.ll
@@ -172,6 +172,23 @@ define i32* @test13() {
; CHECK-NEXT: call void
}
+define i32 addrspace(1)* @test13_addrspacecast() {
+ %p = tail call i8* @malloc(i32 4)
+ %p.bc = bitcast i8* %p to i32*
+ %P = addrspacecast i32* %p.bc to i32 addrspace(1)*
+ %DEAD = load i32 addrspace(1)* %P
+ %DEAD2 = add i32 %DEAD, 1
+ store i32 %DEAD2, i32 addrspace(1)* %P
+ call void @test13f( )
+ store i32 0, i32 addrspace(1)* %P
+ ret i32 addrspace(1)* %P
+; CHECK: @test13_addrspacecast()
+; CHECK-NEXT: malloc
+; CHECK-NEXT: bitcast
+; CHECK-NEXT: addrspacecast
+; CHECK-NEXT: call void
+}
+
declare noalias i8* @malloc(i32)
declare noalias i8* @calloc(i32, i32)
OpenPOWER on IntegriCloud