| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 IterationState(const IterationState &) = delete; | 54 IterationState(const IterationState &) = delete; |
| 55 IterationState operator=(const IterationState &) = delete; | 55 IterationState operator=(const IterationState &) = delete; |
| 56 | 56 |
| 57 public: | 57 public: |
| 58 IterationState() = default; | 58 IterationState() = default; |
| 59 Variable *Cur = nullptr; | 59 Variable *Cur = nullptr; |
| 60 Variable *Prefer = nullptr; | 60 Variable *Prefer = nullptr; |
| 61 int32_t PreferReg = Variable::NoRegister; | 61 int32_t PreferReg = Variable::NoRegister; |
| 62 bool AllowOverlap = false; | 62 bool AllowOverlap = false; |
| 63 llvm::SmallBitVector RegMask; | 63 llvm::SmallBitVector RegMask; |
| 64 llvm::SmallBitVector RegMaskUnfiltered; |
| 64 llvm::SmallBitVector Free; | 65 llvm::SmallBitVector Free; |
| 66 llvm::SmallBitVector FreeUnfiltered; |
| 65 llvm::SmallBitVector PrecoloredUnhandledMask; // Note: only used for dumping | 67 llvm::SmallBitVector PrecoloredUnhandledMask; // Note: only used for dumping |
| 66 llvm::SmallVector<RegWeight, REGS_SIZE> Weights; | 68 llvm::SmallVector<RegWeight, REGS_SIZE> Weights; |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 bool livenessValidateIntervals(const DefUseErrorList &DefsWithoutUses, | 71 bool livenessValidateIntervals(const DefUseErrorList &DefsWithoutUses, |
| 70 const DefUseErrorList &UsesBeforeDefs, | 72 const DefUseErrorList &UsesBeforeDefs, |
| 71 const CfgVector<InstNumberT> &LRBegin, | 73 const CfgVector<InstNumberT> &LRBegin, |
| 72 const CfgVector<InstNumberT> &LREnd) const; | 74 const CfgVector<InstNumberT> &LREnd) const; |
| 73 void initForGlobal(); | 75 void initForGlobal(); |
| 74 void initForInfOnly(); | 76 void initForInfOnly(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 91 void addSpillFill(IterationState &Iter); | 93 void addSpillFill(IterationState &Iter); |
| 92 /// Check for active ranges that have expired or become inactive. | 94 /// Check for active ranges that have expired or become inactive. |
| 93 void handleActiveRangeExpiredOrInactive(const Variable *Cur); | 95 void handleActiveRangeExpiredOrInactive(const Variable *Cur); |
| 94 /// Check for inactive ranges that have expired or reactivated. | 96 /// Check for inactive ranges that have expired or reactivated. |
| 95 void handleInactiveRangeExpiredOrReactivated(const Variable *Cur); | 97 void handleInactiveRangeExpiredOrReactivated(const Variable *Cur); |
| 96 void findRegisterPreference(IterationState &Iter); | 98 void findRegisterPreference(IterationState &Iter); |
| 97 void filterFreeWithInactiveRanges(IterationState &Iter); | 99 void filterFreeWithInactiveRanges(IterationState &Iter); |
| 98 void filterFreeWithPrecoloredRanges(IterationState &Iter); | 100 void filterFreeWithPrecoloredRanges(IterationState &Iter); |
| 99 void allocatePrecoloredRegister(Variable *Cur); | 101 void allocatePrecoloredRegister(Variable *Cur); |
| 100 void allocatePreferredRegister(IterationState &Iter); | 102 void allocatePreferredRegister(IterationState &Iter); |
| 101 void allocateFreeRegister(IterationState &Iter); | 103 void allocateFreeRegister(IterationState &Iter, bool Filtered); |
| 102 void handleNoFreeRegisters(IterationState &Iter); | 104 void handleNoFreeRegisters(IterationState &Iter); |
| 103 void assignFinalRegisters(const llvm::SmallBitVector &RegMaskFull, | 105 void assignFinalRegisters(const llvm::SmallBitVector &RegMaskFull, |
| 104 const llvm::SmallBitVector &PreDefinedRegisters, | 106 const llvm::SmallBitVector &PreDefinedRegisters, |
| 105 bool Randomized); | 107 bool Randomized); |
| 106 /// @} | 108 /// @} |
| 107 | 109 |
| 108 void dumpLiveRangeTrace(const char *Label, const Variable *Item); | 110 void dumpLiveRangeTrace(const char *Label, const Variable *Item); |
| 109 | 111 |
| 110 Cfg *const Func; | 112 Cfg *const Func; |
| 111 GlobalContext *const Ctx; | 113 GlobalContext *const Ctx; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 123 /// currently assigned to. It can be greater than 1 as a result of | 125 /// currently assigned to. It can be greater than 1 as a result of |
| 124 /// AllowOverlap inference. | 126 /// AllowOverlap inference. |
| 125 llvm::SmallVector<int32_t, REGS_SIZE> RegUses; | 127 llvm::SmallVector<int32_t, REGS_SIZE> RegUses; |
| 126 // TODO(jpp): for some architectures a SmallBitVector might not be big | 128 // TODO(jpp): for some architectures a SmallBitVector might not be big |
| 127 // enough. Evaluate what the performance impact on those architectures is. | 129 // enough. Evaluate what the performance impact on those architectures is. |
| 128 llvm::SmallVector<const llvm::SmallBitVector *, REGS_SIZE> RegAliases; | 130 llvm::SmallVector<const llvm::SmallBitVector *, REGS_SIZE> RegAliases; |
| 129 bool FindPreference = false; | 131 bool FindPreference = false; |
| 130 bool FindOverlap = false; | 132 bool FindOverlap = false; |
| 131 | 133 |
| 132 const bool Verbose; | 134 const bool Verbose; |
| 135 const bool UseReserve; |
| 133 }; | 136 }; |
| 134 | 137 |
| 135 } // end of namespace Ice | 138 } // end of namespace Ice |
| 136 | 139 |
| 137 #endif // SUBZERO_SRC_ICEREGALLOC_H | 140 #endif // SUBZERO_SRC_ICEREGALLOC_H |
| OLD | NEW |