1 # RUN: llc -march=amdgcn -run-pass si-insert-waitcnts %s -o - | FileCheck %s
4 define amdgpu_kernel void @basic_insert_dcache_wb() {
8 define amdgpu_kernel void @explicit_flush_after() {
12 define amdgpu_kernel void @explicit_flush_before() {
16 define amdgpu_kernel void @no_scalar_store() {
20 define amdgpu_kernel void @multi_block_store() {
22 br i1 undef, label %bb1, label %bb2
31 define amdgpu_kernel void @one_block_store() {
33 br i1 undef, label %bb1, label %bb2
42 define amdgpu_ps float @si_return() {
48 # CHECK-LABEL: name: basic_insert_dcache_wb
50 # CHECK-NEXT: S_STORE_DWORD
51 # CHECK-NEXT: S_DCACHE_WB
52 # CHECK-NEXT: S_ENDPGM
54 name: basic_insert_dcache_wb
55 tracksRegLiveness: false
59 S_STORE_DWORD_SGPR undef $sgpr2, undef $sgpr0_sgpr1, undef $m0, 0
63 # Already has an explicitly requested flush after the last store.
64 # CHECK-LABEL: name: explicit_flush_after
66 # CHECK-NEXT: S_STORE_DWORD
67 # CHECK-NEXT: S_DCACHE_WB
68 # CHECK-NEXT: S_ENDPGM
70 name: explicit_flush_after
71 tracksRegLiveness: false
75 S_STORE_DWORD_SGPR undef $sgpr2, undef $sgpr0_sgpr1, undef $m0, 0
80 # Already has an explicitly requested flush before the last store.
81 # CHECK-LABEL: name: explicit_flush_before
83 # CHECK-NEXT: S_DCACHE_WB
84 # CHECK-NEXT: S_STORE_DWORD
85 # CHECK-NEXT: S_DCACHE_WB
86 # CHECK-NEXT: S_ENDPGM
88 name: explicit_flush_before
89 tracksRegLiveness: false
94 S_STORE_DWORD_SGPR undef $sgpr2, undef $sgpr0_sgpr1, undef $m0, 0
98 # CHECK-LABEL: no_scalar_store
100 # CHECK-NEXT: S_ENDPGM
101 name: no_scalar_store
102 tracksRegLiveness: false
109 # CHECK-LABEL: name: multi_block_store
111 # CHECK-NEXT: S_STORE_DWORD
112 # CHECK-NEXT: S_DCACHE_WB
113 # CHECK-NEXT: S_ENDPGM
116 # CHECK-NEXT: S_STORE_DWORD
117 # CHECK-NEXT: S_DCACHE_WB
118 # CHECK-NEXT: S_ENDPGM
120 name: multi_block_store
121 tracksRegLiveness: false
125 S_STORE_DWORD_SGPR undef $sgpr2, undef $sgpr0_sgpr1, undef $m0, 0
129 S_STORE_DWORD_SGPR undef $sgpr4, undef $sgpr6_sgpr7, undef $m0, 0
134 # This one should be able to omit the flush in the storeless block but
135 # this isn't handled now.
137 # CHECK-LABEL: name: one_block_store
139 # CHECK-NEXT: S_DCACHE_WB
140 # CHECK-NEXT: S_ENDPGM
143 # CHECK-NEXT: S_STORE_DWORD
144 # CHECK-NEXT: S_DCACHE_WB
145 # CHECK-NEXT: S_ENDPGM
147 name: one_block_store
148 tracksRegLiveness: false
155 S_STORE_DWORD_SGPR undef $sgpr4, undef $sgpr6_sgpr7, undef $m0, 0
159 # CHECK-LABEL: name: si_return
161 # CHECK-NEXT: S_STORE_DWORD
162 # CHECK-NEXT: S_WAITCNT
163 # CHECK-NEXT: S_DCACHE_WB
164 # CHECK-NEXT: SI_RETURN
167 tracksRegLiveness: false
171 S_STORE_DWORD_SGPR undef $sgpr2, undef $sgpr0_sgpr1, undef $m0, 0
172 SI_RETURN_TO_EPILOG undef $vgpr0