mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93335 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user