Skip to content

Commit 0bc33f4

Browse files
[AMDGPU] Update tests for last-use in global/scratch/flat/buffer load… (#94975)
… instructions
1 parent 690480f commit 0bc33f4

4 files changed

+43
-15
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
;RUN: llc < %s -global-isel=0 -mtriple=amdgcn -mcpu=gfx1200 -amdgpu-enable-delay-alu=0 | FileCheck %s --check-prefix=GCN
3+
;RUN: llc < %s -global-isel=1 -mtriple=amdgcn -mcpu=gfx1200 -amdgpu-enable-delay-alu=0 | FileCheck %s --check-prefix=GCN
4+
5+
define float @raw_buffer_load(<4 x i32> inreg) {
6+
; GCN-LABEL: raw_buffer_load:
7+
; GCN: ; %bb.0: ; %main_body
8+
; GCN-NEXT: s_wait_loadcnt_dscnt 0x0
9+
; GCN-NEXT: s_wait_expcnt 0x0
10+
; GCN-NEXT: s_wait_samplecnt 0x0
11+
; GCN-NEXT: s_wait_bvhcnt 0x0
12+
; GCN-NEXT: s_wait_kmcnt 0x0
13+
; GCN-NEXT: buffer_load_b32 v0, off, s[0:3], null th:TH_LOAD_LU
14+
; GCN-NEXT: s_wait_loadcnt 0x0
15+
; GCN-NEXT: s_setpc_b64 s[30:31]
16+
main_body:
17+
%data = call float @llvm.amdgcn.raw.buffer.load.f32(<4 x i32> %0, i32 0, i32 0, i32 3)
18+
ret float %data
19+
}
20+
21+
define float @struct_buffer_load(<4 x i32> inreg) {
22+
; GCN-LABEL: struct_buffer_load:
23+
; GCN: ; %bb.0: ; %main_body
24+
; GCN-NEXT: s_wait_loadcnt_dscnt 0x0
25+
; GCN-NEXT: s_wait_expcnt 0x0
26+
; GCN-NEXT: s_wait_samplecnt 0x0
27+
; GCN-NEXT: s_wait_bvhcnt 0x0
28+
; GCN-NEXT: s_wait_kmcnt 0x0
29+
; GCN-NEXT: v_mov_b32_e32 v0, 0
30+
; GCN-NEXT: buffer_load_b32 v0, v0, s[0:3], null idxen th:TH_LOAD_LU
31+
; GCN-NEXT: s_wait_loadcnt 0x0
32+
; GCN-NEXT: s_setpc_b64 s[30:31]
33+
main_body:
34+
%data = call float @llvm.amdgcn.struct.buffer.load.f32(<4 x i32> %0, i32 0, i32 0, i32 0, i32 3)
35+
ret float %data
36+
}
37+

llvm/test/CodeGen/AMDGPU/memory-legalizer-flat-lastuse.ll

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 < %s | FileCheck --check-prefixes=GFX12,GFX12-WGP %s
3-
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 -mattr=+cumode < %s | FileCheck --check-prefixes=GFX12,GFX12-CU %s
2+
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 < %s | FileCheck --check-prefix=GFX12 %s
3+
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 -mattr=+cumode < %s | FileCheck --check-prefix=GFX12 %s
44

55
define amdgpu_kernel void @flat_last_use_load_0(ptr %in, ptr %out) {
66
; GFX12-LABEL: flat_last_use_load_0:
@@ -107,6 +107,3 @@ entry:
107107

108108
!0 = !{i32 1}
109109
declare i32 @llvm.amdgcn.workitem.id.x()
110-
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
111-
; GFX12-CU: {{.*}}
112-
; GFX12-WGP: {{.*}}

llvm/test/CodeGen/AMDGPU/memory-legalizer-global-lastuse.ll

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 < %s | FileCheck --check-prefixes=GFX12,GFX12-WGP %s
3-
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 -mattr=+cumode < %s | FileCheck --check-prefixes=GFX12,GFX12-CU %s
2+
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 < %s | FileCheck --check-prefix=GFX12 %s
3+
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 -mattr=+cumode < %s | FileCheck --check-prefix=GFX12 %s
44

55
define amdgpu_kernel void @global_last_use_load_0(ptr addrspace(1) %in, ptr addrspace(1) %out) {
66
; GFX12-LABEL: global_last_use_load_0:
@@ -92,6 +92,3 @@ entry:
9292
}
9393
!0 = !{i32 1}
9494
declare i32 @llvm.amdgcn.workitem.id.x()
95-
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
96-
; GFX12-CU: {{.*}}
97-
; GFX12-WGP: {{.*}}

llvm/test/CodeGen/AMDGPU/memory-legalizer-private-lastuse.ll

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 < %s | FileCheck --check-prefixes=GFX12,GFX12-WGP %s
3-
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 -mattr=+cumode < %s | FileCheck --check-prefixes=GFX12,GFX12-CU %s
2+
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 < %s | FileCheck --check-prefix=GFX12 %s
3+
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O0 -mcpu=gfx1200 -mattr=+cumode < %s | FileCheck --check-prefix=GFX12 %s
44

55
define amdgpu_kernel void @private_last_use_load_0(ptr addrspace(5) %in, ptr addrspace(1) %out) {
66
; GFX12-LABEL: private_last_use_load_0:
@@ -85,6 +85,3 @@ entry:
8585

8686
!0 = !{i32 1}
8787
declare i32 @llvm.amdgcn.workitem.id.x()
88-
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
89-
; GFX12-CU: {{.*}}
90-
; GFX12-WGP: {{.*}}

0 commit comments

Comments
 (0)