Commit ebc5607
[AMDGPU] Use wavefront scope for single-wave workgroup synchronization (llvm#187673)
Workgroup-scoped fences and non-relaxed workgroup atomics were
previously legalized with synchronization strong enough for multi-wave
workgroups.
When the kernel's maximum flat work-group size does not exceed the
wavefront size, the workgroup contains only a single wavefront, so
workgroup-scoped synchronization is equivalent to wavefront scope and
the stronger legalization is unnecessary.
SIMemoryLegalizer now demotes workgroup scope to wavefront scope
in this case for workgroup-scoped fences and for non-relaxed atomic
load, store, atomicrmw, and cmpxchg operations.
This allows subsequent legalization to operate at wavefront scope.
The decision is based on AMDGPUSubtarget::isSingleWavefrontWorkgroup.
---------
Co-authored-by: Barbara Mitic <Barbara.Mitic@amd.com>1 parent 9cf8152 commit ebc5607
File tree
8 files changed
+3065
-611
lines changed- llvm
- docs
- lib/Target/AMDGPU
- test/CodeGen/AMDGPU
8 files changed
+3065
-611
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7160 | 7160 | | |
7161 | 7161 | | |
7162 | 7162 | | |
| 7163 | + | |
| 7164 | + | |
| 7165 | + | |
| 7166 | + | |
| 7167 | + | |
| 7168 | + | |
| 7169 | + | |
| 7170 | + | |
| 7171 | + | |
| 7172 | + | |
| 7173 | + | |
| 7174 | + | |
7163 | 7175 | | |
7164 | 7176 | | |
7165 | 7177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 97 | + | |
| 98 | + | |
101 | 99 | | |
102 | 100 | | |
103 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
210 | 222 | | |
211 | 223 | | |
212 | 224 | | |
| |||
277 | 289 | | |
278 | 290 | | |
279 | 291 | | |
| 292 | + | |
280 | 293 | | |
281 | 294 | | |
282 | 295 | | |
| |||
300 | 313 | | |
301 | 314 | | |
302 | 315 | | |
303 | | - | |
| 316 | + | |
| 317 | + | |
304 | 318 | | |
305 | 319 | | |
306 | 320 | | |
| |||
779 | 793 | | |
780 | 794 | | |
781 | 795 | | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
782 | 799 | | |
783 | | - | |
784 | | - | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
785 | 803 | | |
786 | 804 | | |
787 | 805 | | |
| |||
851 | 869 | | |
852 | 870 | | |
853 | 871 | | |
854 | | - | |
| 872 | + | |
| 873 | + | |
855 | 874 | | |
856 | 875 | | |
857 | 876 | | |
| |||
920 | 939 | | |
921 | 940 | | |
922 | 941 | | |
923 | | - | |
| 942 | + | |
| 943 | + | |
924 | 944 | | |
925 | 945 | | |
926 | 946 | | |
| |||
2533 | 2553 | | |
2534 | 2554 | | |
2535 | 2555 | | |
2536 | | - | |
| 2556 | + | |
| 2557 | + | |
2537 | 2558 | | |
2538 | 2559 | | |
2539 | 2560 | | |
| |||
0 commit comments