summaryrefslogtreecommitdiff
path: root/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
commit5e2b05a71e81b28712b77419f68657462494e103 (patch)
tree8029ae1969d5fb607781fba7e98b005022475af7 /lib/CodeGen/DeadMachineInstructionElim.cpp
parentb8ff934e94637462901ebd1c849aeaf71350dacc (diff)
downloadllvm-5e2b05a71e81b28712b77419f68657462494e103.tar.gz
llvm-5e2b05a71e81b28712b77419f68657462494e103.tar.bz2
llvm-5e2b05a71e81b28712b77419f68657462494e103.tar.xz
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
Diffstat (limited to 'lib/CodeGen/DeadMachineInstructionElim.cpp')
-rw-r--r--lib/CodeGen/DeadMachineInstructionElim.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/DeadMachineInstructionElim.cpp b/lib/CodeGen/DeadMachineInstructionElim.cpp
index b0cb24d95f..6e01e59349 100644
--- a/lib/CodeGen/DeadMachineInstructionElim.cpp
+++ b/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.