@@ -1353,18 +1353,6 @@ bool MachineInstr::wouldBeTriviallyDead() const {
13531353
13541354bool MachineInstr::isDead (const MachineRegisterInfo &MRI,
13551355 LiveRegUnits *LivePhysRegs) const {
1356- // Technically speaking inline asm without side effects and no defs can still
1357- // be deleted. But there is so much bad inline asm code out there, we should
1358- // let them be.
1359- if (isInlineAsm ())
1360- return false ;
1361-
1362- // If we suspect this instruction may have some side-effects, then we say
1363- // this instruction cannot be dead.
1364- // FIXME: See issue #105950 for why LIFETIME markers are considered dead here.
1365- if (!isLifetimeMarker () && !wouldBeTriviallyDead ())
1366- return false ;
1367-
13681356 // Instructions without side-effects are dead iff they only define dead regs.
13691357 // This function is hot and this loop returns early in the common case,
13701358 // so only perform additional checks before this if absolutely necessary.
@@ -1385,7 +1373,19 @@ bool MachineInstr::isDead(const MachineRegisterInfo &MRI,
13851373 }
13861374 }
13871375
1388- return true ;
1376+ // Technically speaking inline asm without side effects and no defs can still
1377+ // be deleted. But there is so much bad inline asm code out there, we should
1378+ // let them be.
1379+ if (isInlineAsm ())
1380+ return false ;
1381+
1382+ // FIXME: See issue #105950 for why LIFETIME markers are considered dead here.
1383+ if (isLifetimeMarker ())
1384+ return true ;
1385+
1386+ // If there are no defs with uses, then we call the instruction dead so long
1387+ // as we do not suspect it may have sideeffects.
1388+ return wouldBeTriviallyDead ();
13891389}
13901390
13911391static bool MemOperandsHaveAlias (const MachineFrameInfo &MFI,
0 commit comments