diff options
author | Owen Anderson <resistor@mac.com> | 2008-12-07 05:33:18 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-12-07 05:33:18 +0000 |
commit | 75c99c5aa86409f09616bfa46e723a0bc18e7e54 (patch) | |
tree | ab7c65a962f1bff38e21ab73b5043d6865e03cc9 | |
parent | 6ecf5ce3e3c00fe02fd80f77075ce2097ea6a944 (diff) |
Switch to top-down mode and fix a crasher this exposed caused by an error in the
live interval updating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60652 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/PreAllocSplitting.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/CodeGen/PreAllocSplitting.cpp b/lib/CodeGen/PreAllocSplitting.cpp index 160144599c..fe1efe5c95 100644 --- a/lib/CodeGen/PreAllocSplitting.cpp +++ b/lib/CodeGen/PreAllocSplitting.cpp @@ -442,6 +442,9 @@ PreAllocSplitting::UpdateRegisterInterval(VNInfo *ValNo, unsigned SpillIndex, SE = MBB->succ_end(); SI != SE; ++SI) WorkList.push_back(*SI); + SmallPtrSet<MachineBasicBlock*, 4> ProcessedBlocks; + ProcessedBlocks.insert(MBB); + while (!WorkList.empty()) { MBB = WorkList.back(); WorkList.pop_back(); @@ -459,6 +462,13 @@ PreAllocSplitting::UpdateRegisterInterval(VNInfo *ValNo, unsigned SpillIndex, } Processed.insert(LR); } + + ProcessedBlocks.insert(MBB); + if (LR) + for (MachineBasicBlock::succ_iterator SI = MBB->succ_begin(), + SE = MBB->succ_end(); SI != SE; ++SI) + if (!ProcessedBlocks.count(*SI)) + WorkList.push_back(*SI); } for (LiveInterval::iterator I = CurrLI->begin(), E = CurrLI->end(); @@ -1039,7 +1049,7 @@ bool PreAllocSplitting::runOnMachineFunction(MachineFunction &MF) { // Make sure blocks are numbered in order. MF.RenumberBlocks(); -#if 0 +#if 1 // FIXME: Go top down. MachineBasicBlock *Entry = MF.begin(); SmallPtrSet<MachineBasicBlock*,16> Visited; |