Skip to content

[AMDGPU] Remove s_set_inst_prefetch_distance support from GFX12 #78786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions llvm/lib/Target/AMDGPU/GCNSubtarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,6 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
}

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

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/SOPInstructions.td
Original file line number Diff line number Diff line change
Expand Up @@ -2618,7 +2618,7 @@ multiclass SOPP_Real_With_Relaxation_gfx11_gfx12<bits<7>op> :
defm S_SETKILL : SOPP_Real_32_gfx11_gfx12<0x001>;
defm S_SETHALT : SOPP_Real_32_gfx11_gfx12<0x002>;
defm S_SLEEP : SOPP_Real_32_gfx11_gfx12<0x003>;
defm S_SET_INST_PREFETCH_DISTANCE : SOPP_Real_32_Renamed_gfx11_gfx12<0x004, S_INST_PREFETCH, "s_set_inst_prefetch_distance">;
defm S_SET_INST_PREFETCH_DISTANCE : SOPP_Real_32_Renamed_gfx11<0x004, S_INST_PREFETCH, "s_set_inst_prefetch_distance">;
defm S_CLAUSE : SOPP_Real_32_gfx11_gfx12<0x005>;
defm S_DELAY_ALU : SOPP_Real_32_gfx11_gfx12<0x007>;
defm S_WAITCNT_DEPCTR : SOPP_Real_32_gfx11<0x008>;
Expand Down
9 changes: 0 additions & 9 deletions llvm/test/MC/AMDGPU/gfx12_asm_sopp.s
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ s_wait_alu depctr_va_sdst(3)
s_wait_alu depctr_va_vdst(14) depctr_va_sdst(6) depctr_vm_vsrc(6)
// GFX12: encoding: [0x9b,0xed,0x88,0xbf]

s_inst_prefetch 0x1234
// GFX12: s_set_inst_prefetch_distance 0x1234 ; encoding: [0x34,0x12,0x84,0xbf]

s_set_inst_prefetch_distance 0x1234
// GFX12: s_set_inst_prefetch_distance 0x1234 ; encoding: [0x34,0x12,0x84,0xbf]

s_set_inst_prefetch_distance 0xc1d1
// GFX12: s_set_inst_prefetch_distance 0xc1d1 ; encoding: [0xd1,0xc1,0x84,0xbf]

s_singleuse_vdst 0x0000
// GFX12: encoding: [0x00,0x00,0x93,0xbf]

Expand Down
3 changes: 3 additions & 0 deletions llvm/test/MC/AMDGPU/gfx12_unsupported.s
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ s_cmpk_lt_u32 s0, 0
s_cmpk_le_u32 s0, 0
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU

s_inst_prefetch 1
// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU

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

Expand Down
9 changes: 0 additions & 9 deletions llvm/test/MC/Disassembler/AMDGPU/gfx12_dasm_sopp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,6 @@
# GFX12: s_sethalt 0xc1d1 ; encoding: [0xd1,0xc1,0x82,0xbf]
0xd1,0xc1,0x82,0xbf

# GFX12: s_set_inst_prefetch_distance 0x0 ; encoding: [0x00,0x00,0x84,0xbf]
0x00,0x00,0x84,0xbf

# GFX12: s_set_inst_prefetch_distance 0x1234 ; encoding: [0x34,0x12,0x84,0xbf]
0x34,0x12,0x84,0xbf

# GFX12: s_set_inst_prefetch_distance 0xc1d1 ; encoding: [0xd1,0xc1,0x84,0xbf]
0xd1,0xc1,0x84,0xbf

# GFX12: s_setkill 0 ; encoding: [0x00,0x00,0x81,0xbf]
0x00,0x00,0x81,0xbf

Expand Down