mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
Delete dead PHI machine instructions. These can be created due to type
legalization even when the IR-level optimizer has removed dead phis, such as when the high half of an i64 value is unused on a 32-bit target. I had to adjust a few test cases that had dead phis. This is a partial fix for Radar 7627077. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95816 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -55,7 +55,7 @@ FunctionPass *llvm::createDeadMachineInstructionElimPass() {
|
||||
bool DeadMachineInstructionElim::isDead(const MachineInstr *MI) const {
|
||||
// Don't delete instructions with side effects.
|
||||
bool SawStore = false;
|
||||
if (!MI->isSafeToMove(TII, SawStore, 0))
|
||||
if (!MI->isSafeToMove(TII, SawStore, 0) && !MI->isPHI())
|
||||
return false;
|
||||
|
||||
// Examine each operand.
|
||||
|
||||
Reference in New Issue
Block a user