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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 int32_t PreferReg = Variable::NoRegister; | 53 int32_t PreferReg = Variable::NoRegister; |
54 bool AllowOverlap = false; | 54 bool AllowOverlap = false; |
55 llvm::SmallBitVector RegMask; | 55 llvm::SmallBitVector RegMask; |
56 llvm::SmallBitVector Free; | 56 llvm::SmallBitVector Free; |
57 llvm::SmallBitVector PrecoloredUnhandledMask; // Note: only used for dumping | 57 llvm::SmallBitVector PrecoloredUnhandledMask; // Note: only used for dumping |
58 llvm::SmallVector<RegWeight, REGS_SIZE> Weights; | 58 llvm::SmallVector<RegWeight, REGS_SIZE> Weights; |
59 }; | 59 }; |
60 | 60 |
61 void initForGlobal(); | 61 void initForGlobal(); |
62 void initForInfOnly(); | 62 void initForInfOnly(); |
63 /// Move an item from the From set to the To set. From[Index] is pushed onto | 63 /// Move an item from the From set to the To set. From[Index] is pushed onto |
64 /// the end of To[], then the item is efficiently removed from From[] by | 64 /// the end of To[], then the item is efficiently removed from From[] by |
65 /// effectively swapping it with the last item in From[] and then popping it | 65 /// effectively swapping it with the last item in From[] and then popping it |
66 /// from the back. As such, the caller is best off iterating over From[] in | 66 /// from the back. As such, the caller is best off iterating over From[] in |
67 /// reverse order to avoid the need for special handling of the iterator. | 67 /// reverse order to avoid the need for special handling of the iterator. |
68 void moveItem(UnorderedRanges &From, SizeT Index, UnorderedRanges &To) { | 68 void moveItem(UnorderedRanges &From, SizeT Index, UnorderedRanges &To) { |
69 To.push_back(From[Index]); | 69 To.push_back(From[Index]); |
70 From[Index] = From.back(); | 70 From[Index] = From.back(); |
71 From.pop_back(); | 71 From.pop_back(); |
72 } | 72 } |
73 | 73 |
74 /// \name scan helper functions. | 74 /// \name scan helper functions. |
75 /// @{ | 75 /// @{ |
76 /// Free up a register for infinite-weight Cur by spilling and reloading some | 76 /// Free up a register for infinite-weight Cur by spilling and reloading some |
(...skipping 25 matching lines...) Expand all Loading... |
102 /// UnhandledPrecolored is a subset of Unhandled, specially collected for | 102 /// UnhandledPrecolored is a subset of Unhandled, specially collected for |
103 /// faster processing. | 103 /// faster processing. |
104 OrderedRanges UnhandledPrecolored; | 104 OrderedRanges UnhandledPrecolored; |
105 UnorderedRanges Active, Inactive, Handled; | 105 UnorderedRanges Active, Inactive, Handled; |
106 std::vector<InstNumberT> Kills; | 106 std::vector<InstNumberT> Kills; |
107 RegAllocKind Kind = RAK_Unknown; | 107 RegAllocKind Kind = RAK_Unknown; |
108 /// RegUses[I] is the number of live ranges (variables) that register I is | 108 /// RegUses[I] is the number of live ranges (variables) that register I is |
109 /// currently assigned to. It can be greater than 1 as a result of | 109 /// currently assigned to. It can be greater than 1 as a result of |
110 /// AllowOverlap inference. | 110 /// AllowOverlap inference. |
111 llvm::SmallVector<int32_t, REGS_SIZE> RegUses; | 111 llvm::SmallVector<int32_t, REGS_SIZE> RegUses; |
112 // TODO(jpp): for some architectures a SmallBitVector might not be big enough. | 112 // TODO(jpp): for some architectures a SmallBitVector might not be big |
113 // Evaluate what the performance impact on those architectures is. | 113 // enough. Evaluate what the performance impact on those architectures is. |
114 llvm::SmallVector<const llvm::SmallBitVector *, REGS_SIZE> RegAliases; | 114 llvm::SmallVector<const llvm::SmallBitVector *, REGS_SIZE> RegAliases; |
115 bool FindPreference = false; | 115 bool FindPreference = false; |
116 bool FindOverlap = false; | 116 bool FindOverlap = false; |
117 | 117 |
118 const bool Verbose; | 118 const bool Verbose; |
119 }; | 119 }; |
120 | 120 |
121 } // end of namespace Ice | 121 } // end of namespace Ice |
122 | 122 |
123 #endif // SUBZERO_SRC_ICEREGALLOC_H | 123 #endif // SUBZERO_SRC_ICEREGALLOC_H |
OLD | NEW |