| OLD | NEW |
| 1 //===- subzero/src/IceRegAlloc.h - Linear-scan reg. allocation --*- C++ -*-===// | 1 //===- subzero/src/IceRegAlloc.h - Linear-scan reg. allocation --*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 void init(RegAllocKind Kind); | 32 void init(RegAllocKind Kind); |
| 33 void scan(const llvm::SmallBitVector &RegMask, bool Randomized); | 33 void scan(const llvm::SmallBitVector &RegMask, bool Randomized); |
| 34 void dump(Cfg *Func) const; | 34 void dump(Cfg *Func) const; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 typedef std::vector<Variable *> OrderedRanges; | 37 typedef std::vector<Variable *> OrderedRanges; |
| 38 typedef std::vector<Variable *> UnorderedRanges; | 38 typedef std::vector<Variable *> UnorderedRanges; |
| 39 | 39 |
| 40 void initForGlobal(); | 40 void initForGlobal(); |
| 41 void initForInfOnly(); | 41 void initForInfOnly(); |
| 42 /// Free up a register for infinite-weight Cur by spilling and reloading some |
| 43 /// register that isn't used during Cur's live range. |
| 44 void addSpillFill(Variable *Cur, llvm::SmallBitVector RegMask); |
| 42 /// Move an item from the From set to the To set. From[Index] is | 45 /// Move an item from the From set to the To set. From[Index] is |
| 43 /// pushed onto the end of To[], then the item is efficiently removed | 46 /// pushed onto the end of To[], then the item is efficiently removed |
| 44 /// from From[] by effectively swapping it with the last item in | 47 /// from From[] by effectively swapping it with the last item in |
| 45 /// From[] and then popping it from the back. As such, the caller is | 48 /// From[] and then popping it from the back. As such, the caller is |
| 46 /// best off iterating over From[] in reverse order to avoid the need | 49 /// best off iterating over From[] in reverse order to avoid the need |
| 47 /// for special handling of the iterator. | 50 /// for special handling of the iterator. |
| 48 void moveItem(UnorderedRanges &From, SizeT Index, UnorderedRanges &To) { | 51 void moveItem(UnorderedRanges &From, SizeT Index, UnorderedRanges &To) { |
| 49 To.push_back(From[Index]); | 52 To.push_back(From[Index]); |
| 50 From[Index] = From.back(); | 53 From[Index] = From.back(); |
| 51 From.pop_back(); | 54 From.pop_back(); |
| 52 } | 55 } |
| 53 | 56 |
| 54 Cfg *const Func; | 57 Cfg *const Func; |
| 55 OrderedRanges Unhandled; | 58 OrderedRanges Unhandled; |
| 56 /// UnhandledPrecolored is a subset of Unhandled, specially collected | 59 /// UnhandledPrecolored is a subset of Unhandled, specially collected |
| 57 /// for faster processing. | 60 /// for faster processing. |
| 58 OrderedRanges UnhandledPrecolored; | 61 OrderedRanges UnhandledPrecolored; |
| 59 UnorderedRanges Active, Inactive, Handled; | 62 UnorderedRanges Active, Inactive, Handled; |
| 60 std::vector<InstNumberT> Kills; | 63 std::vector<InstNumberT> Kills; |
| 64 RegAllocKind Kind = RAK_Unknown; |
| 61 bool FindPreference = false; | 65 bool FindPreference = false; |
| 62 bool FindOverlap = false; | 66 bool FindOverlap = false; |
| 63 // TODO(stichnot): We're not really using FindOverlap yet, but we | 67 // TODO(stichnot): We're not really using FindOverlap yet, but we |
| 64 // may want a flavor of register allocation where FindPreference is | 68 // may want a flavor of register allocation where FindPreference is |
| 65 // useful but we didn't want to initialize VMetadata with VMK_All | 69 // useful but we didn't want to initialize VMetadata with VMK_All |
| 66 // and therefore we can't safely allow overlap. | 70 // and therefore we can't safely allow overlap. |
| 67 }; | 71 }; |
| 68 | 72 |
| 69 } // end of namespace Ice | 73 } // end of namespace Ice |
| 70 | 74 |
| 71 #endif // SUBZERO_SRC_ICEREGALLOC_H | 75 #endif // SUBZERO_SRC_ICEREGALLOC_H |
| OLD | NEW |