Skip to content
4 changes: 4 additions & 0 deletions llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,10 @@ bool SIFoldOperandsImpl::updateOperand(FoldCandidate &Fold) const {
if (!TII->isOperandLegal(*MI, OpNo, &New))
return false;

const MCInstrDesc &MCID = MI->getDesc();
if (MCID.getOperandConstraint(OpNo, MCOI::EARLY_CLOBBER) != -1) {
MI->getOperand(OpNo).setIsEarlyClobber(true);
}
Old.ChangeToImmediate(*ImmVal);
return true;
}
Expand Down
Loading