- /// analyzeLoopPeripheralUse - Return an enum describing how CurLI is used in
- /// and around the Loop.
- LoopPeripheralUse analyzeLoopPeripheralUse(const LoopBlocks&);
-
- /// getCriticalExits - It may be necessary to partially break critical edges
- /// leaving the loop if an exit block has phi uses of CurLI. Collect the exit
- /// blocks that need special treatment into CriticalExits.
- void getCriticalExits(const LoopBlocks &Blocks, BlockPtrSet &CriticalExits);
-
- /// canSplitCriticalExits - Return true if it is possible to insert new exit
- /// blocks before the blocks in CriticalExits.
- bool canSplitCriticalExits(const LoopBlocks &Blocks,
- BlockPtrSet &CriticalExits);
-
- /// getCriticalPreds - Get the set of loop predecessors with critical edges to
- /// blocks outside the loop that have CurLI live in. We don't have to break
- /// these edges, but they do require special treatment.
- void getCriticalPreds(const LoopBlocks &Blocks, BlockPtrSet &CriticalPreds);
-
- /// getSplitLoops - Get the set of loops that have CurLI uses and would be
- /// profitable to split.
- void getSplitLoops(LoopPtrSet&);
-
- /// getBestSplitLoop - Return the loop where CurLI may best be split to a
- /// separate register, or NULL.
- const MachineLoop *getBestSplitLoop();
-
- /// isBypassLoop - Return true if CurLI is live through Loop and has no uses
- /// inside the loop. Bypass loops are candidates for splitting because it can
- /// prevent interference inside the loop.
- bool isBypassLoop(const MachineLoop *Loop);
-
- /// getBypassLoops - Get all the maximal bypass loops. These are the bypass
- /// loops whose parent is not a bypass loop.
- void getBypassLoops(LoopPtrSet&);
-
- /// getMultiUseBlocks - Add basic blocks to Blocks that may benefit from
- /// having CurLI split to a new live interval. Return true if Blocks can be
- /// passed to SplitEditor::splitSingleBlocks.
- bool getMultiUseBlocks(BlockPtrSet &Blocks);
-
- /// getBlockForInsideSplit - If CurLI is contained inside a single basic
- /// block, and it would pay to subdivide the interval inside that block,
- /// return it. Otherwise return NULL. The returned block can be passed to
- /// SplitEditor::splitInsideBlock.
- const MachineBasicBlock *getBlockForInsideSplit();
-};
-
-
-/// LiveIntervalMap - Map values from a large LiveInterval into a small
-/// interval that is a subset. Insert phi-def values as needed. This class is
-/// used by SplitEditor to create new smaller LiveIntervals.
-///
-/// ParentLI is the larger interval, LI is the subset interval. Every value
-/// in LI corresponds to exactly one value in ParentLI, and the live range
-/// of the value is contained within the live range of the ParentLI value.
-/// Values in ParentLI may map to any number of OpenLI values, including 0.
-class LiveIntervalMap {
- LiveIntervals &LIS;
- MachineDominatorTree &MDT;
-
- // The parent interval is never changed.
- const LiveInterval &ParentLI;