Skip to content

Commit 4ab5efd

Browse files
authored
[AMDGPU][gfx1250] Add memory legalizer tests (NFC) (#154725)
1 parent f1aee59 commit 4ab5efd

26 files changed

+20931
-1119
lines changed

llvm/test/CodeGen/AMDGPU/memory-legalizer-fence-mmra-global.ll

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1100 -mattr=+cumode < %s | FileCheck --check-prefixes=GFX11-CU %s
1313
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 < %s | FileCheck --check-prefixes=GFX12-WGP %s
1414
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 -mattr=+cumode < %s | FileCheck --check-prefixes=GFX12-CU %s
15+
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1250 < %s | FileCheck --check-prefixes=GFX1250 %s
1516

1617
define amdgpu_kernel void @workgroup_acquire_fence() {
1718
; GFX6-LABEL: workgroup_acquire_fence:
@@ -78,6 +79,10 @@ define amdgpu_kernel void @workgroup_acquire_fence() {
7879
; GFX12-CU-LABEL: workgroup_acquire_fence:
7980
; GFX12-CU: ; %bb.0: ; %entry
8081
; GFX12-CU-NEXT: s_endpgm
82+
;
83+
; GFX1250-LABEL: workgroup_acquire_fence:
84+
; GFX1250: ; %bb.0: ; %entry
85+
; GFX1250-NEXT: s_endpgm
8186
entry:
8287
fence syncscope("workgroup") acquire, !mmra !{!"amdgpu-synchronize-as", !"global"}
8388
ret void
@@ -145,6 +150,10 @@ define amdgpu_kernel void @workgroup_release_fence() {
145150
; GFX12-CU-LABEL: workgroup_release_fence:
146151
; GFX12-CU: ; %bb.0: ; %entry
147152
; GFX12-CU-NEXT: s_endpgm
153+
;
154+
; GFX1250-LABEL: workgroup_release_fence:
155+
; GFX1250: ; %bb.0: ; %entry
156+
; GFX1250-NEXT: s_endpgm
148157
entry:
149158
fence syncscope("workgroup") release, !mmra !{!"amdgpu-synchronize-as", !"global"}
150159
ret void
@@ -217,6 +226,10 @@ define amdgpu_kernel void @workgroup_acq_rel_fence() {
217226
; GFX12-CU-LABEL: workgroup_acq_rel_fence:
218227
; GFX12-CU: ; %bb.0: ; %entry
219228
; GFX12-CU-NEXT: s_endpgm
229+
;
230+
; GFX1250-LABEL: workgroup_acq_rel_fence:
231+
; GFX1250: ; %bb.0: ; %entry
232+
; GFX1250-NEXT: s_endpgm
220233
entry:
221234
fence syncscope("workgroup") acq_rel, !mmra !{!"amdgpu-synchronize-as", !"global"}
222235
ret void
@@ -289,6 +302,10 @@ define amdgpu_kernel void @workgroup_seq_cst_fence() {
289302
; GFX12-CU-LABEL: workgroup_seq_cst_fence:
290303
; GFX12-CU: ; %bb.0: ; %entry
291304
; GFX12-CU-NEXT: s_endpgm
305+
;
306+
; GFX1250-LABEL: workgroup_seq_cst_fence:
307+
; GFX1250: ; %bb.0: ; %entry
308+
; GFX1250-NEXT: s_endpgm
292309
entry:
293310
fence syncscope("workgroup") seq_cst, !mmra !{!"amdgpu-synchronize-as", !"global"}
294311
ret void
@@ -359,6 +376,10 @@ define amdgpu_kernel void @workgroup_one_as_acquire_fence() {
359376
; GFX12-CU-LABEL: workgroup_one_as_acquire_fence:
360377
; GFX12-CU: ; %bb.0: ; %entry
361378
; GFX12-CU-NEXT: s_endpgm
379+
;
380+
; GFX1250-LABEL: workgroup_one_as_acquire_fence:
381+
; GFX1250: ; %bb.0: ; %entry
382+
; GFX1250-NEXT: s_endpgm
362383
entry:
363384
fence syncscope("workgroup-one-as") acquire, !mmra !{!"amdgpu-synchronize-as", !"global"}
364385
ret void
@@ -426,6 +447,10 @@ define amdgpu_kernel void @workgroup_one_as_release_fence() {
426447
; GFX12-CU-LABEL: workgroup_one_as_release_fence:
427448
; GFX12-CU: ; %bb.0: ; %entry
428449
; GFX12-CU-NEXT: s_endpgm
450+
;
451+
; GFX1250-LABEL: workgroup_one_as_release_fence:
452+
; GFX1250: ; %bb.0: ; %entry
453+
; GFX1250-NEXT: s_endpgm
429454
entry:
430455
fence syncscope("workgroup-one-as") release, !mmra !{!"amdgpu-synchronize-as", !"global"}
431456
ret void
@@ -498,6 +523,10 @@ define amdgpu_kernel void @workgroup_one_as_acq_rel_fence() {
498523
; GFX12-CU-LABEL: workgroup_one_as_acq_rel_fence:
499524
; GFX12-CU: ; %bb.0: ; %entry
500525
; GFX12-CU-NEXT: s_endpgm
526+
;
527+
; GFX1250-LABEL: workgroup_one_as_acq_rel_fence:
528+
; GFX1250: ; %bb.0: ; %entry
529+
; GFX1250-NEXT: s_endpgm
501530
entry:
502531
fence syncscope("workgroup-one-as") acq_rel, !mmra !{!"amdgpu-synchronize-as", !"global"}
503532
ret void
@@ -570,6 +599,10 @@ define amdgpu_kernel void @workgroup_one_as_seq_cst_fence() {
570599
; GFX12-CU-LABEL: workgroup_one_as_seq_cst_fence:
571600
; GFX12-CU: ; %bb.0: ; %entry
572601
; GFX12-CU-NEXT: s_endpgm
602+
;
603+
; GFX1250-LABEL: workgroup_one_as_seq_cst_fence:
604+
; GFX1250: ; %bb.0: ; %entry
605+
; GFX1250-NEXT: s_endpgm
573606
entry:
574607
fence syncscope("workgroup-one-as") seq_cst, !mmra !{!"amdgpu-synchronize-as", !"global"}
575608
ret void
@@ -662,6 +695,13 @@ define amdgpu_kernel void @agent_acquire_fence() {
662695
; GFX12-CU-NEXT: s_wait_storecnt 0x0
663696
; GFX12-CU-NEXT: global_inv scope:SCOPE_DEV
664697
; GFX12-CU-NEXT: s_endpgm
698+
;
699+
; GFX1250-LABEL: agent_acquire_fence:
700+
; GFX1250: ; %bb.0: ; %entry
701+
; GFX1250-NEXT: s_wait_loadcnt 0x0
702+
; GFX1250-NEXT: s_wait_storecnt 0x0
703+
; GFX1250-NEXT: global_inv scope:SCOPE_DEV
704+
; GFX1250-NEXT: s_endpgm
665705
entry:
666706
fence syncscope("agent") acquire, !mmra !{!"amdgpu-synchronize-as", !"global"}
667707
ret void
@@ -744,6 +784,14 @@ define amdgpu_kernel void @agent_release_fence() {
744784
; GFX12-CU-NEXT: s_wait_loadcnt 0x0
745785
; GFX12-CU-NEXT: s_wait_storecnt 0x0
746786
; GFX12-CU-NEXT: s_endpgm
787+
;
788+
; GFX1250-LABEL: agent_release_fence:
789+
; GFX1250: ; %bb.0: ; %entry
790+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
791+
; GFX1250-NEXT: s_wait_samplecnt 0x0
792+
; GFX1250-NEXT: s_wait_loadcnt 0x0
793+
; GFX1250-NEXT: s_wait_storecnt 0x0
794+
; GFX1250-NEXT: s_endpgm
747795
entry:
748796
fence syncscope("agent") release, !mmra !{!"amdgpu-synchronize-as", !"global"}
749797
ret void
@@ -842,6 +890,15 @@ define amdgpu_kernel void @agent_acq_rel_fence() {
842890
; GFX12-CU-NEXT: s_wait_storecnt 0x0
843891
; GFX12-CU-NEXT: global_inv scope:SCOPE_DEV
844892
; GFX12-CU-NEXT: s_endpgm
893+
;
894+
; GFX1250-LABEL: agent_acq_rel_fence:
895+
; GFX1250: ; %bb.0: ; %entry
896+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
897+
; GFX1250-NEXT: s_wait_samplecnt 0x0
898+
; GFX1250-NEXT: s_wait_loadcnt 0x0
899+
; GFX1250-NEXT: s_wait_storecnt 0x0
900+
; GFX1250-NEXT: global_inv scope:SCOPE_DEV
901+
; GFX1250-NEXT: s_endpgm
845902
entry:
846903
fence syncscope("agent") acq_rel, !mmra !{!"amdgpu-synchronize-as", !"global"}
847904
ret void
@@ -940,6 +997,15 @@ define amdgpu_kernel void @agent_seq_cst_fence() {
940997
; GFX12-CU-NEXT: s_wait_storecnt 0x0
941998
; GFX12-CU-NEXT: global_inv scope:SCOPE_DEV
942999
; GFX12-CU-NEXT: s_endpgm
1000+
;
1001+
; GFX1250-LABEL: agent_seq_cst_fence:
1002+
; GFX1250: ; %bb.0: ; %entry
1003+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
1004+
; GFX1250-NEXT: s_wait_samplecnt 0x0
1005+
; GFX1250-NEXT: s_wait_loadcnt 0x0
1006+
; GFX1250-NEXT: s_wait_storecnt 0x0
1007+
; GFX1250-NEXT: global_inv scope:SCOPE_DEV
1008+
; GFX1250-NEXT: s_endpgm
9431009
entry:
9441010
fence syncscope("agent") seq_cst, !mmra !{!"amdgpu-synchronize-as", !"global"}
9451011
ret void
@@ -1032,6 +1098,13 @@ define amdgpu_kernel void @agent_one_as_acquire_fence() {
10321098
; GFX12-CU-NEXT: s_wait_storecnt 0x0
10331099
; GFX12-CU-NEXT: global_inv scope:SCOPE_DEV
10341100
; GFX12-CU-NEXT: s_endpgm
1101+
;
1102+
; GFX1250-LABEL: agent_one_as_acquire_fence:
1103+
; GFX1250: ; %bb.0: ; %entry
1104+
; GFX1250-NEXT: s_wait_loadcnt 0x0
1105+
; GFX1250-NEXT: s_wait_storecnt 0x0
1106+
; GFX1250-NEXT: global_inv scope:SCOPE_DEV
1107+
; GFX1250-NEXT: s_endpgm
10351108
entry:
10361109
fence syncscope("agent-one-as") acquire, !mmra !{!"amdgpu-synchronize-as", !"global"}
10371110
ret void
@@ -1114,6 +1187,14 @@ define amdgpu_kernel void @agent_one_as_release_fence() {
11141187
; GFX12-CU-NEXT: s_wait_loadcnt 0x0
11151188
; GFX12-CU-NEXT: s_wait_storecnt 0x0
11161189
; GFX12-CU-NEXT: s_endpgm
1190+
;
1191+
; GFX1250-LABEL: agent_one_as_release_fence:
1192+
; GFX1250: ; %bb.0: ; %entry
1193+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
1194+
; GFX1250-NEXT: s_wait_samplecnt 0x0
1195+
; GFX1250-NEXT: s_wait_loadcnt 0x0
1196+
; GFX1250-NEXT: s_wait_storecnt 0x0
1197+
; GFX1250-NEXT: s_endpgm
11171198
entry:
11181199
fence syncscope("agent-one-as") release, !mmra !{!"amdgpu-synchronize-as", !"global"}
11191200
ret void
@@ -1212,6 +1293,15 @@ define amdgpu_kernel void @agent_one_as_acq_rel_fence() {
12121293
; GFX12-CU-NEXT: s_wait_storecnt 0x0
12131294
; GFX12-CU-NEXT: global_inv scope:SCOPE_DEV
12141295
; GFX12-CU-NEXT: s_endpgm
1296+
;
1297+
; GFX1250-LABEL: agent_one_as_acq_rel_fence:
1298+
; GFX1250: ; %bb.0: ; %entry
1299+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
1300+
; GFX1250-NEXT: s_wait_samplecnt 0x0
1301+
; GFX1250-NEXT: s_wait_loadcnt 0x0
1302+
; GFX1250-NEXT: s_wait_storecnt 0x0
1303+
; GFX1250-NEXT: global_inv scope:SCOPE_DEV
1304+
; GFX1250-NEXT: s_endpgm
12151305
entry:
12161306
fence syncscope("agent-one-as") acq_rel, !mmra !{!"amdgpu-synchronize-as", !"global"}
12171307
ret void
@@ -1310,6 +1400,15 @@ define amdgpu_kernel void @agent_one_as_seq_cst_fence() {
13101400
; GFX12-CU-NEXT: s_wait_storecnt 0x0
13111401
; GFX12-CU-NEXT: global_inv scope:SCOPE_DEV
13121402
; GFX12-CU-NEXT: s_endpgm
1403+
;
1404+
; GFX1250-LABEL: agent_one_as_seq_cst_fence:
1405+
; GFX1250: ; %bb.0: ; %entry
1406+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
1407+
; GFX1250-NEXT: s_wait_samplecnt 0x0
1408+
; GFX1250-NEXT: s_wait_loadcnt 0x0
1409+
; GFX1250-NEXT: s_wait_storecnt 0x0
1410+
; GFX1250-NEXT: global_inv scope:SCOPE_DEV
1411+
; GFX1250-NEXT: s_endpgm
13131412
entry:
13141413
fence syncscope("agent-one-as") seq_cst, !mmra !{!"amdgpu-synchronize-as", !"global"}
13151414
ret void
@@ -1404,6 +1503,13 @@ define amdgpu_kernel void @system_acquire_fence() {
14041503
; GFX12-CU-NEXT: s_wait_storecnt 0x0
14051504
; GFX12-CU-NEXT: global_inv scope:SCOPE_SYS
14061505
; GFX12-CU-NEXT: s_endpgm
1506+
;
1507+
; GFX1250-LABEL: system_acquire_fence:
1508+
; GFX1250: ; %bb.0: ; %entry
1509+
; GFX1250-NEXT: s_wait_loadcnt 0x0
1510+
; GFX1250-NEXT: s_wait_storecnt 0x0
1511+
; GFX1250-NEXT: global_inv scope:SCOPE_SYS
1512+
; GFX1250-NEXT: s_endpgm
14071513
entry:
14081514
fence acquire, !mmra !{!"amdgpu-synchronize-as", !"global"}
14091515
ret void
@@ -1490,6 +1596,15 @@ define amdgpu_kernel void @system_release_fence() {
14901596
; GFX12-CU-NEXT: s_wait_loadcnt 0x0
14911597
; GFX12-CU-NEXT: s_wait_storecnt 0x0
14921598
; GFX12-CU-NEXT: s_endpgm
1599+
;
1600+
; GFX1250-LABEL: system_release_fence:
1601+
; GFX1250: ; %bb.0: ; %entry
1602+
; GFX1250-NEXT: global_wb scope:SCOPE_SYS
1603+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
1604+
; GFX1250-NEXT: s_wait_samplecnt 0x0
1605+
; GFX1250-NEXT: s_wait_loadcnt 0x0
1606+
; GFX1250-NEXT: s_wait_storecnt 0x0
1607+
; GFX1250-NEXT: s_endpgm
14931608
entry:
14941609
fence release, !mmra !{!"amdgpu-synchronize-as", !"global"}
14951610
ret void
@@ -1594,6 +1709,16 @@ define amdgpu_kernel void @system_acq_rel_fence() {
15941709
; GFX12-CU-NEXT: s_wait_storecnt 0x0
15951710
; GFX12-CU-NEXT: global_inv scope:SCOPE_SYS
15961711
; GFX12-CU-NEXT: s_endpgm
1712+
;
1713+
; GFX1250-LABEL: system_acq_rel_fence:
1714+
; GFX1250: ; %bb.0: ; %entry
1715+
; GFX1250-NEXT: global_wb scope:SCOPE_SYS
1716+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
1717+
; GFX1250-NEXT: s_wait_samplecnt 0x0
1718+
; GFX1250-NEXT: s_wait_loadcnt 0x0
1719+
; GFX1250-NEXT: s_wait_storecnt 0x0
1720+
; GFX1250-NEXT: global_inv scope:SCOPE_SYS
1721+
; GFX1250-NEXT: s_endpgm
15971722
entry:
15981723
fence acq_rel, !mmra !{!"amdgpu-synchronize-as", !"global"}
15991724
ret void
@@ -1698,6 +1823,16 @@ define amdgpu_kernel void @system_seq_cst_fence() {
16981823
; GFX12-CU-NEXT: s_wait_storecnt 0x0
16991824
; GFX12-CU-NEXT: global_inv scope:SCOPE_SYS
17001825
; GFX12-CU-NEXT: s_endpgm
1826+
;
1827+
; GFX1250-LABEL: system_seq_cst_fence:
1828+
; GFX1250: ; %bb.0: ; %entry
1829+
; GFX1250-NEXT: global_wb scope:SCOPE_SYS
1830+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
1831+
; GFX1250-NEXT: s_wait_samplecnt 0x0
1832+
; GFX1250-NEXT: s_wait_loadcnt 0x0
1833+
; GFX1250-NEXT: s_wait_storecnt 0x0
1834+
; GFX1250-NEXT: global_inv scope:SCOPE_SYS
1835+
; GFX1250-NEXT: s_endpgm
17011836
entry:
17021837
fence seq_cst, !mmra !{!"amdgpu-synchronize-as", !"global"}
17031838
ret void
@@ -1792,6 +1927,13 @@ define amdgpu_kernel void @system_one_as_acquire_fence() {
17921927
; GFX12-CU-NEXT: s_wait_storecnt 0x0
17931928
; GFX12-CU-NEXT: global_inv scope:SCOPE_SYS
17941929
; GFX12-CU-NEXT: s_endpgm
1930+
;
1931+
; GFX1250-LABEL: system_one_as_acquire_fence:
1932+
; GFX1250: ; %bb.0: ; %entry
1933+
; GFX1250-NEXT: s_wait_loadcnt 0x0
1934+
; GFX1250-NEXT: s_wait_storecnt 0x0
1935+
; GFX1250-NEXT: global_inv scope:SCOPE_SYS
1936+
; GFX1250-NEXT: s_endpgm
17951937
entry:
17961938
fence syncscope("one-as") acquire, !mmra !{!"amdgpu-synchronize-as", !"global"}
17971939
ret void
@@ -1878,6 +2020,15 @@ define amdgpu_kernel void @system_one_as_release_fence() {
18782020
; GFX12-CU-NEXT: s_wait_loadcnt 0x0
18792021
; GFX12-CU-NEXT: s_wait_storecnt 0x0
18802022
; GFX12-CU-NEXT: s_endpgm
2023+
;
2024+
; GFX1250-LABEL: system_one_as_release_fence:
2025+
; GFX1250: ; %bb.0: ; %entry
2026+
; GFX1250-NEXT: global_wb scope:SCOPE_SYS
2027+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
2028+
; GFX1250-NEXT: s_wait_samplecnt 0x0
2029+
; GFX1250-NEXT: s_wait_loadcnt 0x0
2030+
; GFX1250-NEXT: s_wait_storecnt 0x0
2031+
; GFX1250-NEXT: s_endpgm
18812032
entry:
18822033
fence syncscope("one-as") release, !mmra !{!"amdgpu-synchronize-as", !"global"}
18832034
ret void
@@ -1982,6 +2133,16 @@ define amdgpu_kernel void @system_one_as_acq_rel_fence() {
19822133
; GFX12-CU-NEXT: s_wait_storecnt 0x0
19832134
; GFX12-CU-NEXT: global_inv scope:SCOPE_SYS
19842135
; GFX12-CU-NEXT: s_endpgm
2136+
;
2137+
; GFX1250-LABEL: system_one_as_acq_rel_fence:
2138+
; GFX1250: ; %bb.0: ; %entry
2139+
; GFX1250-NEXT: global_wb scope:SCOPE_SYS
2140+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
2141+
; GFX1250-NEXT: s_wait_samplecnt 0x0
2142+
; GFX1250-NEXT: s_wait_loadcnt 0x0
2143+
; GFX1250-NEXT: s_wait_storecnt 0x0
2144+
; GFX1250-NEXT: global_inv scope:SCOPE_SYS
2145+
; GFX1250-NEXT: s_endpgm
19852146
entry:
19862147
fence syncscope("one-as") acq_rel, !mmra !{!"amdgpu-synchronize-as", !"global"}
19872148
ret void
@@ -2086,6 +2247,16 @@ define amdgpu_kernel void @system_one_as_seq_cst_fence() {
20862247
; GFX12-CU-NEXT: s_wait_storecnt 0x0
20872248
; GFX12-CU-NEXT: global_inv scope:SCOPE_SYS
20882249
; GFX12-CU-NEXT: s_endpgm
2250+
;
2251+
; GFX1250-LABEL: system_one_as_seq_cst_fence:
2252+
; GFX1250: ; %bb.0: ; %entry
2253+
; GFX1250-NEXT: global_wb scope:SCOPE_SYS
2254+
; GFX1250-NEXT: s_wait_bvhcnt 0x0
2255+
; GFX1250-NEXT: s_wait_samplecnt 0x0
2256+
; GFX1250-NEXT: s_wait_loadcnt 0x0
2257+
; GFX1250-NEXT: s_wait_storecnt 0x0
2258+
; GFX1250-NEXT: global_inv scope:SCOPE_SYS
2259+
; GFX1250-NEXT: s_endpgm
20892260
entry:
20902261
fence syncscope("one-as") seq_cst, !mmra !{!"amdgpu-synchronize-as", !"global"}
20912262
ret void

0 commit comments

Comments
 (0)