| 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 // This file declares the data structures used during linear-scan | 10 // This file declares the data structures used during linear-scan |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // in the future, we may want to do more complex things such as live | 27 // in the future, we may want to do more complex things such as live |
| 28 // range splitting, and keeping a wrapper should make that simpler. | 28 // range splitting, and keeping a wrapper should make that simpler. |
| 29 class LiveRangeWrapper { | 29 class LiveRangeWrapper { |
| 30 public: | 30 public: |
| 31 LiveRangeWrapper(Variable *Var) : Var(Var) {} | 31 LiveRangeWrapper(Variable *Var) : Var(Var) {} |
| 32 const LiveRange &range() const { return Var->getLiveRange(); } | 32 const LiveRange &range() const { return Var->getLiveRange(); } |
| 33 bool endsBefore(const LiveRangeWrapper &Other) const { | 33 bool endsBefore(const LiveRangeWrapper &Other) const { |
| 34 return range().endsBefore(Other.range()); | 34 return range().endsBefore(Other.range()); |
| 35 } | 35 } |
| 36 bool overlaps(const LiveRangeWrapper &Other) const { | 36 bool overlaps(const LiveRangeWrapper &Other) const { |
| 37 return range().overlaps(Other.range()); | 37 const bool UseTrimmed = true; |
| 38 return range().overlaps(Other.range(), UseTrimmed); |
| 38 } | 39 } |
| 39 bool overlapsStart(const LiveRangeWrapper &Other) const { | 40 bool overlapsStart(const LiveRangeWrapper &Other) const { |
| 40 return range().overlaps(Other.range().getStart()); | 41 const bool UseTrimmed = true; |
| 42 return range().overlapsInst(Other.range().getStart(), UseTrimmed); |
| 41 } | 43 } |
| 42 Variable *const Var; | 44 Variable *const Var; |
| 43 void dump(const Cfg *Func) const; | 45 void dump(const Cfg *Func) const; |
| 44 | 46 |
| 45 private: | 47 private: |
| 46 // LiveRangeWrapper(const LiveRangeWrapper &) = delete; | 48 // LiveRangeWrapper(const LiveRangeWrapper &) = delete; |
| 47 LiveRangeWrapper &operator=(const LiveRangeWrapper &) = delete; | 49 LiveRangeWrapper &operator=(const LiveRangeWrapper &) = delete; |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 class LinearScan { | 52 class LinearScan { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 75 // for faster processing. | 77 // for faster processing. |
| 76 OrderedRanges UnhandledPrecolored; | 78 OrderedRanges UnhandledPrecolored; |
| 77 UnorderedRanges Active, Inactive, Handled; | 79 UnorderedRanges Active, Inactive, Handled; |
| 78 LinearScan(const LinearScan &) = delete; | 80 LinearScan(const LinearScan &) = delete; |
| 79 LinearScan &operator=(const LinearScan &) = delete; | 81 LinearScan &operator=(const LinearScan &) = delete; |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 } // end of namespace Ice | 84 } // end of namespace Ice |
| 83 | 85 |
| 84 #endif // SUBZERO_SRC_ICEREGALLOC_H | 86 #endif // SUBZERO_SRC_ICEREGALLOC_H |
| OLD | NEW |