summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2014-04-21 17:23:12 +0000
committerEli Bendersky <eliben@google.com>2014-04-21 17:23:12 +0000
commit85af3e744592e282fec6c2209579ad29795c2e84 (patch)
tree7bd87c92c882e90c8fe3c0176bf1ea045c7e25c1
parent7e0b3fbae921385e2868631e43f831b2b1841f43 (diff)
downloadllvm-85af3e744592e282fec6c2209579ad29795c2e84.tar.gz
llvm-85af3e744592e282fec6c2209579ad29795c2e84.tar.bz2
llvm-85af3e744592e282fec6c2209579ad29795c2e84.tar.xz
Fix the test: DCE optimized away everything.
Use volatile store to protect the generated PTX from DCE. Patch by Jingyue Wu. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206763 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGen/NVPTX/local-stack-frame.ll18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/CodeGen/NVPTX/local-stack-frame.ll b/test/CodeGen/NVPTX/local-stack-frame.ll
index 178dff1a5d..c0d7d1c3a6 100644
--- a/test/CodeGen/NVPTX/local-stack-frame.ll
+++ b/test/CodeGen/NVPTX/local-stack-frame.ll
@@ -3,16 +3,16 @@
; Ensure we access the local stack properly
-; PTX32: mov.u32 %r{{[0-9]+}}, __local_depot{{[0-9]+}};
-; PTX32: cvta.local.u32 %SP, %r{{[0-9]+}};
-; PTX32: ld.param.u32 %r{{[0-9]+}}, [foo_param_0];
-; PTX32: st.u32 [%SP+0], %r{{[0-9]+}};
-; PTX64: mov.u64 %rl{{[0-9]+}}, __local_depot{{[0-9]+}};
-; PTX64: cvta.local.u64 %SP, %rl{{[0-9]+}};
-; PTX64: ld.param.u32 %r{{[0-9]+}}, [foo_param_0];
-; PTX64: st.u32 [%SP+0], %r{{[0-9]+}};
+; PTX32: mov.u32 %r{{[0-9]+}}, __local_depot{{[0-9]+}};
+; PTX32: cvta.local.u32 %SP, %r{{[0-9]+}};
+; PTX32: ld.param.u32 %r{{[0-9]+}}, [foo_param_0];
+; PTX32: st.volatile.u32 [%SP+0], %r{{[0-9]+}};
+; PTX64: mov.u64 %rl{{[0-9]+}}, __local_depot{{[0-9]+}};
+; PTX64: cvta.local.u64 %SP, %rl{{[0-9]+}};
+; PTX64: ld.param.u32 %r{{[0-9]+}}, [foo_param_0];
+; PTX64: st.volatile.u32 [%SP+0], %r{{[0-9]+}};
define void @foo(i32 %a) {
%local = alloca i32, align 4
- store i32 %a, i32* %local
+ store volatile i32 %a, i32* %local
ret void
}