Skip to content

Commit c37f1d1

Browse files
committed
[AMDGPU][MachineVerifier] test failures in SIFoldOperands
After PR:llvm#151421 merged following fails in SIFoldOperands showed up. LLVM :: CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.mfma.gfx90a.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.mfma.gfx90a.ll LLVM :: CodeGen/AMDGPU/llvm.amdgcn.mfma.ll LLVM :: CodeGen/AMDGPU/mfma-loop.ll LLVM :: CodeGen/AMDGPU/rewrite-vgpr-mfma-to-agpr.ll In Folding code, if folded operand is register ensure earlyClobber is set.
1 parent cb41408 commit c37f1d1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Target/AMDGPU/SIFoldOperands.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,10 @@ bool SIFoldOperandsImpl::updateOperand(FoldCandidate &Fold) const {
689689
if (!TII->isOperandLegal(*MI, OpNo, &New))
690690
return false;
691691

692+
const MCInstrDesc &MCID = MI->getDesc();
693+
if (MCID.getOperandConstraint(OpNo, MCOI::EARLY_CLOBBER) != -1) {
694+
MI->getOperand(OpNo).setIsEarlyClobber(true);
695+
}
692696
Old.ChangeToImmediate(*ImmVal);
693697
return true;
694698
}

0 commit comments

Comments
 (0)