Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions llvm/lib/CodeGen/MachineInstr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1353,18 +1353,6 @@ bool MachineInstr::wouldBeTriviallyDead() const {

bool MachineInstr::isDead(const MachineRegisterInfo &MRI,
LiveRegUnits *LivePhysRegs) const {
// Technically speaking inline asm without side effects and no defs can still
// be deleted. But there is so much bad inline asm code out there, we should
// let them be.
if (isInlineAsm())
return false;

// If we suspect this instruction may have some side-effects, then we say
// this instruction cannot be dead.
// FIXME: See issue #105950 for why LIFETIME markers are considered dead here.
if (!isLifetimeMarker() && !wouldBeTriviallyDead())
return false;

// Instructions without side-effects are dead iff they only define dead regs.
// This function is hot and this loop returns early in the common case,
// so only perform additional checks before this if absolutely necessary.
Expand All @@ -1385,7 +1373,19 @@ bool MachineInstr::isDead(const MachineRegisterInfo &MRI,
}
}

return true;
// Technically speaking inline asm without side effects and no defs can still
// be deleted. But there is so much bad inline asm code out there, we should
// let them be.
if (isInlineAsm())
return false;

// FIXME: See issue #105950 for why LIFETIME markers are considered dead here.
if (isLifetimeMarker())
return true;

// If there are no defs with uses, then we call the instruction dead so long
// as we do not suspect it may have sideeffects.
return wouldBeTriviallyDead();
}

static bool MemOperandsHaveAlias(const MachineFrameInfo &MFI,
Expand Down
Loading