blob: 3616baa6cedeba6b373e25aed6db59fced1110e4 [file] [log] [blame]
Jakob Stoklund Olesen8dd070e2011-01-04 21:10:05 +00001//===-------- SplitKit.h - Toolkit for splitting live ranges ----*- C++ -*-===//
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file contains the SplitAnalysis class as well as mutator functions for
11// live range splitting.
12//
13//===----------------------------------------------------------------------===//
14
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000015#include "llvm/ADT/DenseMap.h"
Jakob Stoklund Olesen8d0963f2010-12-21 01:50:21 +000016#include "llvm/ADT/SmallPtrSet.h"
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +000017#include "llvm/CodeGen/SlotIndexes.h"
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000018
19namespace llvm {
20
21class LiveInterval;
22class LiveIntervals;
Jakob Stoklund Olesena17768f2010-10-14 23:49:52 +000023class LiveRangeEdit;
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000024class MachineInstr;
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000025class MachineLoop;
26class MachineLoopInfo;
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +000027class MachineRegisterInfo;
Jakob Stoklund Olesen6a0dc072010-07-20 21:46:58 +000028class TargetInstrInfo;
Jakob Stoklund Olesencfa71342010-11-10 19:31:50 +000029class TargetRegisterInfo;
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +000030class VirtRegMap;
31class VNInfo;
Jakob Stoklund Olesen532de3d2010-10-22 20:28:21 +000032class raw_ostream;
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000033
Jakob Stoklund Olesene1dde7b2010-10-28 20:34:52 +000034/// At some point we should just include MachineDominators.h:
35class MachineDominatorTree;
36template <class NodeT> class DomTreeNodeBase;
37typedef DomTreeNodeBase<MachineBasicBlock> MachineDomTreeNode;
38
Jakob Stoklund Olesen8d0963f2010-12-21 01:50:21 +000039
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +000040/// SplitAnalysis - Analyze a LiveInterval, looking for live range splitting
41/// opportunities.
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000042class SplitAnalysis {
Jakob Stoklund Olesen08e93b12010-08-10 17:07:22 +000043public:
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000044 const MachineFunction &mf_;
45 const LiveIntervals &lis_;
46 const MachineLoopInfo &loops_;
Jakob Stoklund Olesen6a0dc072010-07-20 21:46:58 +000047 const TargetInstrInfo &tii_;
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000048
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000049 // Instructions using the the current register.
50 typedef SmallPtrSet<const MachineInstr*, 16> InstrPtrSet;
51 InstrPtrSet usingInstrs_;
52
Jakob Stoklund Olesenb5fa9332011-01-18 21:13:27 +000053 // Sorted slot indexes of using instructions.
54 SmallVector<SlotIndex, 8> UseSlots;
55
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000056 // The number of instructions using curli in each basic block.
57 typedef DenseMap<const MachineBasicBlock*, unsigned> BlockCountMap;
58 BlockCountMap usingBlocks_;
59
Jakob Stoklund Olesen2dee7a52010-08-12 23:02:55 +000060 // The number of basic block using curli in each loop.
61 typedef DenseMap<const MachineLoop*, unsigned> LoopCountMap;
62 LoopCountMap usingLoops_;
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000063
Jakob Stoklund Olesenf1b05f22010-08-12 17:07:14 +000064private:
65 // Current live interval.
66 const LiveInterval *curli_;
67
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000068 // Sumarize statistics by counting instructions using curli_.
Jakob Stoklund Olesenabff2802010-07-20 16:12:37 +000069 void analyzeUses();
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000070
Jakob Stoklund Olesen6a0dc072010-07-20 21:46:58 +000071 /// canAnalyzeBranch - Return true if MBB ends in a branch that can be
72 /// analyzed.
73 bool canAnalyzeBranch(const MachineBasicBlock *MBB);
74
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000075public:
Jakob Stoklund Olesenf2c6e362010-07-20 23:50:15 +000076 SplitAnalysis(const MachineFunction &mf, const LiveIntervals &lis,
77 const MachineLoopInfo &mli);
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +000078
79 /// analyze - set curli to the specified interval, and analyze how it may be
80 /// split.
81 void analyze(const LiveInterval *li);
82
83 /// clear - clear all data structures so SplitAnalysis is ready to analyze a
84 /// new interval.
85 void clear();
86
Jakob Stoklund Olesenb5fa9332011-01-18 21:13:27 +000087 /// hasUses - Return true if MBB has any uses of curli.
88 bool hasUses(const MachineBasicBlock *MBB) const {
89 return usingBlocks_.lookup(MBB);
90 }
91
Jakob Stoklund Olesen6a0dc072010-07-20 21:46:58 +000092 typedef SmallPtrSet<const MachineBasicBlock*, 16> BlockPtrSet;
Jakob Stoklund Olesen2dee7a52010-08-12 23:02:55 +000093 typedef SmallPtrSet<const MachineLoop*, 16> LoopPtrSet;
Jakob Stoklund Olesen6a0dc072010-07-20 21:46:58 +000094
Jakob Stoklund Olesen532de3d2010-10-22 20:28:21 +000095 // Print a set of blocks with use counts.
96 void print(const BlockPtrSet&, raw_ostream&) const;
97
Jakob Stoklund Olesen6a0dc072010-07-20 21:46:58 +000098 // Sets of basic blocks surrounding a machine loop.
99 struct LoopBlocks {
100 BlockPtrSet Loop; // Blocks in the loop.
101 BlockPtrSet Preds; // Loop predecessor blocks.
102 BlockPtrSet Exits; // Loop exit blocks.
103
104 void clear() {
105 Loop.clear();
106 Preds.clear();
107 Exits.clear();
108 }
109 };
110
Jakob Stoklund Olesen532de3d2010-10-22 20:28:21 +0000111 // Print loop blocks with use counts.
112 void print(const LoopBlocks&, raw_ostream&) const;
113
Jakob Stoklund Olesen6a0dc072010-07-20 21:46:58 +0000114 // Calculate the block sets surrounding the loop.
115 void getLoopBlocks(const MachineLoop *Loop, LoopBlocks &Blocks);
116
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +0000117 /// LoopPeripheralUse - how is a variable used in and around a loop?
118 /// Peripheral blocks are the loop predecessors and exit blocks.
119 enum LoopPeripheralUse {
120 ContainedInLoop, // All uses are inside the loop.
121 SinglePeripheral, // At most one instruction per peripheral block.
122 MultiPeripheral, // Multiple instructions in some peripheral blocks.
123 OutsideLoop // Uses outside loop periphery.
124 };
125
126 /// analyzeLoopPeripheralUse - Return an enum describing how curli_ is used in
127 /// and around the Loop.
Jakob Stoklund Olesen6a0dc072010-07-20 21:46:58 +0000128 LoopPeripheralUse analyzeLoopPeripheralUse(const LoopBlocks&);
129
130 /// getCriticalExits - It may be necessary to partially break critical edges
131 /// leaving the loop if an exit block has phi uses of curli. Collect the exit
132 /// blocks that need special treatment into CriticalExits.
133 void getCriticalExits(const LoopBlocks &Blocks, BlockPtrSet &CriticalExits);
134
135 /// canSplitCriticalExits - Return true if it is possible to insert new exit
136 /// blocks before the blocks in CriticalExits.
137 bool canSplitCriticalExits(const LoopBlocks &Blocks,
138 BlockPtrSet &CriticalExits);
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +0000139
Jakob Stoklund Olesen0960a652010-10-27 00:39:05 +0000140 /// getCriticalPreds - Get the set of loop predecessors with critical edges to
141 /// blocks outside the loop that have curli live in. We don't have to break
142 /// these edges, but they do require special treatment.
143 void getCriticalPreds(const LoopBlocks &Blocks, BlockPtrSet &CriticalPreds);
144
Jakob Stoklund Olesen521a4532010-12-15 17:41:19 +0000145 /// getSplitLoops - Get the set of loops that have curli uses and would be
146 /// profitable to split.
147 void getSplitLoops(LoopPtrSet&);
148
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +0000149 /// getBestSplitLoop - Return the loop where curli may best be split to a
150 /// separate register, or NULL.
151 const MachineLoop *getBestSplitLoop();
Jakob Stoklund Olesenf1b05f22010-08-12 17:07:14 +0000152
Jakob Stoklund Olesen697483a2010-12-15 17:49:52 +0000153 /// isBypassLoop - Return true if curli is live through Loop and has no uses
154 /// inside the loop. Bypass loops are candidates for splitting because it can
155 /// prevent interference inside the loop.
156 bool isBypassLoop(const MachineLoop *Loop);
157
158 /// getBypassLoops - Get all the maximal bypass loops. These are the bypass
159 /// loops whose parent is not a bypass loop.
160 void getBypassLoops(LoopPtrSet&);
161
Jakob Stoklund Olesenf1b05f22010-08-12 17:07:14 +0000162 /// getMultiUseBlocks - Add basic blocks to Blocks that may benefit from
163 /// having curli split to a new live interval. Return true if Blocks can be
164 /// passed to SplitEditor::splitSingleBlocks.
165 bool getMultiUseBlocks(BlockPtrSet &Blocks);
Jakob Stoklund Olesenfc412d82010-08-13 21:18:48 +0000166
167 /// getBlockForInsideSplit - If curli is contained inside a single basic block,
168 /// and it wou pay to subdivide the interval inside that block, return it.
169 /// Otherwise return NULL. The returned block can be passed to
170 /// SplitEditor::splitInsideBlock.
171 const MachineBasicBlock *getBlockForInsideSplit();
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +0000172};
173
Jakob Stoklund Olesen1407c842010-08-18 19:00:08 +0000174
175/// LiveIntervalMap - Map values from a large LiveInterval into a small
176/// interval that is a subset. Insert phi-def values as needed. This class is
177/// used by SplitEditor to create new smaller LiveIntervals.
178///
179/// parentli_ is the larger interval, li_ is the subset interval. Every value
180/// in li_ corresponds to exactly one value in parentli_, and the live range
181/// of the value is contained within the live range of the parentli_ value.
182/// Values in parentli_ may map to any number of openli_ values, including 0.
183class LiveIntervalMap {
184 LiveIntervals &lis_;
Jakob Stoklund Olesend68f4582010-10-28 20:34:50 +0000185 MachineDominatorTree &mdt_;
Jakob Stoklund Olesen1407c842010-08-18 19:00:08 +0000186
187 // The parent interval is never changed.
188 const LiveInterval &parentli_;
189
190 // The child interval's values are fully contained inside parentli_ values.
Jakob Stoklund Olesen9ca2aeb2010-09-13 23:29:09 +0000191 LiveInterval *li_;
Jakob Stoklund Olesen1407c842010-08-18 19:00:08 +0000192
193 typedef DenseMap<const VNInfo*, VNInfo*> ValueMap;
194
195 // Map parentli_ values to simple values in li_ that are defined at the same
196 // SlotIndex, or NULL for parentli_ values that have complex li_ defs.
197 // Note there is a difference between values mapping to NULL (complex), and
198 // values not present (unknown/unmapped).
199 ValueMap valueMap_;
200
Jakob Stoklund Olesene1dde7b2010-10-28 20:34:52 +0000201 typedef std::pair<VNInfo*, MachineDomTreeNode*> LiveOutPair;
202 typedef DenseMap<MachineBasicBlock*,LiveOutPair> LiveOutMap;
203
204 // liveOutCache_ - Map each basic block where li_ is live out to the live-out
205 // value and its defining block. One of these conditions shall be true:
206 //
207 // 1. !liveOutCache_.count(MBB)
208 // 2. liveOutCache_[MBB].second.getNode() == MBB
209 // 3. forall P in preds(MBB): liveOutCache_[P] == liveOutCache_[MBB]
210 //
211 // This is only a cache, the values can be computed as:
212 //
213 // VNI = li_->getVNInfoAt(lis_.getMBBEndIdx(MBB))
214 // Node = mbt_[lis_.getMBBFromIndex(VNI->def)]
215 //
216 // The cache is also used as a visiteed set by mapValue().
217 LiveOutMap liveOutCache_;
218
Jakob Stoklund Olesend7ca5772011-01-20 17:45:20 +0000219 // Dump the live-out cache to dbgs().
220 void dumpCache();
221
Jakob Stoklund Olesen1407c842010-08-18 19:00:08 +0000222public:
223 LiveIntervalMap(LiveIntervals &lis,
Jakob Stoklund Olesend68f4582010-10-28 20:34:50 +0000224 MachineDominatorTree &mdt,
Jakob Stoklund Olesen9ca2aeb2010-09-13 23:29:09 +0000225 const LiveInterval &parentli)
Jakob Stoklund Olesend68f4582010-10-28 20:34:50 +0000226 : lis_(lis), mdt_(mdt), parentli_(parentli), li_(0) {}
Jakob Stoklund Olesen9ca2aeb2010-09-13 23:29:09 +0000227
228 /// reset - clear all data structures and start a new live interval.
229 void reset(LiveInterval *);
230
231 /// getLI - return the current live interval.
232 LiveInterval *getLI() const { return li_; }
Jakob Stoklund Olesen1407c842010-08-18 19:00:08 +0000233
234 /// defValue - define a value in li_ from the parentli_ value VNI and Idx.
235 /// Idx does not have to be ParentVNI->def, but it must be contained within
236 /// ParentVNI's live range in parentli_.
237 /// Return the new li_ value.
238 VNInfo *defValue(const VNInfo *ParentVNI, SlotIndex Idx);
239
240 /// mapValue - map ParentVNI to the corresponding li_ value at Idx. It is
241 /// assumed that ParentVNI is live at Idx.
242 /// If ParentVNI has not been defined by defValue, it is assumed that
243 /// ParentVNI->def dominates Idx.
244 /// If ParentVNI has been defined by defValue one or more times, a value that
245 /// dominates Idx will be returned. This may require creating extra phi-def
246 /// values and adding live ranges to li_.
Jakob Stoklund Olesen5fa42a42010-09-21 22:32:21 +0000247 /// If simple is not NULL, *simple will indicate if ParentVNI is a simply
248 /// mapped value.
249 VNInfo *mapValue(const VNInfo *ParentVNI, SlotIndex Idx, bool *simple = 0);
250
Jakob Stoklund Olesenfc60d772010-10-05 20:36:25 +0000251 // extendTo - Find the last li_ value defined in MBB at or before Idx. The
252 // parentli is assumed to be live at Idx. Extend the live range to include
253 // Idx. Return the found VNInfo, or NULL.
Jakob Stoklund Olesenc95c1462010-10-27 00:39:07 +0000254 VNInfo *extendTo(const MachineBasicBlock *MBB, SlotIndex Idx);
Jakob Stoklund Olesenfc60d772010-10-05 20:36:25 +0000255
Jakob Stoklund Olesen5fa42a42010-09-21 22:32:21 +0000256 /// isMapped - Return true is ParentVNI is a known mapped value. It may be a
257 /// simple 1-1 mapping or a complex mapping to later defs.
258 bool isMapped(const VNInfo *ParentVNI) const {
259 return valueMap_.count(ParentVNI);
260 }
261
262 /// isComplexMapped - Return true if ParentVNI has received new definitions
263 /// with defValue.
264 bool isComplexMapped(const VNInfo *ParentVNI) const;
265
266 // addSimpleRange - Add a simple range from parentli_ to li_.
267 // ParentVNI must be live in the [Start;End) interval.
268 void addSimpleRange(SlotIndex Start, SlotIndex End, const VNInfo *ParentVNI);
Jakob Stoklund Olesen1407c842010-08-18 19:00:08 +0000269
270 /// addRange - Add live ranges to li_ where [Start;End) intersects parentli_.
271 /// All needed values whose def is not inside [Start;End) must be defined
272 /// beforehand so mapValue will work.
273 void addRange(SlotIndex Start, SlotIndex End);
274};
275
276
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000277/// SplitEditor - Edit machine code and LiveIntervals for live range
278/// splitting.
279///
Jakob Stoklund Olesen5eb308b2010-08-06 22:17:33 +0000280/// - Create a SplitEditor from a SplitAnalysis.
Jakob Stoklund Olesen7536f722010-08-04 22:08:39 +0000281/// - Start a new live interval with openIntv.
282/// - Mark the places where the new interval is entered using enterIntv*
283/// - Mark the ranges where the new interval is used with useIntv*
284/// - Mark the places where the interval is exited with exitIntv*.
285/// - Finish the current interval with closeIntv and repeat from 2.
Jakob Stoklund Olesen74669272010-10-08 23:42:21 +0000286/// - Rewrite instructions with finish().
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000287///
288class SplitEditor {
289 SplitAnalysis &sa_;
290 LiveIntervals &lis_;
291 VirtRegMap &vrm_;
292 MachineRegisterInfo &mri_;
293 const TargetInstrInfo &tii_;
Jakob Stoklund Olesencfa71342010-11-10 19:31:50 +0000294 const TargetRegisterInfo &tri_;
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000295
Jakob Stoklund Olesena17768f2010-10-14 23:49:52 +0000296 /// edit_ - The current parent register and new intervals created.
297 LiveRangeEdit &edit_;
298
Jakob Stoklund Olesen5eb308b2010-08-06 22:17:33 +0000299 /// dupli_ - Created as a copy of curli_, ranges are carved out as new
300 /// intervals get added through openIntv / closeIntv. This is used to avoid
301 /// editing curli_.
Jakob Stoklund Olesendd9f3fd2010-09-13 23:29:11 +0000302 LiveIntervalMap dupli_;
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000303
304 /// Currently open LiveInterval.
Jakob Stoklund Olesendd9f3fd2010-09-13 23:29:11 +0000305 LiveIntervalMap openli_;
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000306
Jakob Stoklund Olesencfa71342010-11-10 19:31:50 +0000307 /// defFromParent - Define Reg from ParentVNI at UseIdx using either
308 /// rematerialization or a COPY from parent. Return the new value.
309 VNInfo *defFromParent(LiveIntervalMap &Reg,
310 VNInfo *ParentVNI,
311 SlotIndex UseIdx,
312 MachineBasicBlock &MBB,
313 MachineBasicBlock::iterator I);
314
Jakob Stoklund Olesen5fa42a42010-09-21 22:32:21 +0000315 /// intervalsLiveAt - Return true if any member of intervals_ is live at Idx.
316 bool intervalsLiveAt(SlotIndex Idx) const;
317
318 /// Values in curli whose live range has been truncated when entering an open
319 /// li.
320 SmallPtrSet<const VNInfo*, 8> truncatedValues;
321
322 /// addTruncSimpleRange - Add the given simple range to dupli_ after
323 /// truncating any overlap with intervals_.
324 void addTruncSimpleRange(SlotIndex Start, SlotIndex End, VNInfo *VNI);
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000325
Jakob Stoklund Olesenc95c1462010-10-27 00:39:07 +0000326 /// criticalPreds_ - Set of basic blocks where both dupli and openli should be
327 /// live out because of a critical edge.
328 SplitAnalysis::BlockPtrSet criticalPreds_;
329
Jakob Stoklund Olesen74669272010-10-08 23:42:21 +0000330 /// computeRemainder - Compute the dupli liveness as the complement of all the
331 /// new intervals.
332 void computeRemainder();
333
334 /// rewrite - Rewrite all uses of reg to use the new registers.
335 void rewrite(unsigned reg);
336
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000337public:
338 /// Create a new SplitEditor for editing the LiveInterval analyzed by SA.
Jakob Stoklund Olesen7536f722010-08-04 22:08:39 +0000339 /// Newly created intervals will be appended to newIntervals.
Jakob Stoklund Olesend68f4582010-10-28 20:34:50 +0000340 SplitEditor(SplitAnalysis &SA, LiveIntervals&, VirtRegMap&,
341 MachineDominatorTree&, LiveRangeEdit&);
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000342
Jakob Stoklund Olesen5eb308b2010-08-06 22:17:33 +0000343 /// getAnalysis - Get the corresponding analysis.
344 SplitAnalysis &getAnalysis() { return sa_; }
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000345
Jakob Stoklund Olesen7536f722010-08-04 22:08:39 +0000346 /// Create a new virtual register and live interval.
347 void openIntv();
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000348
Jakob Stoklund Olesenf1b05f22010-08-12 17:07:14 +0000349 /// enterIntvBefore - Enter openli before the instruction at Idx. If curli is
350 /// not live before Idx, a COPY is not inserted.
351 void enterIntvBefore(SlotIndex Idx);
352
Jakob Stoklund Olesen7536f722010-08-04 22:08:39 +0000353 /// enterIntvAtEnd - Enter openli at the end of MBB.
Jakob Stoklund Olesenf6a129a2010-09-16 00:01:36 +0000354 void enterIntvAtEnd(MachineBasicBlock &MBB);
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000355
Jakob Stoklund Olesen7536f722010-08-04 22:08:39 +0000356 /// useIntv - indicate that all instructions in MBB should use openli.
357 void useIntv(const MachineBasicBlock &MBB);
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000358
Jakob Stoklund Olesen7536f722010-08-04 22:08:39 +0000359 /// useIntv - indicate that all instructions in range should use openli.
360 void useIntv(SlotIndex Start, SlotIndex End);
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000361
Jakob Stoklund Olesenf1b05f22010-08-12 17:07:14 +0000362 /// leaveIntvAfter - Leave openli after the instruction at Idx.
363 void leaveIntvAfter(SlotIndex Idx);
364
Jakob Stoklund Olesen7536f722010-08-04 22:08:39 +0000365 /// leaveIntvAtTop - Leave the interval at the top of MBB.
366 /// Currently, only one value can leave the interval.
367 void leaveIntvAtTop(MachineBasicBlock &MBB);
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000368
Jakob Stoklund Olesen7536f722010-08-04 22:08:39 +0000369 /// closeIntv - Indicate that we are done editing the currently open
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000370 /// LiveInterval, and ranges can be trimmed.
Jakob Stoklund Olesen7536f722010-08-04 22:08:39 +0000371 void closeIntv();
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000372
Jakob Stoklund Olesen74669272010-10-08 23:42:21 +0000373 /// finish - after all the new live ranges have been created, compute the
374 /// remaining live range, and rewrite instructions to use the new registers.
375 void finish();
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000376
377 // ===--- High level methods ---===
378
379 /// splitAroundLoop - Split curli into a separate live interval inside
Jakob Stoklund Olesen57d0f2d2010-10-05 22:19:33 +0000380 /// the loop.
381 void splitAroundLoop(const MachineLoop*);
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000382
Jakob Stoklund Olesenf1b05f22010-08-12 17:07:14 +0000383 /// splitSingleBlocks - Split curli into a separate live interval inside each
Jakob Stoklund Olesen57d0f2d2010-10-05 22:19:33 +0000384 /// basic block in Blocks.
385 void splitSingleBlocks(const SplitAnalysis::BlockPtrSet &Blocks);
Jakob Stoklund Olesenf0179002010-07-26 23:44:11 +0000386
Jakob Stoklund Olesen57d0f2d2010-10-05 22:19:33 +0000387 /// splitInsideBlock - Split curli into multiple intervals inside MBB.
388 void splitInsideBlock(const MachineBasicBlock *);
Jakob Stoklund Olesenfc412d82010-08-13 21:18:48 +0000389};
Jakob Stoklund Olesen8ae02632010-07-20 15:41:07 +0000390
391}