Skip to content

Commit 5ce9af2

Browse files
committed
review comment resolved
removed change in MachineVerifier
1 parent 5ea05e5 commit 5ce9af2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/lib/CodeGen/MachineVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2589,7 +2589,7 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
25892589
if (!MO->isReg())
25902590
report("Early clobber must be a register", MO, MONum);
25912591
if (!MO->isEarlyClobber())
2592-
report("Missing earlyClobber flag", MO, MONum);
2592+
report("Missing earlyClobber flag", MI);
25932593
}
25942594

25952595
switch (MO->getType()) {

llvm/lib/Target/AMDGPU/SIFoldOperands.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,10 @@ bool SIFoldOperandsImpl::updateOperand(FoldCandidate &Fold) const {
681681
return false;
682682
MI->setDesc(TII->get(NewMFMAOpc));
683683
MI->untieRegOperand(0);
684+
const MCInstrDesc &MCID = MI->getDesc();
685+
for (unsigned I = 0; I < MI->getNumDefs(); ++I)
686+
if (MCID.getOperandConstraint(I, MCOI::EARLY_CLOBBER) != -1)
687+
MI->getOperand(I).setIsEarlyClobber(true);
684688
}
685689

686690
// TODO: Should we try to avoid adding this to the candidate list?
@@ -689,10 +693,6 @@ bool SIFoldOperandsImpl::updateOperand(FoldCandidate &Fold) const {
689693
if (!TII->isOperandLegal(*MI, OpNo, &New))
690694
return false;
691695

692-
const MCInstrDesc &MCID = MI->getDesc();
693-
for (unsigned I = 0; I < MI->getNumDefs(); ++I)
694-
if (MCID.getOperandConstraint(I, MCOI::EARLY_CLOBBER) != -1)
695-
MI->getOperand(I).setIsEarlyClobber(true);
696696
Old.ChangeToImmediate(*ImmVal);
697697
return true;
698698
}

0 commit comments

Comments
 (0)