Skip to content

Commit bce9393

Browse files
jayfoadtstellar
authored andcommitted
[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. (cherry picked from commit e0a763c)
1 parent f5f572f commit bce9393

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
@@ -1786,7 +1786,7 @@ def : GCNPat<
17861786
let SubtargetPredicate = isNotGFX12Plus in
17871787
def : GCNPat <(int_amdgcn_s_wait_event_export_ready), (S_WAIT_EVENT (i16 0))>;
17881788
let SubtargetPredicate = isGFX12Plus in
1789-
def : GCNPat <(int_amdgcn_s_wait_event_export_ready), (S_WAIT_EVENT (i16 1))>;
1789+
def : GCNPat <(int_amdgcn_s_wait_event_export_ready), (S_WAIT_EVENT (i16 2))>;
17901790

17911791
// The first 10 bits of the mode register are the core FP mode on all
17921792
// 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)