Skip to content

Commit bd8a953

Browse files
arsenmrampitec
andauthored
AMDGPU: Fix mfma scale source legalization (llvm#117238)
Code inside assert changes the variable instead of the comparison. Co-authored-by: Stanislav Mekhanoshin <[email protected]>
1 parent 3709c2d commit bd8a953

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)