aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/OptimizeExts.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-01-13 19:16:39 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-01-13 19:16:39 +0000
commitaf0ad65ff2e95283394a24cdd21cf934e92d52ec (patch)
tree7f7c84007fedae5f8b6a4f4778c48c0c5513ad35 /llvm/lib/CodeGen/OptimizeExts.cpp
parenta9365352cfbb13b82b80c4b0fb76d2892db73925 (diff)
downloadllvm-af0ad65ff2e95283394a24cdd21cf934e92d52ec.zip
llvm-af0ad65ff2e95283394a24cdd21cf934e92d52ec.tar.gz
llvm-af0ad65ff2e95283394a24cdd21cf934e92d52ec.tar.bz2
Commit some changes I had managed to lose last night while refactoring the code. Avoid change use of PHI instructions because it's not legal to insert any instructions before them.
This fixes PR6027. llvm-svn: 93335
Diffstat (limited to 'llvm/lib/CodeGen/OptimizeExts.cpp')
-rw-r--r--llvm/lib/CodeGen/OptimizeExts.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/OptimizeExts.cpp b/llvm/lib/CodeGen/OptimizeExts.cpp
index 844eb23..625ff89 100644
--- a/llvm/lib/CodeGen/OptimizeExts.cpp
+++ b/llvm/lib/CodeGen/OptimizeExts.cpp
@@ -110,6 +110,11 @@ bool OptimizeExts::OptimizeInstr(MachineInstr *MI, MachineBasicBlock *MBB,
MachineInstr *UseMI = &*UI;
if (UseMI == MI)
continue;
+ if (UseMI->getOpcode() == TargetInstrInfo::PHI) {
+ ExtendLife = false;
+ continue;
+ }
+
MachineBasicBlock *UseMBB = UseMI->getParent();
if (UseMBB == MBB) {
// Local uses that come after the extension.
@@ -117,7 +122,7 @@ bool OptimizeExts::OptimizeInstr(MachineInstr *MI, MachineBasicBlock *MBB,
Uses.push_back(&UseMO);
} else if (ReachedBBs.count(UseMBB))
// Non-local uses where the result of extension is used. Always
- // replace these.
+ // replace these unless it's a PHI.
Uses.push_back(&UseMO);
else if (Aggressive && DT->dominates(MBB, UseMBB))
// We may want to extend live range of the extension result in order