summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-02-10 22:58:57 +0000
committerBob Wilson <bob.wilson@apple.com>2010-02-10 22:58:57 +0000
commit0f52d0c074eadab209ff9a39c07ead783c45e031 (patch)
treeb295236f2869398d11136c96434082df050e8efe /llvm/lib/CodeGen/DeadMachineInstructionElim.cpp
parent8bba1608bd3a0febc658eec09e1aa50cc64f1c1a (diff)
downloadbcm5719-llvm-0f52d0c074eadab209ff9a39c07ead783c45e031.tar.gz
bcm5719-llvm-0f52d0c074eadab209ff9a39c07ead783c45e031.zip
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. llvm-svn: 95816
Diffstat (limited to 'llvm/lib/CodeGen/DeadMachineInstructionElim.cpp')
-rw-r--r--llvm/lib/CodeGen/DeadMachineInstructionElim.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp b/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp
index b0cb24d95f7..6e01e59349e 100644
--- a/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp
+++ b/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp
@@ -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.
OpenPOWER on IntegriCloud