blob: 440ae6ec5b6944fef852dde0764d057b7f18f9e1 [file] [log] [blame]
Chris Lattnera3b8b5c2004-07-23 17:56:30 +00001//===-- LiveIntervalAnalysis.h - Live Interval Analysis ---------*- C++ -*-===//
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner7ed47a12007-12-29 19:59:42 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +00007//
8//===----------------------------------------------------------------------===//
9//
Chris Lattner6b929062004-07-19 02:13:59 +000010// This file implements the LiveInterval analysis pass. Given some numbering of
11// each the machine instructions (in this implemention depth-first order) an
12// interval [i, j) is said to be a live interval for register v if there is no
13// instruction with number j' > j such that v is live at j' abd there is no
14// instruction with number i' < i such that v is live at i'. In this
15// implementation intervals can have holes, i.e. an interval might look like
16// [1,20), [50,65), [1000,1001).
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +000017//
18//===----------------------------------------------------------------------===//
19
Chris Lattnera3b8b5c2004-07-23 17:56:30 +000020#ifndef LLVM_CODEGEN_LIVEINTERVAL_ANALYSIS_H
21#define LLVM_CODEGEN_LIVEINTERVAL_ANALYSIS_H
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +000022
23#include "llvm/CodeGen/MachineFunctionPass.h"
Chris Lattner779a6512005-09-21 04:18:25 +000024#include "llvm/CodeGen/LiveInterval.h"
Evan Cheng61de82d2007-02-15 05:59:24 +000025#include "llvm/ADT/BitVector.h"
Evan Cheng20b0abc2007-04-17 20:32:26 +000026#include "llvm/ADT/DenseMap.h"
Evan Cheng549f27d32007-08-13 23:45:17 +000027#include "llvm/ADT/SmallPtrSet.h"
28#include "llvm/ADT/SmallVector.h"
Evan Chengf3bb2e62007-09-05 21:46:51 +000029#include "llvm/Support/Allocator.h"
Hartmut Kaiserffb15de2007-11-13 23:04:28 +000030#include <cmath>
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +000031
32namespace llvm {
33
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +000034 class LiveVariables;
Evan Cheng22f07ff2007-12-11 02:09:15 +000035 class MachineLoopInfo;
Dan Gohman6f0d0242008-02-10 18:45:23 +000036 class TargetRegisterInfo;
Chris Lattner84bc5422007-12-31 04:13:23 +000037 class MachineRegisterInfo;
Chris Lattnerf768bba2005-03-09 23:05:19 +000038 class TargetInstrInfo;
Evan Cheng20b0abc2007-04-17 20:32:26 +000039 class TargetRegisterClass;
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +000040 class VirtRegMap;
Evan Cheng4ca980e2007-10-17 02:10:22 +000041 typedef std::pair<unsigned, MachineBasicBlock*> IdxMBBPair;
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +000042
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +000043 class LiveIntervals : public MachineFunctionPass {
44 MachineFunction* mf_;
45 const TargetMachine* tm_;
Dan Gohman6f0d0242008-02-10 18:45:23 +000046 const TargetRegisterInfo* tri_;
Chris Lattnerf768bba2005-03-09 23:05:19 +000047 const TargetInstrInfo* tii_;
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +000048 LiveVariables* lv_;
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +000049
Evan Chengf3bb2e62007-09-05 21:46:51 +000050 /// Special pool allocator for VNInfo's (LiveInterval val#).
51 ///
52 BumpPtrAllocator VNInfoAllocator;
53
Evan Cheng549f27d32007-08-13 23:45:17 +000054 /// MBB2IdxMap - The indexes of the first and last instructions in the
55 /// specified basic block.
56 std::vector<std::pair<unsigned, unsigned> > MBB2IdxMap;
David Greene25133302007-06-08 17:18:56 +000057
Evan Cheng4ca980e2007-10-17 02:10:22 +000058 /// Idx2MBBMap - Sorted list of pairs of index of first instruction
59 /// and MBB id.
60 std::vector<IdxMBBPair> Idx2MBBMap;
61
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +000062 typedef std::map<MachineInstr*, unsigned> Mi2IndexMap;
63 Mi2IndexMap mi2iMap_;
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +000064
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +000065 typedef std::vector<MachineInstr*> Index2MiMap;
66 Index2MiMap i2miMap_;
Alkis Evlogimenos843b1602004-02-15 10:24:21 +000067
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +000068 typedef std::map<unsigned, LiveInterval> Reg2IntervalMap;
69 Reg2IntervalMap r2iMap_;
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +000070
Evan Cheng61de82d2007-02-15 05:59:24 +000071 BitVector allocatableRegs_;
Evan Cheng88d1f582007-03-01 02:03:03 +000072
Evan Cheng549f27d32007-08-13 23:45:17 +000073 std::vector<MachineInstr*> ClonedMIs;
74
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +000075 public:
Nick Lewyckyecd94c82007-05-06 13:37:16 +000076 static char ID; // Pass identification, replacement for typeid
Devang Patel794fd752007-05-01 21:15:47 +000077 LiveIntervals() : MachineFunctionPass((intptr_t)&ID) {}
78
Chris Lattnerf7da2c72006-08-24 22:43:55 +000079 struct InstrSlots {
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +000080 enum {
81 LOAD = 0,
82 USE = 1,
83 DEF = 2,
84 STORE = 3,
Chris Lattner410354f2006-02-22 16:23:43 +000085 NUM = 4
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +000086 };
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +000087 };
88
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +000089 static unsigned getBaseIndex(unsigned index) {
90 return index - (index % InstrSlots::NUM);
91 }
92 static unsigned getBoundaryIndex(unsigned index) {
93 return getBaseIndex(index + InstrSlots::NUM - 1);
94 }
95 static unsigned getLoadIndex(unsigned index) {
96 return getBaseIndex(index) + InstrSlots::LOAD;
97 }
98 static unsigned getUseIndex(unsigned index) {
99 return getBaseIndex(index) + InstrSlots::USE;
100 }
101 static unsigned getDefIndex(unsigned index) {
102 return getBaseIndex(index) + InstrSlots::DEF;
103 }
104 static unsigned getStoreIndex(unsigned index) {
105 return getBaseIndex(index) + InstrSlots::STORE;
106 }
107
Evan Cheng81a03822007-11-17 00:40:40 +0000108 static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth) {
109 return (isDef + isUse) * powf(10.0F, (float)loopDepth);
Evan Chengf2fbca62007-11-12 06:35:08 +0000110 }
111
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000112 typedef Reg2IntervalMap::iterator iterator;
Chris Lattner70ca3582004-09-30 15:59:17 +0000113 typedef Reg2IntervalMap::const_iterator const_iterator;
114 const_iterator begin() const { return r2iMap_.begin(); }
115 const_iterator end() const { return r2iMap_.end(); }
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000116 iterator begin() { return r2iMap_.begin(); }
117 iterator end() { return r2iMap_.end(); }
118 unsigned getNumIntervals() const { return r2iMap_.size(); }
119
120 LiveInterval &getInterval(unsigned reg) {
121 Reg2IntervalMap::iterator I = r2iMap_.find(reg);
122 assert(I != r2iMap_.end() && "Interval does not exist for register");
123 return I->second;
124 }
125
126 const LiveInterval &getInterval(unsigned reg) const {
127 Reg2IntervalMap::const_iterator I = r2iMap_.find(reg);
128 assert(I != r2iMap_.end() && "Interval does not exist for register");
129 return I->second;
130 }
131
Evan Chengb371f452007-02-19 21:49:54 +0000132 bool hasInterval(unsigned reg) const {
Evan Cheng88d1f582007-03-01 02:03:03 +0000133 return r2iMap_.count(reg);
Evan Chengb371f452007-02-19 21:49:54 +0000134 }
135
Chris Lattner428b92e2006-09-15 03:57:23 +0000136 /// getMBBStartIdx - Return the base index of the first instruction in the
137 /// specified MachineBasicBlock.
138 unsigned getMBBStartIdx(MachineBasicBlock *MBB) const {
139 return getMBBStartIdx(MBB->getNumber());
140 }
Chris Lattner428b92e2006-09-15 03:57:23 +0000141 unsigned getMBBStartIdx(unsigned MBBNo) const {
142 assert(MBBNo < MBB2IdxMap.size() && "Invalid MBB number!");
Evan Cheng549f27d32007-08-13 23:45:17 +0000143 return MBB2IdxMap[MBBNo].first;
144 }
145
146 /// getMBBEndIdx - Return the store index of the last instruction in the
147 /// specified MachineBasicBlock.
148 unsigned getMBBEndIdx(MachineBasicBlock *MBB) const {
149 return getMBBEndIdx(MBB->getNumber());
150 }
151 unsigned getMBBEndIdx(unsigned MBBNo) const {
152 assert(MBBNo < MBB2IdxMap.size() && "Invalid MBB number!");
153 return MBB2IdxMap[MBBNo].second;
Chris Lattner428b92e2006-09-15 03:57:23 +0000154 }
155
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000156 /// getInstructionIndex - returns the base index of instr
157 unsigned getInstructionIndex(MachineInstr* instr) const {
158 Mi2IndexMap::const_iterator it = mi2iMap_.find(instr);
159 assert(it != mi2iMap_.end() && "Invalid instruction!");
160 return it->second;
161 }
162
163 /// getInstructionFromIndex - given an index in any slot of an
164 /// instruction return a pointer the instruction
165 MachineInstr* getInstructionFromIndex(unsigned index) const {
166 index /= InstrSlots::NUM; // convert index to vector index
167 assert(index < i2miMap_.size() &&
168 "index does not correspond to an instruction");
169 return i2miMap_[index];
170 }
David Greene25133302007-06-08 17:18:56 +0000171
Evan Chengc92da382007-11-03 07:20:12 +0000172 /// conflictsWithPhysRegDef - Returns true if the specified register
173 /// is defined during the duration of the specified interval.
174 bool conflictsWithPhysRegDef(const LiveInterval &li, VirtRegMap &vrm,
175 unsigned reg);
176
Evan Cheng4ca980e2007-10-17 02:10:22 +0000177 /// findLiveInMBBs - Given a live range, if the value of the range
178 /// is live in any MBB returns true as well as the list of basic blocks
179 /// where the value is live in.
180 bool findLiveInMBBs(const LiveRange &LR,
Evan Chenga5bfc972007-10-17 06:53:44 +0000181 SmallVectorImpl<MachineBasicBlock*> &MBBs) const;
Evan Cheng4ca980e2007-10-17 02:10:22 +0000182
David Greene25133302007-06-08 17:18:56 +0000183 // Interval creation
184
185 LiveInterval &getOrCreateInterval(unsigned reg) {
186 Reg2IntervalMap::iterator I = r2iMap_.find(reg);
187 if (I == r2iMap_.end())
188 I = r2iMap_.insert(I, std::make_pair(reg, createInterval(reg)));
189 return I->second;
190 }
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000191
David Greene25133302007-06-08 17:18:56 +0000192 // Interval removal
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000193
David Greene25133302007-06-08 17:18:56 +0000194 void removeInterval(unsigned Reg) {
195 r2iMap_.erase(Reg);
Bill Wendling5c7e3262006-12-17 05:15:13 +0000196 }
Chris Lattner70ca3582004-09-30 15:59:17 +0000197
Evan Cheng30cac022007-02-22 23:03:39 +0000198 /// isRemoved - returns true if the specified machine instr has been
199 /// removed.
200 bool isRemoved(MachineInstr* instr) const {
Evan Cheng7d35c0e2007-02-22 23:52:23 +0000201 return !mi2iMap_.count(instr);
Evan Cheng30cac022007-02-22 23:03:39 +0000202 }
203
Chris Lattnerf7da2c72006-08-24 22:43:55 +0000204 /// RemoveMachineInstrFromMaps - This marks the specified machine instr as
205 /// deleted.
206 void RemoveMachineInstrFromMaps(MachineInstr *MI) {
207 // remove index -> MachineInstr and
208 // MachineInstr -> index mappings
209 Mi2IndexMap::iterator mi2i = mi2iMap_.find(MI);
210 if (mi2i != mi2iMap_.end()) {
211 i2miMap_[mi2i->second/InstrSlots::NUM] = 0;
212 mi2iMap_.erase(mi2i);
213 }
214 }
David Greene25133302007-06-08 17:18:56 +0000215
Evan Cheng70071432008-02-13 03:01:43 +0000216 /// ReplaceMachineInstrInMaps - Replacing a machine instr with a new one in
217 /// maps used by register allocator.
218 void ReplaceMachineInstrInMaps(MachineInstr *MI, MachineInstr *NewMI) {
219 Mi2IndexMap::iterator mi2i = mi2iMap_.find(MI);
Evan Chengb1f6f912008-02-13 09:18:16 +0000220 if (mi2i == mi2iMap_.end())
221 return;
222 i2miMap_[mi2i->second/InstrSlots::NUM] = NewMI;
223 Mi2IndexMap::iterator it = mi2iMap_.find(MI);
224 assert(it != mi2iMap_.end() && "Invalid instruction!");
225 unsigned Index = it->second;
226 mi2iMap_.erase(it);
227 mi2iMap_[NewMI] = Index;
Evan Cheng70071432008-02-13 03:01:43 +0000228 }
229
Evan Chengf3bb2e62007-09-05 21:46:51 +0000230 BumpPtrAllocator& getVNInfoAllocator() { return VNInfoAllocator; }
231
Evan Chengc8d044e2008-02-15 18:24:29 +0000232 /// getVNInfoSourceReg - Helper function that parses the specified VNInfo
233 /// copy field and returns the source register that defines it.
234 unsigned getVNInfoSourceReg(const VNInfo *VNI) const;
235
David Greene25133302007-06-08 17:18:56 +0000236 virtual void getAnalysisUsage(AnalysisUsage &AU) const;
237 virtual void releaseMemory();
238
239 /// runOnMachineFunction - pass entry point
240 virtual bool runOnMachineFunction(MachineFunction&);
241
242 /// print - Implement the dump method.
243 virtual void print(std::ostream &O, const Module* = 0) const;
244 void print(std::ostream *O, const Module* M = 0) const {
245 if (O) print(*O, M);
246 }
247
Evan Chengf2fbca62007-11-12 06:35:08 +0000248 /// addIntervalsForSpills - Create new intervals for spilled defs / uses of
249 /// the given interval.
250 std::vector<LiveInterval*>
Evan Cheng81a03822007-11-17 00:40:40 +0000251 addIntervalsForSpills(const LiveInterval& i,
Evan Cheng22f07ff2007-12-11 02:09:15 +0000252 const MachineLoopInfo *loopInfo, VirtRegMap& vrm);
Evan Chengf2fbca62007-11-12 06:35:08 +0000253
Evan Cheng5ef3a042007-12-06 00:01:56 +0000254 /// isReMaterializable - Returns true if every definition of MI of every
255 /// val# of the specified interval is re-materializable. Also returns true
256 /// by reference if all of the defs are load instructions.
257 bool isReMaterializable(const LiveInterval &li, bool &isLoad);
258
David Greene25133302007-06-08 17:18:56 +0000259 private:
Chris Lattner428b92e2006-09-15 03:57:23 +0000260 /// computeIntervals - Compute live intervals.
Chris Lattnerc7695eb2006-09-14 06:42:17 +0000261 void computeIntervals();
Chris Lattner6bda49f2006-09-02 05:26:01 +0000262
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000263 /// handleRegisterDef - update intervals for a register def
264 /// (calls handlePhysicalRegisterDef and
265 /// handleVirtualRegisterDef)
Chris Lattner6b128bd2006-09-03 08:07:11 +0000266 void handleRegisterDef(MachineBasicBlock *MBB,
267 MachineBasicBlock::iterator MI, unsigned MIIdx,
Chris Lattnerf38a05d2006-01-29 07:59:37 +0000268 unsigned reg);
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000269
270 /// handleVirtualRegisterDef - update intervals for a virtual
271 /// register def
Chris Lattner6b128bd2006-09-03 08:07:11 +0000272 void handleVirtualRegisterDef(MachineBasicBlock *MBB,
273 MachineBasicBlock::iterator MI,
274 unsigned MIIdx,
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000275 LiveInterval& interval);
276
Chris Lattnerf768bba2005-03-09 23:05:19 +0000277 /// handlePhysicalRegisterDef - update intervals for a physical register
Chris Lattnerf7da2c72006-08-24 22:43:55 +0000278 /// def.
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000279 void handlePhysicalRegisterDef(MachineBasicBlock* mbb,
280 MachineBasicBlock::iterator mi,
Chris Lattner6b128bd2006-09-03 08:07:11 +0000281 unsigned MIIdx,
Chris Lattner91725b72006-08-31 05:54:43 +0000282 LiveInterval &interval,
Evan Chengc8d044e2008-02-15 18:24:29 +0000283 MachineInstr *CopyMI);
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000284
Evan Chengb371f452007-02-19 21:49:54 +0000285 /// handleLiveInRegister - Create interval for a livein register.
Jim Laskey9b25b8c2007-02-21 22:41:17 +0000286 void handleLiveInRegister(MachineBasicBlock* mbb,
287 unsigned MIIdx,
Evan Cheng24a3cc42007-04-25 07:30:23 +0000288 LiveInterval &interval, bool isAlias = false);
Evan Chengb371f452007-02-19 21:49:54 +0000289
Evan Cheng549f27d32007-08-13 23:45:17 +0000290 /// isReMaterializable - Returns true if the definition MI of the specified
Evan Cheng5ef3a042007-12-06 00:01:56 +0000291 /// val# of the specified interval is re-materializable. Also returns true
292 /// by reference if the def is a load.
Evan Cheng7ecb38b2007-08-29 20:45:00 +0000293 bool isReMaterializable(const LiveInterval &li, const VNInfo *ValNo,
Evan Cheng5ef3a042007-12-06 00:01:56 +0000294 MachineInstr *MI, bool &isLoad);
Evan Cheng549f27d32007-08-13 23:45:17 +0000295
Evan Cheng35b35c52007-08-30 05:52:20 +0000296 /// tryFoldMemoryOperand - Attempts to fold either a spill / restore from
297 /// slot / to reg or any rematerialized load into ith operand of specified
298 /// MI. If it is successul, MI is updated with the newly created MI and
299 /// returns true.
300 bool tryFoldMemoryOperand(MachineInstr* &MI, VirtRegMap &vrm,
Evan Chengcddbb832007-11-30 21:23:43 +0000301 MachineInstr *DefMI, unsigned InstrIdx,
Evan Chengaee4af62007-12-02 08:30:39 +0000302 SmallVector<unsigned, 2> &Ops,
Evan Chengcddbb832007-11-30 21:23:43 +0000303 bool isSS, int Slot, unsigned Reg);
Evan Cheng549f27d32007-08-13 23:45:17 +0000304
Evan Cheng018f9b02007-12-05 03:22:34 +0000305 /// canFoldMemoryOperand - Returns true if the specified load / store
306 /// folding is possible.
Evan Chengd64b5c82007-12-05 03:14:33 +0000307 bool canFoldMemoryOperand(MachineInstr *MI,
308 SmallVector<unsigned, 2> &Ops) const;
309
Evan Cheng0cbb1162007-11-29 01:06:25 +0000310 /// anyKillInMBBAfterIdx - Returns true if there is a kill of the specified
311 /// VNInfo that's after the specified index but is within the basic block.
312 bool anyKillInMBBAfterIdx(const LiveInterval &li, const VNInfo *VNI,
313 MachineBasicBlock *MBB, unsigned Idx) const;
Evan Cheng81a03822007-11-17 00:40:40 +0000314
Evan Cheng0cbb1162007-11-29 01:06:25 +0000315 /// intervalIsInOneMBB - Returns true if the specified interval is entirely
316 /// within a single basic block.
Evan Cheng81a03822007-11-17 00:40:40 +0000317 bool intervalIsInOneMBB(const LiveInterval &li) const;
318
Evan Cheng1953d0c2007-11-29 10:12:14 +0000319 /// SRInfo - Spill / restore info.
320 struct SRInfo {
321 int index;
322 unsigned vreg;
323 bool canFold;
324 SRInfo(int i, unsigned vr, bool f) : index(i), vreg(vr), canFold(f) {};
325 };
326
327 bool alsoFoldARestore(int Id, int index, unsigned vr,
328 BitVector &RestoreMBBs,
Chris Lattner84bc5422007-12-31 04:13:23 +0000329 std::map<unsigned,std::vector<SRInfo> >&RestoreIdxes);
Evan Cheng1953d0c2007-11-29 10:12:14 +0000330 void eraseRestoreInfo(int Id, int index, unsigned vr,
331 BitVector &RestoreMBBs,
Chris Lattner84bc5422007-12-31 04:13:23 +0000332 std::map<unsigned,std::vector<SRInfo> >&RestoreIdxes);
Evan Cheng1953d0c2007-11-29 10:12:14 +0000333
Chris Lattner84bc5422007-12-31 04:13:23 +0000334 /// rewriteInstructionForSpills, rewriteInstructionsForSpills - Helper
335 /// functions for addIntervalsForSpills to rewrite uses / defs for the given
336 /// live range.
Evan Chengd64b5c82007-12-05 03:14:33 +0000337 bool rewriteInstructionForSpills(const LiveInterval &li, bool TrySplit,
Evan Chengf2fbca62007-11-12 06:35:08 +0000338 unsigned id, unsigned index, unsigned end, MachineInstr *MI,
339 MachineInstr *OrigDefMI, MachineInstr *DefMI, unsigned Slot, int LdSlot,
340 bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
Chris Lattner84bc5422007-12-31 04:13:23 +0000341 VirtRegMap &vrm, MachineRegisterInfo &RegMap,
342 const TargetRegisterClass* rc,
Evan Chengf2fbca62007-11-12 06:35:08 +0000343 SmallVector<int, 4> &ReMatIds,
Evan Cheng22f07ff2007-12-11 02:09:15 +0000344 unsigned &NewVReg, bool &HasDef, bool &HasUse,
345 const MachineLoopInfo *loopInfo,
Evan Cheng1953d0c2007-11-29 10:12:14 +0000346 std::map<unsigned,unsigned> &MBBVRegsMap,
Evan Chengf2fbca62007-11-12 06:35:08 +0000347 std::vector<LiveInterval*> &NewLIs);
Evan Cheng81a03822007-11-17 00:40:40 +0000348 void rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
Evan Chengf2fbca62007-11-12 06:35:08 +0000349 LiveInterval::Ranges::const_iterator &I,
350 MachineInstr *OrigDefMI, MachineInstr *DefMI, unsigned Slot, int LdSlot,
351 bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete,
Chris Lattner84bc5422007-12-31 04:13:23 +0000352 VirtRegMap &vrm, MachineRegisterInfo &RegMap,
353 const TargetRegisterClass* rc,
Evan Cheng22f07ff2007-12-11 02:09:15 +0000354 SmallVector<int, 4> &ReMatIds, const MachineLoopInfo *loopInfo,
Evan Cheng81a03822007-11-17 00:40:40 +0000355 BitVector &SpillMBBs,
Evan Cheng1953d0c2007-11-29 10:12:14 +0000356 std::map<unsigned,std::vector<SRInfo> > &SpillIdxes,
Evan Cheng0cbb1162007-11-29 01:06:25 +0000357 BitVector &RestoreMBBs,
Evan Cheng1953d0c2007-11-29 10:12:14 +0000358 std::map<unsigned,std::vector<SRInfo> > &RestoreIdxes,
359 std::map<unsigned,unsigned> &MBBVRegsMap,
Evan Chengf2fbca62007-11-12 06:35:08 +0000360 std::vector<LiveInterval*> &NewLIs);
361
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000362 static LiveInterval createInterval(unsigned Reg);
363
Alkis Evlogimenos1a8ea012004-08-04 09:46:26 +0000364 void printRegName(unsigned reg) const;
365 };
366
Alkis Evlogimenosff0cbe12003-11-20 03:32:25 +0000367} // End llvm namespace
368
369#endif