Skip to content

Commit 7565159

Browse files
rampitecarsenm
authored andcommitted
AMDGPU: Fix mfma scale source legalization
Code inside assert changes the variable instead of the comparison.
1 parent b62557a commit 7565159

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15462,9 +15462,8 @@ void SITargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI,
1546215462
int Src0Idx = AMDGPU::getNamedOperandIdx(MI.getOpcode(),
1546315463
AMDGPU::OpName::scale_src0);
1546415464
if (Src0Idx != -1) {
15465-
int Src1Idx = Src0Idx + 2;
15466-
assert(Src1Idx = AMDGPU::getNamedOperandIdx(
15467-
MI.getOpcode(), AMDGPU::OpName::scale_src1));
15465+
int Src1Idx = AMDGPU::getNamedOperandIdx(MI.getOpcode(),
15466+
AMDGPU::OpName::scale_src1);
1546815467
if (TII->usesConstantBus(MRI, MI, Src0Idx) &&
1546915468
TII->usesConstantBus(MRI, MI, Src1Idx))
1547015469
TII->legalizeOpWithMove(MI, Src1Idx);

0 commit comments

Comments
 (0)