Chris Lattner | a3b8b5c | 2004-07-23 17:56:30 +0000 | [diff] [blame] | 1 | //===-- LiveIntervalAnalysis.h - Live Interval Analysis ---------*- C++ -*-===// |
Alkis Evlogimenos | ff0cbe1 | 2003-11-20 03:32:25 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 7ed47a1 | 2007-12-29 19:59:42 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Alkis Evlogimenos | ff0cbe1 | 2003-11-20 03:32:25 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Chris Lattner | 6b92906 | 2004-07-19 02:13:59 +0000 | [diff] [blame] | 10 | // 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 |
Dan Gohman | 8131a50 | 2008-03-13 23:04:27 +0000 | [diff] [blame] | 13 | // instruction with number j' > j such that v is live at j' and there is no |
Chris Lattner | 6b92906 | 2004-07-19 02:13:59 +0000 | [diff] [blame] | 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 Evlogimenos | ff0cbe1 | 2003-11-20 03:32:25 +0000 | [diff] [blame] | 17 | // |
| 18 | //===----------------------------------------------------------------------===// |
| 19 | |
Chris Lattner | a3b8b5c | 2004-07-23 17:56:30 +0000 | [diff] [blame] | 20 | #ifndef LLVM_CODEGEN_LIVEINTERVAL_ANALYSIS_H |
| 21 | #define LLVM_CODEGEN_LIVEINTERVAL_ANALYSIS_H |
Alkis Evlogimenos | ff0cbe1 | 2003-11-20 03:32:25 +0000 | [diff] [blame] | 22 | |
David Greene | de0cc5a | 2009-08-19 20:52:54 +0000 | [diff] [blame] | 23 | #include "llvm/CodeGen/MachineBasicBlock.h" |
Alkis Evlogimenos | ff0cbe1 | 2003-11-20 03:32:25 +0000 | [diff] [blame] | 24 | #include "llvm/CodeGen/MachineFunctionPass.h" |
Chris Lattner | 779a651 | 2005-09-21 04:18:25 +0000 | [diff] [blame] | 25 | #include "llvm/CodeGen/LiveInterval.h" |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 26 | #include "llvm/CodeGen/SlotIndexes.h" |
Evan Cheng | 61de82d | 2007-02-15 05:59:24 +0000 | [diff] [blame] | 27 | #include "llvm/ADT/BitVector.h" |
Evan Cheng | 20b0abc | 2007-04-17 20:32:26 +0000 | [diff] [blame] | 28 | #include "llvm/ADT/DenseMap.h" |
Evan Cheng | 8f90b6e | 2009-01-07 02:08:57 +0000 | [diff] [blame] | 29 | #include "llvm/ADT/SmallPtrSet.h" |
Evan Cheng | 549f27d3 | 2007-08-13 23:45:17 +0000 | [diff] [blame] | 30 | #include "llvm/ADT/SmallVector.h" |
Evan Cheng | f3bb2e6 | 2007-09-05 21:46:51 +0000 | [diff] [blame] | 31 | #include "llvm/Support/Allocator.h" |
Hartmut Kaiser | ffb15de | 2007-11-13 23:04:28 +0000 | [diff] [blame] | 32 | #include <cmath> |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 33 | #include <iterator> |
Alkis Evlogimenos | ff0cbe1 | 2003-11-20 03:32:25 +0000 | [diff] [blame] | 34 | |
| 35 | namespace llvm { |
| 36 | |
Dan Gohman | 6d69ba8 | 2008-07-25 00:02:30 +0000 | [diff] [blame] | 37 | class AliasAnalysis; |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 38 | class LiveVariables; |
Evan Cheng | 22f07ff | 2007-12-11 02:09:15 +0000 | [diff] [blame] | 39 | class MachineLoopInfo; |
Dan Gohman | 6f0d024 | 2008-02-10 18:45:23 +0000 | [diff] [blame] | 40 | class TargetRegisterInfo; |
Chris Lattner | 84bc542 | 2007-12-31 04:13:23 +0000 | [diff] [blame] | 41 | class MachineRegisterInfo; |
Chris Lattner | f768bba | 2005-03-09 23:05:19 +0000 | [diff] [blame] | 42 | class TargetInstrInfo; |
Evan Cheng | 20b0abc | 2007-04-17 20:32:26 +0000 | [diff] [blame] | 43 | class TargetRegisterClass; |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 44 | class VirtRegMap; |
Jakob Stoklund Olesen | 1b29320 | 2010-08-12 20:01:23 +0000 | [diff] [blame] | 45 | |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 46 | class LiveIntervals : public MachineFunctionPass { |
| 47 | MachineFunction* mf_; |
Evan Cheng | d70dbb5 | 2008-02-22 09:24:50 +0000 | [diff] [blame] | 48 | MachineRegisterInfo* mri_; |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 49 | const TargetMachine* tm_; |
Dan Gohman | 6f0d024 | 2008-02-10 18:45:23 +0000 | [diff] [blame] | 50 | const TargetRegisterInfo* tri_; |
Chris Lattner | f768bba | 2005-03-09 23:05:19 +0000 | [diff] [blame] | 51 | const TargetInstrInfo* tii_; |
Dan Gohman | 6d69ba8 | 2008-07-25 00:02:30 +0000 | [diff] [blame] | 52 | AliasAnalysis *aa_; |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 53 | LiveVariables* lv_; |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 54 | SlotIndexes* indexes_; |
Alkis Evlogimenos | ff0cbe1 | 2003-11-20 03:32:25 +0000 | [diff] [blame] | 55 | |
Evan Cheng | f3bb2e6 | 2007-09-05 21:46:51 +0000 | [diff] [blame] | 56 | /// Special pool allocator for VNInfo's (LiveInterval val#). |
| 57 | /// |
Benjamin Kramer | 991de14 | 2010-03-30 20:16:45 +0000 | [diff] [blame] | 58 | VNInfo::Allocator VNInfoAllocator; |
Evan Cheng | f3bb2e6 | 2007-09-05 21:46:51 +0000 | [diff] [blame] | 59 | |
Owen Anderson | 20e2839 | 2008-08-13 22:08:30 +0000 | [diff] [blame] | 60 | typedef DenseMap<unsigned, LiveInterval*> Reg2IntervalMap; |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 61 | Reg2IntervalMap r2iMap_; |
Alkis Evlogimenos | ff0cbe1 | 2003-11-20 03:32:25 +0000 | [diff] [blame] | 62 | |
Evan Cheng | 752195e | 2009-09-14 21:33:42 +0000 | [diff] [blame] | 63 | /// allocatableRegs_ - A bit vector of allocatable registers. |
Evan Cheng | 61de82d | 2007-02-15 05:59:24 +0000 | [diff] [blame] | 64 | BitVector allocatableRegs_; |
Evan Cheng | 88d1f58 | 2007-03-01 02:03:03 +0000 | [diff] [blame] | 65 | |
Evan Cheng | 752195e | 2009-09-14 21:33:42 +0000 | [diff] [blame] | 66 | /// CloneMIs - A list of clones as result of re-materialization. |
| 67 | std::vector<MachineInstr*> CloneMIs; |
Evan Cheng | 549f27d3 | 2007-08-13 23:45:17 +0000 | [diff] [blame] | 68 | |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 69 | public: |
Nick Lewycky | ecd94c8 | 2007-05-06 13:37:16 +0000 | [diff] [blame] | 70 | static char ID; // Pass identification, replacement for typeid |
Owen Anderson | 081c34b | 2010-10-19 17:21:58 +0000 | [diff] [blame] | 71 | LiveIntervals() : MachineFunctionPass(ID) { |
| 72 | initializeLiveIntervalsPass(*PassRegistry::getPassRegistry()); |
| 73 | } |
Devang Patel | 794fd75 | 2007-05-01 21:15:47 +0000 | [diff] [blame] | 74 | |
Jakob Stoklund Olesen | e5d9041 | 2010-03-01 20:59:38 +0000 | [diff] [blame] | 75 | // Calculate the spill weight to assign to a single instruction. |
| 76 | static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth); |
Evan Cheng | f2fbca6 | 2007-11-12 06:35:08 +0000 | [diff] [blame] | 77 | |
Jakob Stoklund Olesen | 352d352 | 2010-02-18 21:33:05 +0000 | [diff] [blame] | 78 | // After summing the spill weights of all defs and uses, the final weight |
| 79 | // should be normalized, dividing the weight of the interval by its size. |
| 80 | // This encourages spilling of intervals that are large and have few uses, |
| 81 | // and discourages spilling of small intervals with many uses. |
| 82 | void normalizeSpillWeight(LiveInterval &li) { |
| 83 | li.weight /= getApproximateInstructionCount(li) + 25; |
| 84 | } |
| 85 | |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 86 | typedef Reg2IntervalMap::iterator iterator; |
Chris Lattner | 70ca358 | 2004-09-30 15:59:17 +0000 | [diff] [blame] | 87 | typedef Reg2IntervalMap::const_iterator const_iterator; |
| 88 | const_iterator begin() const { return r2iMap_.begin(); } |
| 89 | const_iterator end() const { return r2iMap_.end(); } |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 90 | iterator begin() { return r2iMap_.begin(); } |
| 91 | iterator end() { return r2iMap_.end(); } |
Evan Cheng | 34cd4a4 | 2008-05-05 18:30:58 +0000 | [diff] [blame] | 92 | unsigned getNumIntervals() const { return (unsigned)r2iMap_.size(); } |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 93 | |
| 94 | LiveInterval &getInterval(unsigned reg) { |
| 95 | Reg2IntervalMap::iterator I = r2iMap_.find(reg); |
| 96 | assert(I != r2iMap_.end() && "Interval does not exist for register"); |
Owen Anderson | 03857b2 | 2008-08-13 21:49:13 +0000 | [diff] [blame] | 97 | return *I->second; |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | const LiveInterval &getInterval(unsigned reg) const { |
| 101 | Reg2IntervalMap::const_iterator I = r2iMap_.find(reg); |
| 102 | assert(I != r2iMap_.end() && "Interval does not exist for register"); |
Owen Anderson | 03857b2 | 2008-08-13 21:49:13 +0000 | [diff] [blame] | 103 | return *I->second; |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 104 | } |
| 105 | |
Evan Cheng | b371f45 | 2007-02-19 21:49:54 +0000 | [diff] [blame] | 106 | bool hasInterval(unsigned reg) const { |
Evan Cheng | 88d1f58 | 2007-03-01 02:03:03 +0000 | [diff] [blame] | 107 | return r2iMap_.count(reg); |
Evan Cheng | b371f45 | 2007-02-19 21:49:54 +0000 | [diff] [blame] | 108 | } |
| 109 | |
Jakob Stoklund Olesen | df30cf9 | 2010-08-10 00:02:26 +0000 | [diff] [blame] | 110 | /// isAllocatable - is the physical register reg allocatable in the current |
| 111 | /// function? |
| 112 | bool isAllocatable(unsigned reg) const { |
| 113 | return allocatableRegs_.test(reg); |
| 114 | } |
| 115 | |
Owen Anderson | a1566f2 | 2008-07-22 22:46:49 +0000 | [diff] [blame] | 116 | /// getScaledIntervalSize - get the size of an interval in "units," |
Owen Anderson | 72e0409 | 2008-06-23 23:25:37 +0000 | [diff] [blame] | 117 | /// where every function is composed of one thousand units. This |
| 118 | /// measure scales properly with empty index slots in the function. |
Owen Anderson | a1566f2 | 2008-07-22 22:46:49 +0000 | [diff] [blame] | 119 | double getScaledIntervalSize(LiveInterval& I) { |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 120 | return (1000.0 * I.getSize()) / indexes_->getIndexesLength(); |
Owen Anderson | a1566f2 | 2008-07-22 22:46:49 +0000 | [diff] [blame] | 121 | } |
Evan Cheng | 30fdb5c | 2010-04-21 00:44:22 +0000 | [diff] [blame] | 122 | |
| 123 | /// getFuncInstructionCount - Return the number of instructions in the |
| 124 | /// current function. |
| 125 | unsigned getFuncInstructionCount() { |
| 126 | return indexes_->getFunctionSize(); |
| 127 | } |
Jakob Stoklund Olesen | 1b29320 | 2010-08-12 20:01:23 +0000 | [diff] [blame] | 128 | |
Owen Anderson | a1566f2 | 2008-07-22 22:46:49 +0000 | [diff] [blame] | 129 | /// getApproximateInstructionCount - computes an estimate of the number |
| 130 | /// of instructions in a given LiveInterval. |
| 131 | unsigned getApproximateInstructionCount(LiveInterval& I) { |
| 132 | double IntervalPercentage = getScaledIntervalSize(I) / 1000.0; |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 133 | return (unsigned)(IntervalPercentage * indexes_->getFunctionSize()); |
Evan Cheng | f5cd4f0 | 2008-10-23 20:43:13 +0000 | [diff] [blame] | 134 | } |
| 135 | |
Jakob Stoklund Olesen | cf97036 | 2009-12-10 17:48:32 +0000 | [diff] [blame] | 136 | /// conflictsWithPhysReg - Returns true if the specified register is used or |
| 137 | /// defined during the duration of the specified interval. Copies to and |
| 138 | /// from li.reg are allowed. This method is only able to analyze simple |
| 139 | /// ranges that stay within a single basic block. Anything else is |
| 140 | /// considered a conflict. |
| 141 | bool conflictsWithPhysReg(const LiveInterval &li, VirtRegMap &vrm, |
| 142 | unsigned reg); |
Evan Cheng | c92da38 | 2007-11-03 07:20:12 +0000 | [diff] [blame] | 143 | |
Jakob Stoklund Olesen | a24986d | 2010-06-24 18:15:01 +0000 | [diff] [blame] | 144 | /// conflictsWithAliasRef - Similar to conflictsWithPhysRegRef except |
| 145 | /// it checks for alias uses and defs. |
| 146 | bool conflictsWithAliasRef(LiveInterval &li, unsigned Reg, |
Evan Cheng | 826cbac | 2010-03-11 08:20:21 +0000 | [diff] [blame] | 147 | SmallPtrSet<MachineInstr*,32> &JoinedCopies); |
Evan Cheng | 8f90b6e | 2009-01-07 02:08:57 +0000 | [diff] [blame] | 148 | |
David Greene | 2513330 | 2007-06-08 17:18:56 +0000 | [diff] [blame] | 149 | // Interval creation |
David Greene | 2513330 | 2007-06-08 17:18:56 +0000 | [diff] [blame] | 150 | LiveInterval &getOrCreateInterval(unsigned reg) { |
| 151 | Reg2IntervalMap::iterator I = r2iMap_.find(reg); |
| 152 | if (I == r2iMap_.end()) |
Owen Anderson | 20e2839 | 2008-08-13 22:08:30 +0000 | [diff] [blame] | 153 | I = r2iMap_.insert(std::make_pair(reg, createInterval(reg))).first; |
Owen Anderson | 03857b2 | 2008-08-13 21:49:13 +0000 | [diff] [blame] | 154 | return *I->second; |
David Greene | 2513330 | 2007-06-08 17:18:56 +0000 | [diff] [blame] | 155 | } |
Evan Cheng | 0a1fcce | 2009-02-08 11:04:35 +0000 | [diff] [blame] | 156 | |
| 157 | /// dupInterval - Duplicate a live interval. The caller is responsible for |
| 158 | /// managing the allocated memory. |
| 159 | LiveInterval *dupInterval(LiveInterval *li); |
Jakob Stoklund Olesen | 1b29320 | 2010-08-12 20:01:23 +0000 | [diff] [blame] | 160 | |
Owen Anderson | c4dc132 | 2008-06-05 17:15:43 +0000 | [diff] [blame] | 161 | /// addLiveRangeToEndOfBlock - Given a register and an instruction, |
| 162 | /// adds a live range from that instruction to the end of its MBB. |
| 163 | LiveRange addLiveRangeToEndOfBlock(unsigned reg, |
Lang Hames | 8651125 | 2009-09-04 20:41:11 +0000 | [diff] [blame] | 164 | MachineInstr* startInst); |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 165 | |
David Greene | 2513330 | 2007-06-08 17:18:56 +0000 | [diff] [blame] | 166 | // Interval removal |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 167 | |
David Greene | 2513330 | 2007-06-08 17:18:56 +0000 | [diff] [blame] | 168 | void removeInterval(unsigned Reg) { |
Owen Anderson | 20e2839 | 2008-08-13 22:08:30 +0000 | [diff] [blame] | 169 | DenseMap<unsigned, LiveInterval*>::iterator I = r2iMap_.find(Reg); |
Owen Anderson | 03857b2 | 2008-08-13 21:49:13 +0000 | [diff] [blame] | 170 | delete I->second; |
| 171 | r2iMap_.erase(I); |
Bill Wendling | 5c7e326 | 2006-12-17 05:15:13 +0000 | [diff] [blame] | 172 | } |
Chris Lattner | 70ca358 | 2004-09-30 15:59:17 +0000 | [diff] [blame] | 173 | |
Jakob Stoklund Olesen | 7fd747b | 2011-01-12 22:28:48 +0000 | [diff] [blame^] | 174 | SlotIndexes *getSlotIndexes() const { |
| 175 | return indexes_; |
| 176 | } |
| 177 | |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 178 | SlotIndex getZeroIndex() const { |
| 179 | return indexes_->getZeroIndex(); |
| 180 | } |
| 181 | |
| 182 | SlotIndex getInvalidIndex() const { |
| 183 | return indexes_->getInvalidIndex(); |
| 184 | } |
| 185 | |
Evan Cheng | 5b69eba | 2009-04-21 22:46:52 +0000 | [diff] [blame] | 186 | /// isNotInMIMap - returns true if the specified machine instr has been |
| 187 | /// removed or was never entered in the map. |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 188 | bool isNotInMIMap(const MachineInstr* Instr) const { |
| 189 | return !indexes_->hasIndex(Instr); |
Evan Cheng | 30cac02 | 2007-02-22 23:03:39 +0000 | [diff] [blame] | 190 | } |
| 191 | |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 192 | /// Returns the base index of the given instruction. |
| 193 | SlotIndex getInstructionIndex(const MachineInstr *instr) const { |
| 194 | return indexes_->getInstructionIndex(instr); |
| 195 | } |
Jakob Stoklund Olesen | 1b29320 | 2010-08-12 20:01:23 +0000 | [diff] [blame] | 196 | |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 197 | /// Returns the instruction associated with the given index. |
| 198 | MachineInstr* getInstructionFromIndex(SlotIndex index) const { |
| 199 | return indexes_->getInstructionFromIndex(index); |
| 200 | } |
| 201 | |
| 202 | /// Return the first index in the given basic block. |
| 203 | SlotIndex getMBBStartIdx(const MachineBasicBlock *mbb) const { |
| 204 | return indexes_->getMBBStartIdx(mbb); |
Jakob Stoklund Olesen | 1b29320 | 2010-08-12 20:01:23 +0000 | [diff] [blame] | 205 | } |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 206 | |
| 207 | /// Return the last index in the given basic block. |
| 208 | SlotIndex getMBBEndIdx(const MachineBasicBlock *mbb) const { |
| 209 | return indexes_->getMBBEndIdx(mbb); |
Jakob Stoklund Olesen | 1b29320 | 2010-08-12 20:01:23 +0000 | [diff] [blame] | 210 | } |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 211 | |
Lang Hames | 60f422f | 2010-07-17 07:34:01 +0000 | [diff] [blame] | 212 | bool isLiveInToMBB(const LiveInterval &li, |
| 213 | const MachineBasicBlock *mbb) const { |
| 214 | return li.liveAt(getMBBStartIdx(mbb)); |
| 215 | } |
| 216 | |
| 217 | LiveRange* findEnteringRange(LiveInterval &li, |
| 218 | const MachineBasicBlock *mbb) { |
| 219 | return li.getLiveRangeContaining(getMBBStartIdx(mbb)); |
| 220 | } |
| 221 | |
| 222 | bool isLiveOutOfMBB(const LiveInterval &li, |
| 223 | const MachineBasicBlock *mbb) const { |
| 224 | return li.liveAt(getMBBEndIdx(mbb).getPrevSlot()); |
| 225 | } |
| 226 | |
| 227 | LiveRange* findExitingRange(LiveInterval &li, |
| 228 | const MachineBasicBlock *mbb) { |
| 229 | return li.getLiveRangeContaining(getMBBEndIdx(mbb).getPrevSlot()); |
| 230 | } |
| 231 | |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 232 | MachineBasicBlock* getMBBFromIndex(SlotIndex index) const { |
| 233 | return indexes_->getMBBFromIndex(index); |
| 234 | } |
| 235 | |
Lang Hames | b366158 | 2009-11-14 00:02:51 +0000 | [diff] [blame] | 236 | SlotIndex InsertMachineInstrInMaps(MachineInstr *MI) { |
| 237 | return indexes_->insertMachineInstrInMaps(MI); |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 238 | } |
| 239 | |
Chris Lattner | f7da2c7 | 2006-08-24 22:43:55 +0000 | [diff] [blame] | 240 | void RemoveMachineInstrFromMaps(MachineInstr *MI) { |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 241 | indexes_->removeMachineInstrFromMaps(MI); |
Chris Lattner | f7da2c7 | 2006-08-24 22:43:55 +0000 | [diff] [blame] | 242 | } |
David Greene | 2513330 | 2007-06-08 17:18:56 +0000 | [diff] [blame] | 243 | |
Evan Cheng | 7007143 | 2008-02-13 03:01:43 +0000 | [diff] [blame] | 244 | void ReplaceMachineInstrInMaps(MachineInstr *MI, MachineInstr *NewMI) { |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 245 | indexes_->replaceMachineInstrInMaps(MI, NewMI); |
| 246 | } |
| 247 | |
Lang Hames | 60f422f | 2010-07-17 07:34:01 +0000 | [diff] [blame] | 248 | void InsertMBBInMaps(MachineBasicBlock *MBB) { |
| 249 | indexes_->insertMBBInMaps(MBB); |
| 250 | } |
| 251 | |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 252 | bool findLiveInMBBs(SlotIndex Start, SlotIndex End, |
| 253 | SmallVectorImpl<MachineBasicBlock*> &MBBs) const { |
| 254 | return indexes_->findLiveInMBBs(Start, End, MBBs); |
| 255 | } |
| 256 | |
| 257 | void renumber() { |
Lang Hames | b366158 | 2009-11-14 00:02:51 +0000 | [diff] [blame] | 258 | indexes_->renumberIndexes(); |
Evan Cheng | 7007143 | 2008-02-13 03:01:43 +0000 | [diff] [blame] | 259 | } |
| 260 | |
Benjamin Kramer | 991de14 | 2010-03-30 20:16:45 +0000 | [diff] [blame] | 261 | VNInfo::Allocator& getVNInfoAllocator() { return VNInfoAllocator; } |
Evan Cheng | f3bb2e6 | 2007-09-05 21:46:51 +0000 | [diff] [blame] | 262 | |
David Greene | 2513330 | 2007-06-08 17:18:56 +0000 | [diff] [blame] | 263 | virtual void getAnalysisUsage(AnalysisUsage &AU) const; |
| 264 | virtual void releaseMemory(); |
| 265 | |
| 266 | /// runOnMachineFunction - pass entry point |
| 267 | virtual bool runOnMachineFunction(MachineFunction&); |
| 268 | |
| 269 | /// print - Implement the dump method. |
Chris Lattner | 45cfe54 | 2009-08-23 06:03:38 +0000 | [diff] [blame] | 270 | virtual void print(raw_ostream &O, const Module* = 0) const; |
David Greene | 2513330 | 2007-06-08 17:18:56 +0000 | [diff] [blame] | 271 | |
Evan Cheng | f2fbca6 | 2007-11-12 06:35:08 +0000 | [diff] [blame] | 272 | /// addIntervalsForSpills - Create new intervals for spilled defs / uses of |
Evan Cheng | 9c3c221 | 2008-06-06 07:54:39 +0000 | [diff] [blame] | 273 | /// the given interval. FIXME: It also returns the weight of the spill slot |
| 274 | /// (if any is created) by reference. This is temporary. |
Evan Cheng | f2fbca6 | 2007-11-12 06:35:08 +0000 | [diff] [blame] | 275 | std::vector<LiveInterval*> |
Evan Cheng | 81a0382 | 2007-11-17 00:40:40 +0000 | [diff] [blame] | 276 | addIntervalsForSpills(const LiveInterval& i, |
Andrew Trick | f4baeaf | 2010-11-10 19:18:47 +0000 | [diff] [blame] | 277 | const SmallVectorImpl<LiveInterval*> &SpillIs, |
Evan Cheng | c781a24 | 2009-05-03 18:32:42 +0000 | [diff] [blame] | 278 | const MachineLoopInfo *loopInfo, VirtRegMap& vrm); |
Evan Cheng | f2fbca6 | 2007-11-12 06:35:08 +0000 | [diff] [blame] | 279 | |
Evan Cheng | 676dd7c | 2008-03-11 07:19:34 +0000 | [diff] [blame] | 280 | /// spillPhysRegAroundRegDefsUses - Spill the specified physical register |
Evan Cheng | 2824a65 | 2009-03-23 18:24:37 +0000 | [diff] [blame] | 281 | /// around all defs and uses of the specified interval. Return true if it |
| 282 | /// was able to cut its interval. |
| 283 | bool spillPhysRegAroundRegDefsUses(const LiveInterval &li, |
Evan Cheng | 676dd7c | 2008-03-11 07:19:34 +0000 | [diff] [blame] | 284 | unsigned PhysReg, VirtRegMap &vrm); |
| 285 | |
Evan Cheng | 5ef3a04 | 2007-12-06 00:01:56 +0000 | [diff] [blame] | 286 | /// isReMaterializable - Returns true if every definition of MI of every |
| 287 | /// val# of the specified interval is re-materializable. Also returns true |
| 288 | /// by reference if all of the defs are load instructions. |
Evan Cheng | dc37786 | 2008-09-30 15:44:16 +0000 | [diff] [blame] | 289 | bool isReMaterializable(const LiveInterval &li, |
Andrew Trick | f4baeaf | 2010-11-10 19:18:47 +0000 | [diff] [blame] | 290 | const SmallVectorImpl<LiveInterval*> &SpillIs, |
Evan Cheng | dc37786 | 2008-09-30 15:44:16 +0000 | [diff] [blame] | 291 | bool &isLoad); |
Evan Cheng | 5ef3a04 | 2007-12-06 00:01:56 +0000 | [diff] [blame] | 292 | |
Evan Cheng | 0658749 | 2008-10-24 02:05:00 +0000 | [diff] [blame] | 293 | /// isReMaterializable - Returns true if the definition MI of the specified |
| 294 | /// val# of the specified interval is re-materializable. |
| 295 | bool isReMaterializable(const LiveInterval &li, const VNInfo *ValNo, |
| 296 | MachineInstr *MI); |
| 297 | |
Evan Cheng | 676dd7c | 2008-03-11 07:19:34 +0000 | [diff] [blame] | 298 | /// getRepresentativeReg - Find the largest super register of the specified |
| 299 | /// physical register. |
| 300 | unsigned getRepresentativeReg(unsigned Reg) const; |
| 301 | |
| 302 | /// getNumConflictsWithPhysReg - Return the number of uses and defs of the |
| 303 | /// specified interval that conflicts with the specified physical register. |
| 304 | unsigned getNumConflictsWithPhysReg(const LiveInterval &li, |
| 305 | unsigned PhysReg) const; |
| 306 | |
Owen Anderson | 0c2e7b9 | 2009-01-13 06:05:10 +0000 | [diff] [blame] | 307 | /// intervalIsInOneMBB - Returns true if the specified interval is entirely |
| 308 | /// within a single basic block. |
| 309 | bool intervalIsInOneMBB(const LiveInterval &li) const; |
| 310 | |
Jakob Stoklund Olesen | 1b29320 | 2010-08-12 20:01:23 +0000 | [diff] [blame] | 311 | private: |
Chris Lattner | 428b92e | 2006-09-15 03:57:23 +0000 | [diff] [blame] | 312 | /// computeIntervals - Compute live intervals. |
Chris Lattner | c7695eb | 2006-09-14 06:42:17 +0000 | [diff] [blame] | 313 | void computeIntervals(); |
Evan Cheng | 752195e | 2009-09-14 21:33:42 +0000 | [diff] [blame] | 314 | |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 315 | /// handleRegisterDef - update intervals for a register def |
| 316 | /// (calls handlePhysicalRegisterDef and |
| 317 | /// handleVirtualRegisterDef) |
Chris Lattner | 6b128bd | 2006-09-03 08:07:11 +0000 | [diff] [blame] | 318 | void handleRegisterDef(MachineBasicBlock *MBB, |
Lang Hames | 8651125 | 2009-09-04 20:41:11 +0000 | [diff] [blame] | 319 | MachineBasicBlock::iterator MI, |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 320 | SlotIndex MIIdx, |
Evan Cheng | ef0732d | 2008-07-10 07:35:43 +0000 | [diff] [blame] | 321 | MachineOperand& MO, unsigned MOIdx); |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 322 | |
Evan Cheng | 3749943 | 2010-05-05 18:27:40 +0000 | [diff] [blame] | 323 | /// isPartialRedef - Return true if the specified def at the specific index |
| 324 | /// is partially re-defining the specified live interval. A common case of |
Jakob Stoklund Olesen | 1b29320 | 2010-08-12 20:01:23 +0000 | [diff] [blame] | 325 | /// this is a definition of the sub-register. |
Evan Cheng | 3749943 | 2010-05-05 18:27:40 +0000 | [diff] [blame] | 326 | bool isPartialRedef(SlotIndex MIIdx, MachineOperand &MO, |
| 327 | LiveInterval &interval); |
| 328 | |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 329 | /// handleVirtualRegisterDef - update intervals for a virtual |
| 330 | /// register def |
Chris Lattner | 6b128bd | 2006-09-03 08:07:11 +0000 | [diff] [blame] | 331 | void handleVirtualRegisterDef(MachineBasicBlock *MBB, |
| 332 | MachineBasicBlock::iterator MI, |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 333 | SlotIndex MIIdx, MachineOperand& MO, |
Lang Hames | 8651125 | 2009-09-04 20:41:11 +0000 | [diff] [blame] | 334 | unsigned MOIdx, |
| 335 | LiveInterval& interval); |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 336 | |
Chris Lattner | f768bba | 2005-03-09 23:05:19 +0000 | [diff] [blame] | 337 | /// handlePhysicalRegisterDef - update intervals for a physical register |
Chris Lattner | f7da2c7 | 2006-08-24 22:43:55 +0000 | [diff] [blame] | 338 | /// def. |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 339 | void handlePhysicalRegisterDef(MachineBasicBlock* mbb, |
| 340 | MachineBasicBlock::iterator mi, |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 341 | SlotIndex MIIdx, MachineOperand& MO, |
Chris Lattner | 91725b7 | 2006-08-31 05:54:43 +0000 | [diff] [blame] | 342 | LiveInterval &interval, |
Evan Cheng | c8d044e | 2008-02-15 18:24:29 +0000 | [diff] [blame] | 343 | MachineInstr *CopyMI); |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 344 | |
Evan Cheng | b371f45 | 2007-02-19 21:49:54 +0000 | [diff] [blame] | 345 | /// handleLiveInRegister - Create interval for a livein register. |
Jim Laskey | 9b25b8c | 2007-02-21 22:41:17 +0000 | [diff] [blame] | 346 | void handleLiveInRegister(MachineBasicBlock* mbb, |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 347 | SlotIndex MIIdx, |
Evan Cheng | 24a3cc4 | 2007-04-25 07:30:23 +0000 | [diff] [blame] | 348 | LiveInterval &interval, bool isAlias = false); |
Evan Cheng | b371f45 | 2007-02-19 21:49:54 +0000 | [diff] [blame] | 349 | |
Evan Cheng | d70dbb5 | 2008-02-22 09:24:50 +0000 | [diff] [blame] | 350 | /// getReMatImplicitUse - If the remat definition MI has one (for now, we |
| 351 | /// only allow one) virtual register operand, then its uses are implicitly |
| 352 | /// using the register. Returns the virtual register. |
| 353 | unsigned getReMatImplicitUse(const LiveInterval &li, |
| 354 | MachineInstr *MI) const; |
| 355 | |
| 356 | /// isValNoAvailableAt - Return true if the val# of the specified interval |
| 357 | /// which reaches the given instruction also reaches the specified use |
| 358 | /// index. |
| 359 | bool isValNoAvailableAt(const LiveInterval &li, MachineInstr *MI, |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 360 | SlotIndex UseIdx) const; |
Evan Cheng | d70dbb5 | 2008-02-22 09:24:50 +0000 | [diff] [blame] | 361 | |
Evan Cheng | 549f27d3 | 2007-08-13 23:45:17 +0000 | [diff] [blame] | 362 | /// isReMaterializable - Returns true if the definition MI of the specified |
Evan Cheng | 5ef3a04 | 2007-12-06 00:01:56 +0000 | [diff] [blame] | 363 | /// val# of the specified interval is re-materializable. Also returns true |
| 364 | /// by reference if the def is a load. |
Evan Cheng | 7ecb38b | 2007-08-29 20:45:00 +0000 | [diff] [blame] | 365 | bool isReMaterializable(const LiveInterval &li, const VNInfo *ValNo, |
Evan Cheng | dc37786 | 2008-09-30 15:44:16 +0000 | [diff] [blame] | 366 | MachineInstr *MI, |
Andrew Trick | f4baeaf | 2010-11-10 19:18:47 +0000 | [diff] [blame] | 367 | const SmallVectorImpl<LiveInterval*> &SpillIs, |
Evan Cheng | dc37786 | 2008-09-30 15:44:16 +0000 | [diff] [blame] | 368 | bool &isLoad); |
Evan Cheng | 549f27d3 | 2007-08-13 23:45:17 +0000 | [diff] [blame] | 369 | |
Evan Cheng | 35b35c5 | 2007-08-30 05:52:20 +0000 | [diff] [blame] | 370 | /// tryFoldMemoryOperand - Attempts to fold either a spill / restore from |
| 371 | /// slot / to reg or any rematerialized load into ith operand of specified |
| 372 | /// MI. If it is successul, MI is updated with the newly created MI and |
| 373 | /// returns true. |
| 374 | bool tryFoldMemoryOperand(MachineInstr* &MI, VirtRegMap &vrm, |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 375 | MachineInstr *DefMI, SlotIndex InstrIdx, |
Evan Cheng | aee4af6 | 2007-12-02 08:30:39 +0000 | [diff] [blame] | 376 | SmallVector<unsigned, 2> &Ops, |
Lang Hames | 8651125 | 2009-09-04 20:41:11 +0000 | [diff] [blame] | 377 | bool isSS, int FrameIndex, unsigned Reg); |
Evan Cheng | 549f27d3 | 2007-08-13 23:45:17 +0000 | [diff] [blame] | 378 | |
Evan Cheng | d70dbb5 | 2008-02-22 09:24:50 +0000 | [diff] [blame] | 379 | /// canFoldMemoryOperand - Return true if the specified load / store |
Evan Cheng | 018f9b0 | 2007-12-05 03:22:34 +0000 | [diff] [blame] | 380 | /// folding is possible. |
Evan Cheng | d64b5c8 | 2007-12-05 03:14:33 +0000 | [diff] [blame] | 381 | bool canFoldMemoryOperand(MachineInstr *MI, |
Evan Cheng | 79a0c1e | 2008-02-25 08:50:41 +0000 | [diff] [blame] | 382 | SmallVector<unsigned, 2> &Ops, |
| 383 | bool ReMatLoadSS) const; |
Evan Cheng | d64b5c8 | 2007-12-05 03:14:33 +0000 | [diff] [blame] | 384 | |
Evan Cheng | 0cbb116 | 2007-11-29 01:06:25 +0000 | [diff] [blame] | 385 | /// anyKillInMBBAfterIdx - Returns true if there is a kill of the specified |
| 386 | /// VNInfo that's after the specified index but is within the basic block. |
| 387 | bool anyKillInMBBAfterIdx(const LiveInterval &li, const VNInfo *VNI, |
Lang Hames | 8651125 | 2009-09-04 20:41:11 +0000 | [diff] [blame] | 388 | MachineBasicBlock *MBB, |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 389 | SlotIndex Idx) const; |
Evan Cheng | 81a0382 | 2007-11-17 00:40:40 +0000 | [diff] [blame] | 390 | |
Evan Cheng | 676dd7c | 2008-03-11 07:19:34 +0000 | [diff] [blame] | 391 | /// hasAllocatableSuperReg - Return true if the specified physical register |
| 392 | /// has any super register that's allocatable. |
| 393 | bool hasAllocatableSuperReg(unsigned Reg) const; |
| 394 | |
Evan Cheng | 1953d0c | 2007-11-29 10:12:14 +0000 | [diff] [blame] | 395 | /// SRInfo - Spill / restore info. |
| 396 | struct SRInfo { |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 397 | SlotIndex index; |
Evan Cheng | 1953d0c | 2007-11-29 10:12:14 +0000 | [diff] [blame] | 398 | unsigned vreg; |
| 399 | bool canFold; |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 400 | SRInfo(SlotIndex i, unsigned vr, bool f) |
Lang Hames | 8651125 | 2009-09-04 20:41:11 +0000 | [diff] [blame] | 401 | : index(i), vreg(vr), canFold(f) {} |
Evan Cheng | 1953d0c | 2007-11-29 10:12:14 +0000 | [diff] [blame] | 402 | }; |
| 403 | |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 404 | bool alsoFoldARestore(int Id, SlotIndex index, unsigned vr, |
Evan Cheng | 1953d0c | 2007-11-29 10:12:14 +0000 | [diff] [blame] | 405 | BitVector &RestoreMBBs, |
Owen Anderson | 2899831 | 2008-08-13 22:28:50 +0000 | [diff] [blame] | 406 | DenseMap<unsigned,std::vector<SRInfo> >&RestoreIdxes); |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 407 | void eraseRestoreInfo(int Id, SlotIndex index, unsigned vr, |
Evan Cheng | 1953d0c | 2007-11-29 10:12:14 +0000 | [diff] [blame] | 408 | BitVector &RestoreMBBs, |
Owen Anderson | 2899831 | 2008-08-13 22:28:50 +0000 | [diff] [blame] | 409 | DenseMap<unsigned,std::vector<SRInfo> >&RestoreIdxes); |
Evan Cheng | 1953d0c | 2007-11-29 10:12:14 +0000 | [diff] [blame] | 410 | |
Evan Cheng | 4cce6b4 | 2008-04-11 17:53:36 +0000 | [diff] [blame] | 411 | /// handleSpilledImpDefs - Remove IMPLICIT_DEF instructions which are being |
| 412 | /// spilled and create empty intervals for their uses. |
| 413 | void handleSpilledImpDefs(const LiveInterval &li, VirtRegMap &vrm, |
| 414 | const TargetRegisterClass* rc, |
| 415 | std::vector<LiveInterval*> &NewLIs); |
Evan Cheng | 419852c | 2008-04-03 16:39:43 +0000 | [diff] [blame] | 416 | |
Evan Cheng | d70dbb5 | 2008-02-22 09:24:50 +0000 | [diff] [blame] | 417 | /// rewriteImplicitOps - Rewrite implicit use operands of MI (i.e. uses of |
| 418 | /// interval on to-be re-materialized operands of MI) with new register. |
| 419 | void rewriteImplicitOps(const LiveInterval &li, |
| 420 | MachineInstr *MI, unsigned NewVReg, VirtRegMap &vrm); |
| 421 | |
Chris Lattner | 84bc542 | 2007-12-31 04:13:23 +0000 | [diff] [blame] | 422 | /// rewriteInstructionForSpills, rewriteInstructionsForSpills - Helper |
| 423 | /// functions for addIntervalsForSpills to rewrite uses / defs for the given |
| 424 | /// live range. |
Evan Cheng | d70dbb5 | 2008-02-22 09:24:50 +0000 | [diff] [blame] | 425 | bool rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI, |
Lang Hames | 233a60e | 2009-11-03 23:52:08 +0000 | [diff] [blame] | 426 | bool TrySplit, SlotIndex index, SlotIndex end, |
Lang Hames | 8651125 | 2009-09-04 20:41:11 +0000 | [diff] [blame] | 427 | MachineInstr *MI, MachineInstr *OrigDefMI, MachineInstr *DefMI, |
| 428 | unsigned Slot, int LdSlot, |
Evan Cheng | f2fbca6 | 2007-11-12 06:35:08 +0000 | [diff] [blame] | 429 | bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete, |
Evan Cheng | d70dbb5 | 2008-02-22 09:24:50 +0000 | [diff] [blame] | 430 | VirtRegMap &vrm, const TargetRegisterClass* rc, |
| 431 | SmallVector<int, 4> &ReMatIds, const MachineLoopInfo *loopInfo, |
Evan Cheng | 0cc83b6 | 2008-02-23 00:46:11 +0000 | [diff] [blame] | 432 | unsigned &NewVReg, unsigned ImpUse, bool &HasDef, bool &HasUse, |
Owen Anderson | 2899831 | 2008-08-13 22:28:50 +0000 | [diff] [blame] | 433 | DenseMap<unsigned,unsigned> &MBBVRegsMap, |
Evan Cheng | c781a24 | 2009-05-03 18:32:42 +0000 | [diff] [blame] | 434 | std::vector<LiveInterval*> &NewLIs); |
Evan Cheng | 81a0382 | 2007-11-17 00:40:40 +0000 | [diff] [blame] | 435 | void rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit, |
Evan Cheng | f2fbca6 | 2007-11-12 06:35:08 +0000 | [diff] [blame] | 436 | LiveInterval::Ranges::const_iterator &I, |
| 437 | MachineInstr *OrigDefMI, MachineInstr *DefMI, unsigned Slot, int LdSlot, |
| 438 | bool isLoad, bool isLoadSS, bool DefIsReMat, bool CanDelete, |
Evan Cheng | d70dbb5 | 2008-02-22 09:24:50 +0000 | [diff] [blame] | 439 | VirtRegMap &vrm, const TargetRegisterClass* rc, |
Evan Cheng | 22f07ff | 2007-12-11 02:09:15 +0000 | [diff] [blame] | 440 | SmallVector<int, 4> &ReMatIds, const MachineLoopInfo *loopInfo, |
Evan Cheng | 81a0382 | 2007-11-17 00:40:40 +0000 | [diff] [blame] | 441 | BitVector &SpillMBBs, |
Owen Anderson | 2899831 | 2008-08-13 22:28:50 +0000 | [diff] [blame] | 442 | DenseMap<unsigned,std::vector<SRInfo> > &SpillIdxes, |
Evan Cheng | 0cbb116 | 2007-11-29 01:06:25 +0000 | [diff] [blame] | 443 | BitVector &RestoreMBBs, |
Owen Anderson | 2899831 | 2008-08-13 22:28:50 +0000 | [diff] [blame] | 444 | DenseMap<unsigned,std::vector<SRInfo> > &RestoreIdxes, |
| 445 | DenseMap<unsigned,unsigned> &MBBVRegsMap, |
Evan Cheng | c781a24 | 2009-05-03 18:32:42 +0000 | [diff] [blame] | 446 | std::vector<LiveInterval*> &NewLIs); |
Evan Cheng | f2fbca6 | 2007-11-12 06:35:08 +0000 | [diff] [blame] | 447 | |
Jakob Stoklund Olesen | 352d352 | 2010-02-18 21:33:05 +0000 | [diff] [blame] | 448 | // Normalize the spill weight of all the intervals in NewLIs. |
| 449 | void normalizeSpillWeights(std::vector<LiveInterval*> &NewLIs); |
| 450 | |
Owen Anderson | 03857b2 | 2008-08-13 21:49:13 +0000 | [diff] [blame] | 451 | static LiveInterval* createInterval(unsigned Reg); |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 452 | |
Evan Cheng | 752195e | 2009-09-14 21:33:42 +0000 | [diff] [blame] | 453 | void printInstrs(raw_ostream &O) const; |
| 454 | void dumpInstrs() const; |
Alkis Evlogimenos | 1a8ea01 | 2004-08-04 09:46:26 +0000 | [diff] [blame] | 455 | }; |
Alkis Evlogimenos | ff0cbe1 | 2003-11-20 03:32:25 +0000 | [diff] [blame] | 456 | } // End llvm namespace |
| 457 | |
| 458 | #endif |