@@ -1353,18 +1353,6 @@ bool MachineInstr::wouldBeTriviallyDead() const {
1353
1353
1354
1354
bool MachineInstr::isDead (const MachineRegisterInfo &MRI,
1355
1355
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
-
1368
1356
// Instructions without side-effects are dead iff they only define dead regs.
1369
1357
// This function is hot and this loop returns early in the common case,
1370
1358
// so only perform additional checks before this if absolutely necessary.
@@ -1385,7 +1373,19 @@ bool MachineInstr::isDead(const MachineRegisterInfo &MRI,
1385
1373
}
1386
1374
}
1387
1375
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 ();
1389
1389
}
1390
1390
1391
1391
static bool MemOperandsHaveAlias (const MachineFrameInfo &MFI,
0 commit comments