Skip to content

Commit 85e8efa

Browse files
committed
[AMDGPU] si-peephole-sdwa: Fix cndmask vcc use for wave32
1 parent d32f060 commit 85e8efa

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,7 @@ void SIPeepholeSDWA::convertVcndmaskToVOP2(MachineInstr &MI,
11051105
.add(*TII->getNamedOperand(MI, AMDGPU::OpName::src0))
11061106
.add(*TII->getNamedOperand(MI, AMDGPU::OpName::src1))
11071107
.setMIFlags(MI.getFlags());
1108+
TII->fixImplicitOperands(*Converted);
11081109
LLVM_DEBUG(dbgs() << "Converted to VOP2: " << *Converted);
11091110
(void)Converted;
11101111
MI.eraseFromParent();

llvm/test/CodeGen/AMDGPU/sdwa-peephole-cndmask-fail.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
; RUN: llc %s -march=amdgcn -mcpu=gfx1030 -o - 2>&1 | FileCheck %s
2-
; XFAIL: *
32

4-
; V_CNDMASK_B32_e64 gets converted to V_CNDMASK_B32_e32, but the
5-
; expected conversion to SDWA does not occur. FIXME This leads to a
3+
; In this test, V_CNDMASK_B32_e64 gets converted to V_CNDMASK_B32_e32,
4+
; but the expected conversion to SDWA does not occur. This led to a
65
; compilation error, because the use of $vcc in the resulting
7-
; instruction must be fixed to $vcc_lo for wave32. This only happens
6+
; instruction must be fixed to $vcc_lo for wave32 which only happened
87
; after the full conversion to SDWA.
98

109

1110
; CHECK-NOT: {{.*}}V_CNDMASK_B32_e32{{.*}}$vcc
1211
; CHECK-NOT: {{.*}}Bad machine code: Virtual register defs don't dominate all uses
12+
; CHECK: {{.*}}v_cndmask_b32_e32{{.*}}vcc_lo
1313

1414
; ModuleID = 'test.ll'
1515
source_filename = "test.ll"

0 commit comments

Comments
 (0)