Skip to content

Commit d306cad

Browse files
committed
Extend machine verifier to check for multiple defs.
1 parent f70f3ba commit d306cad

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

llvm/lib/CodeGen/MachineVerifier.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,12 +2326,14 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) {
23262326
}
23272327

23282328
// Verify earlyClobber def operand
2329-
if (MCID.getOperandConstraint(0, MCOI::EARLY_CLOBBER) != -1) {
2330-
if (!MI->getOperand(0).isReg())
2331-
report("Early clobber must be a register", MI);
2332-
if (!MI->getOperand(0).isEarlyClobber())
2333-
report("Missing earlyClobber flag", MI);
2334-
}
2329+
for (unsigned i = 0; i < MI->getNumOperands(); i++)
2330+
if (MCID.getOperandConstraint(i, MCOI::EARLY_CLOBBER) != -1) {
2331+
const MachineOperand &Op = MI->getOperand(i);
2332+
if (!Op.isReg())
2333+
report("Early clobber must be a register", MI);
2334+
if (!Op.isEarlyClobber())
2335+
report("Missing earlyClobber flag", MI);
2336+
}
23352337
// Debug values must not have a slot index.
23362338
// Other instructions must have one, unless they are inside a bundle.
23372339
if (LiveInts) {

0 commit comments

Comments
 (0)