Skip to content

Commit 1000cef

Browse files
authored
[AMDGPU] Remove s_set_inst_prefetch_distance support from GFX12 (#78786)
This instruction is not supported by GFX12.
1 parent 672fb58 commit 1000cef

File tree

5 files changed

+4
-21
lines changed

5 files changed

+4
-21
lines changed

llvm/lib/Target/AMDGPU/GCNSubtarget.h

-2
Original file line numberDiff line numberDiff line change
@@ -856,8 +856,6 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
856856
}
857857

858858
bool hasInstPrefetch() const {
859-
// GFX12 can still encode the s_set_inst_prefetch_distance instruction but
860-
// it has no effect.
861859
return getGeneration() == GFX10 || getGeneration() == GFX11;
862860
}
863861

llvm/lib/Target/AMDGPU/SOPInstructions.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -2625,7 +2625,7 @@ multiclass SOPP_Real_With_Relaxation_gfx11_gfx12<bits<7>op> :
26252625
defm S_SETKILL : SOPP_Real_32_gfx11_gfx12<0x001>;
26262626
defm S_SETHALT : SOPP_Real_32_gfx11_gfx12<0x002>;
26272627
defm S_SLEEP : SOPP_Real_32_gfx11_gfx12<0x003>;
2628-
defm S_SET_INST_PREFETCH_DISTANCE : SOPP_Real_32_Renamed_gfx11_gfx12<0x004, S_INST_PREFETCH, "s_set_inst_prefetch_distance">;
2628+
defm S_SET_INST_PREFETCH_DISTANCE : SOPP_Real_32_Renamed_gfx11<0x004, S_INST_PREFETCH, "s_set_inst_prefetch_distance">;
26292629
defm S_CLAUSE : SOPP_Real_32_gfx11_gfx12<0x005>;
26302630
defm S_DELAY_ALU : SOPP_Real_32_gfx11_gfx12<0x007>;
26312631
defm S_WAITCNT_DEPCTR : SOPP_Real_32_gfx11<0x008>;

llvm/test/MC/AMDGPU/gfx12_asm_sopp.s

-9
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,6 @@ s_wait_alu depctr_va_sdst(3)
6969
s_wait_alu depctr_va_vdst(14) depctr_va_sdst(6) depctr_vm_vsrc(6)
7070
// GFX12: encoding: [0x9b,0xed,0x88,0xbf]
7171

72-
s_inst_prefetch 0x1234
73-
// GFX12: s_set_inst_prefetch_distance 0x1234 ; encoding: [0x34,0x12,0x84,0xbf]
74-
75-
s_set_inst_prefetch_distance 0x1234
76-
// GFX12: s_set_inst_prefetch_distance 0x1234 ; encoding: [0x34,0x12,0x84,0xbf]
77-
78-
s_set_inst_prefetch_distance 0xc1d1
79-
// GFX12: s_set_inst_prefetch_distance 0xc1d1 ; encoding: [0xd1,0xc1,0x84,0xbf]
80-
8172
s_singleuse_vdst 0x0000
8273
// GFX12: encoding: [0x00,0x00,0x93,0xbf]
8374

llvm/test/MC/AMDGPU/gfx12_unsupported.s

+3
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ s_cmpk_lt_u32 s0, 0
103103
s_cmpk_le_u32 s0, 0
104104
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
105105

106+
s_inst_prefetch 1
107+
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
108+
106109
buffer_atomic_cmpswap_f32 v[5:6], off, s[96:99], s3
107110
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
108111

llvm/test/MC/Disassembler/AMDGPU/gfx12_dasm_sopp.txt

-9
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,6 @@
264264
# GFX12: s_sethalt 0xc1d1 ; encoding: [0xd1,0xc1,0x82,0xbf]
265265
0xd1,0xc1,0x82,0xbf
266266

267-
# GFX12: s_set_inst_prefetch_distance 0x0 ; encoding: [0x00,0x00,0x84,0xbf]
268-
0x00,0x00,0x84,0xbf
269-
270-
# GFX12: s_set_inst_prefetch_distance 0x1234 ; encoding: [0x34,0x12,0x84,0xbf]
271-
0x34,0x12,0x84,0xbf
272-
273-
# GFX12: s_set_inst_prefetch_distance 0xc1d1 ; encoding: [0xd1,0xc1,0x84,0xbf]
274-
0xd1,0xc1,0x84,0xbf
275-
276267
# GFX12: s_setkill 0 ; encoding: [0x00,0x00,0x81,0xbf]
277268
0x00,0x00,0x81,0xbf
278269

0 commit comments

Comments
 (0)