Index: src/IceRegAlloc.h |
diff --git a/src/IceRegAlloc.h b/src/IceRegAlloc.h |
index f181a27b396824d3bffcb2f0c33031f8d8ca6a01..0742cc1d8d8d761cffe3b7ce76e68149d280e935 100644 |
--- a/src/IceRegAlloc.h |
+++ b/src/IceRegAlloc.h |
@@ -7,10 +7,9 @@ |
// |
//===----------------------------------------------------------------------===// |
// |
-// This file declares the data structures used during linear-scan |
-// register allocation. This includes LiveRangeWrapper which |
-// encapsulates a variable and its live range, and LinearScan which |
-// holds the various work queues for the linear-scan algorithm. |
+// This file declares the LinearScan data structure used during |
+// linear-scan register allocation, which holds the various work |
+// queues for the linear-scan algorithm. |
// |
//===----------------------------------------------------------------------===// |
@@ -22,34 +21,10 @@ |
namespace Ice { |
-// Currently this just wraps a Variable pointer, so in principle we |
-// could use containers of Variable* instead of LiveRangeWrapper. But |
-// in the future, we may want to do more complex things such as live |
-// range splitting, and keeping a wrapper should make that simpler. |
-class LiveRangeWrapper { |
-public: |
- LiveRangeWrapper(Variable *Var) : Var(Var) {} |
- const LiveRange &range() const { return Var->getLiveRange(); } |
- bool endsBefore(const LiveRangeWrapper &Other) const { |
- return range().endsBefore(Other.range()); |
- } |
- bool overlaps(const LiveRangeWrapper &Other) const { |
- const bool UseTrimmed = true; |
- return range().overlaps(Other.range(), UseTrimmed); |
- } |
- bool overlapsStart(const LiveRangeWrapper &Other) const { |
- const bool UseTrimmed = true; |
- return range().overlapsInst(Other.range().getStart(), UseTrimmed); |
- } |
- Variable *Var; |
- void dump(const Cfg *Func) const; |
- |
-private: |
- // LiveRangeWrapper(const LiveRangeWrapper &) = delete; |
- // LiveRangeWrapper &operator=(const LiveRangeWrapper &) = delete; |
-}; |
- |
class LinearScan { |
+ LinearScan(const LinearScan &) = delete; |
+ LinearScan &operator=(const LinearScan &) = delete; |
+ |
public: |
LinearScan(Cfg *Func) : Func(Func) {} |
void scan(const llvm::SmallBitVector &RegMask); |
@@ -57,15 +32,13 @@ public: |
private: |
Cfg *const Func; |
- typedef std::vector<LiveRangeWrapper> OrderedRanges; |
- typedef std::list<LiveRangeWrapper> UnorderedRanges; |
+ typedef std::vector<Variable *> OrderedRanges; |
+ typedef std::list<Variable *> UnorderedRanges; |
OrderedRanges Unhandled; |
// UnhandledPrecolored is a subset of Unhandled, specially collected |
// for faster processing. |
OrderedRanges UnhandledPrecolored; |
UnorderedRanges Active, Inactive, Handled; |
- LinearScan(const LinearScan &) = delete; |
- LinearScan &operator=(const LinearScan &) = delete; |
}; |
} // end of namespace Ice |