diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2010-01-13 19:16:39 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2010-01-13 19:16:39 +0000 |
| commit | af0ad65ff2e95283394a24cdd21cf934e92d52ec (patch) | |
| tree | 7f7c84007fedae5f8b6a4f4778c48c0c5513ad35 /llvm/lib | |
| parent | a9365352cfbb13b82b80c4b0fb76d2892db73925 (diff) | |
| download | bcm5719-llvm-af0ad65ff2e95283394a24cdd21cf934e92d52ec.tar.gz bcm5719-llvm-af0ad65ff2e95283394a24cdd21cf934e92d52ec.zip | |
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')
| -rw-r--r-- | llvm/lib/CodeGen/OptimizeExts.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/OptimizeExts.cpp b/llvm/lib/CodeGen/OptimizeExts.cpp index 844eb232f66..625ff89f90e 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 |

