Skip to content

Commit e0a763c

Browse files
authored
[AMDGPU] Fix GFX12 encoding of s_wait_event export_ready (#89622)
As well as flipping the sense of the bit, GFX12 moved it from bit 0 to bit 1 in the encoded simm16 operand.
1 parent a9e3fbf commit e0a763c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

llvm/lib/Target/AMDGPU/SOPInstructions.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ def : GCNPat<
18031803
let SubtargetPredicate = isNotGFX12Plus in
18041804
def : GCNPat <(int_amdgcn_s_wait_event_export_ready), (S_WAIT_EVENT (i16 0))>;
18051805
let SubtargetPredicate = isGFX12Plus in
1806-
def : GCNPat <(int_amdgcn_s_wait_event_export_ready), (S_WAIT_EVENT (i16 1))>;
1806+
def : GCNPat <(int_amdgcn_s_wait_event_export_ready), (S_WAIT_EVENT (i16 2))>;
18071807

18081808
// The first 10 bits of the mode register are the core FP mode on all
18091809
// subtargets.

llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.wait.event.ll

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@
55

66
; GCN-LABEL: {{^}}test_wait_event:
77
; GFX11: s_wait_event 0x0
8-
; GFX12: s_wait_event 0x1
8+
; GFX12: s_wait_event 0x2
99

10-
define amdgpu_ps void @test_wait_event() #0 {
10+
define amdgpu_ps void @test_wait_event() {
1111
entry:
12-
call void @llvm.amdgcn.s.wait.event.export.ready() #0
12+
call void @llvm.amdgcn.s.wait.event.export.ready()
1313
ret void
1414
}
15-
16-
declare void @llvm.amdgcn.s.wait.event.export.ready() #0
17-
18-
attributes #0 = { nounwind }

0 commit comments

Comments
 (0)