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 0
54 name: basic_insert_dcache_wb
55 tracksRegLiveness: false
61 S_STORE_DWORD_SGPR undef $sgpr2, undef $sgpr0_sgpr1, undef $m0, 0, 0
65 # Already has an explicitly requested flush after the last store.
66 # CHECK-LABEL: name: explicit_flush_after
68 # CHECK-NEXT: S_STORE_DWORD
69 # CHECK-NEXT: S_DCACHE_WB
70 # CHECK-NEXT: S_ENDPGM 0
72 name: explicit_flush_after
73 tracksRegLiveness: false
79 S_STORE_DWORD_SGPR undef $sgpr2, undef $sgpr0_sgpr1, undef $m0, 0, 0
84 # Already has an explicitly requested flush before the last store.
85 # CHECK-LABEL: name: explicit_flush_before
87 # CHECK-NEXT: S_DCACHE_WB
88 # CHECK-NEXT: S_STORE_DWORD
89 # CHECK-NEXT: S_DCACHE_WB
90 # CHECK-NEXT: S_ENDPGM 0
92 name: explicit_flush_before
93 tracksRegLiveness: false
100 S_STORE_DWORD_SGPR undef $sgpr2, undef $sgpr0_sgpr1, undef $m0, 0, 0
104 # CHECK-LABEL: no_scalar_store
106 # CHECK-NEXT: S_ENDPGM 0
107 name: no_scalar_store
108 tracksRegLiveness: false
110 isEntryFunction: true
117 # CHECK-LABEL: name: multi_block_store
119 # CHECK-NEXT: S_STORE_DWORD
120 # CHECK-NEXT: S_DCACHE_WB
121 # CHECK-NEXT: S_ENDPGM 0
124 # CHECK-NEXT: S_STORE_DWORD
125 # CHECK-NEXT: S_DCACHE_WB
126 # CHECK-NEXT: S_ENDPGM 0
128 name: multi_block_store
129 tracksRegLiveness: false
131 isEntryFunction: true
135 S_STORE_DWORD_SGPR undef $sgpr2, undef $sgpr0_sgpr1, undef $m0, 0, 0
139 S_STORE_DWORD_SGPR undef $sgpr4, undef $sgpr6_sgpr7, undef $m0, 0, 0
144 # This one should be able to omit the flush in the storeless block but
145 # this isn't handled now.
147 # CHECK-LABEL: name: one_block_store
149 # CHECK-NEXT: S_DCACHE_WB
150 # CHECK-NEXT: S_ENDPGM 0
153 # CHECK-NEXT: S_STORE_DWORD
154 # CHECK-NEXT: S_DCACHE_WB
155 # CHECK-NEXT: S_ENDPGM 0
157 name: one_block_store
158 tracksRegLiveness: false
160 isEntryFunction: true
167 S_STORE_DWORD_SGPR undef $sgpr4, undef $sgpr6_sgpr7, undef $m0, 0, 0
171 # CHECK-LABEL: name: si_return
173 # CHECK-NEXT: S_STORE_DWORD
174 # CHECK-NEXT: S_WAITCNT
175 # CHECK-NEXT: S_DCACHE_WB
176 # CHECK-NEXT: SI_RETURN
179 tracksRegLiveness: false
181 isEntryFunction: true
185 S_STORE_DWORD_SGPR undef $sgpr2, undef $sgpr0_sgpr1, undef $m0, 0, 0
186 SI_RETURN_TO_EPILOG undef $vgpr0