[PATCH] Fix the local-stack-framework test
Jingyue Wu
jingyue at google.com
Fri Apr 18 22:20:54 PDT 2014
Hi eliben, jholewinski,
DCE optimized away everything. Use volatile store to protect the generated PTX from DCE.
TEST PLAN
make -C test
http://reviews.llvm.org/D3434
Files:
test/CodeGen/NVPTX/local-stack-frame.ll
Index: test/CodeGen/NVPTX/local-stack-frame.ll
===================================================================
--- test/CodeGen/NVPTX/local-stack-frame.ll
+++ 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
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3434.1.patch
Type: text/x-patch
Size: 1376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140418/3b6ff84f/attachment.bin>
More information about the llvm-commits
mailing list