Skip to content

Commit 6ebc179

Browse files
authored
[AMDGPU][MC][GFX11] Always output wait_vdst and wait_exp (#66610)
Always output values of wait_vdst and wait_exp in assembly even when they are zero. While we normally avoid outputing default/zero parameters in assembly, the values of these parameters still imply wait behaviour when zero. Outputing zero values makes the intent more obvious to human readers, and avoid any future ambiguity if we choose to change the defaults to something other than zero. Fixes #66383
1 parent 0984843 commit 6ebc179

File tree

5 files changed

+133
-139
lines changed

5 files changed

+133
-139
lines changed

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -532,21 +532,15 @@ void AMDGPUInstPrinter::printDefaultVccOperand(bool FirstOperand,
532532
void AMDGPUInstPrinter::printWaitVDST(const MCInst *MI, unsigned OpNo,
533533
const MCSubtargetInfo &STI,
534534
raw_ostream &O) {
535-
uint8_t Imm = MI->getOperand(OpNo).getImm();
536-
if (Imm != 0) {
537-
O << " wait_vdst:";
538-
printU4ImmDecOperand(MI, OpNo, O);
539-
}
535+
O << " wait_vdst:";
536+
printU4ImmDecOperand(MI, OpNo, O);
540537
}
541538

542539
void AMDGPUInstPrinter::printWaitEXP(const MCInst *MI, unsigned OpNo,
543540
const MCSubtargetInfo &STI,
544541
raw_ostream &O) {
545-
uint8_t Imm = MI->getOperand(OpNo).getImm();
546-
if (Imm != 0) {
547-
O << " wait_exp:";
548-
printU4ImmDecOperand(MI, OpNo, O);
549-
}
542+
O << " wait_exp:";
543+
printU4ImmDecOperand(MI, OpNo, O);
550544
}
551545

552546
bool AMDGPUInstPrinter::needsImpliedVcc(const MCInstrDesc &Desc,

llvm/test/MC/AMDGPU/gfx11_asm_ldsdir.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ lds_direct_load v15 wait_vdst:1
4646
// GFX11: lds_direct_load v15 wait_vdst:1 ; encoding: [0x0f,0x00,0x11,0xce]
4747

4848
lds_direct_load v16 wait_vdst:0
49-
// GFX11: lds_direct_load v16 ; encoding: [0x10,0x00,0x10,0xce]
49+
// GFX11: lds_direct_load v16 wait_vdst:0 ; encoding: [0x10,0x00,0x10,0xce]
5050

5151
lds_direct_load v17
52-
// GFX11: lds_direct_load v17 ; encoding: [0x11,0x00,0x10,0xce]
52+
// GFX11: lds_direct_load v17 wait_vdst:0 ; encoding: [0x11,0x00,0x10,0xce]
5353

5454
lds_param_load v1, attr0.x wait_vdst:15
5555
// GFX11: lds_param_load v1, attr0.x wait_vdst:15 ; encoding: [0x01,0x00,0x0f,0xce]

0 commit comments

Comments
 (0)