Skip to content

Commit d41dde7

Browse files
authored
LiveRangeEdit: Replace setIsDead with an assert (#92964)
I noticed this was possibly buggy with implicit operands with the same dest register, and should maybe be using addRegisterDead. However, this is never called in a situation where the operand wasn't already marked dead. This is eliminateDeadDef, implying the def was already known to be dead. Add an assert to detect inconsistencies in dead flags. This was apparently added in 9a16d65.
1 parent a70ecfb commit d41dde7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/LiveRangeEdit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink) {
414414
DeadRemats->insert(MI);
415415
const TargetRegisterInfo &TRI = *MRI.getTargetRegisterInfo();
416416
MI->substituteRegister(Dest, NewLI.reg(), 0, TRI);
417-
MI->getOperand(0).setIsDead(true);
417+
assert(MI->registerDefIsDead(NewLI.reg(), &TRI));
418418
} else {
419419
if (TheDelegate)
420420
TheDelegate->LRE_WillEraseInstruction(MI);

0 commit comments

Comments
 (0)