Skip to content

Commit 7cd70df

Browse files
committed
Fix the test: DCE optimized away everything.
Use volatile store to protect the generated PTX from DCE. Patch by Jingyue Wu. llvm-svn: 206763
1 parent 5d66da7 commit 7cd70df

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

llvm/test/CodeGen/NVPTX/local-stack-frame.ll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33

44
; Ensure we access the local stack properly
55

6-
; PTX32: mov.u32 %r{{[0-9]+}}, __local_depot{{[0-9]+}};
7-
; PTX32: cvta.local.u32 %SP, %r{{[0-9]+}};
8-
; PTX32: ld.param.u32 %r{{[0-9]+}}, [foo_param_0];
9-
; PTX32: st.u32 [%SP+0], %r{{[0-9]+}};
10-
; PTX64: mov.u64 %rl{{[0-9]+}}, __local_depot{{[0-9]+}};
11-
; PTX64: cvta.local.u64 %SP, %rl{{[0-9]+}};
12-
; PTX64: ld.param.u32 %r{{[0-9]+}}, [foo_param_0];
13-
; PTX64: st.u32 [%SP+0], %r{{[0-9]+}};
6+
; PTX32: mov.u32 %r{{[0-9]+}}, __local_depot{{[0-9]+}};
7+
; PTX32: cvta.local.u32 %SP, %r{{[0-9]+}};
8+
; PTX32: ld.param.u32 %r{{[0-9]+}}, [foo_param_0];
9+
; PTX32: st.volatile.u32 [%SP+0], %r{{[0-9]+}};
10+
; PTX64: mov.u64 %rl{{[0-9]+}}, __local_depot{{[0-9]+}};
11+
; PTX64: cvta.local.u64 %SP, %rl{{[0-9]+}};
12+
; PTX64: ld.param.u32 %r{{[0-9]+}}, [foo_param_0];
13+
; PTX64: st.volatile.u32 [%SP+0], %r{{[0-9]+}};
1414
define void @foo(i32 %a) {
1515
%local = alloca i32, align 4
16-
store i32 %a, i32* %local
16+
store volatile i32 %a, i32* %local
1717
ret void
1818
}

0 commit comments

Comments
 (0)