summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/FunctionAttrs
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-01-14 19:11:52 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-01-14 19:11:52 +0000
commite55a2c2e6bda2cdd2350c478cb08df440f263db8 (patch)
tree622d3bb5fc2226de7d6303cd91cd015cba3c7224 /llvm/test/Transforms/FunctionAttrs
parent6633d57ae427515801ca24478add077c5049e7de (diff)
downloadbcm5719-llvm-e55a2c2e6bda2cdd2350c478cb08df440f263db8.tar.gz
bcm5719-llvm-e55a2c2e6bda2cdd2350c478cb08df440f263db8.zip
Make nocapture analysis work with addrspacecast
llvm-svn: 199246
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs')
-rw-r--r--llvm/test/Transforms/FunctionAttrs/nocapture.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/nocapture.ll b/llvm/test/Transforms/FunctionAttrs/nocapture.ll
index 110bd03dac7..d2460c0b6de 100644
--- a/llvm/test/Transforms/FunctionAttrs/nocapture.ll
+++ b/llvm/test/Transforms/FunctionAttrs/nocapture.ll
@@ -91,6 +91,21 @@ l:
ret i32 %val
}
+; CHECK: define i32 @nc1_addrspace(i32* %q, i32 addrspace(1)* nocapture %p, i1 %b)
+define i32 @nc1_addrspace(i32* %q, i32 addrspace(1)* %p, i1 %b) {
+e:
+ br label %l
+l:
+ %x = phi i32 addrspace(1)* [ %p, %e ]
+ %y = phi i32* [ %q, %e ]
+ %tmp = addrspacecast i32 addrspace(1)* %x to i32* ; <i32*> [#uses=2]
+ %tmp2 = select i1 %b, i32* %tmp, i32* %y
+ %val = load i32* %tmp2 ; <i32> [#uses=1]
+ store i32 0, i32* %tmp
+ store i32* %y, i32** @g
+ ret i32 %val
+}
+
; CHECK: define void @nc2(i32* nocapture %p, i32* %q)
define void @nc2(i32* %p, i32* %q) {
%1 = call i32 @nc1(i32* %q, i32* %p, i1 0) ; <i32> [#uses=0]
OpenPOWER on IntegriCloud