| 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 LinearScan data structure used during | 10 // This file declares the LinearScan data structure used during |
| 11 // linear-scan register allocation, which holds the various work | 11 // linear-scan register allocation, which holds the various work |
| 12 // queues for the linear-scan algorithm. | 12 // queues for the linear-scan algorithm. |
| 13 // | 13 // |
| 14 //===----------------------------------------------------------------------===// | 14 //===----------------------------------------------------------------------===// |
| 15 | 15 |
| 16 #ifndef SUBZERO_SRC_ICEREGALLOC_H | 16 #ifndef SUBZERO_SRC_ICEREGALLOC_H |
| 17 #define SUBZERO_SRC_ICEREGALLOC_H | 17 #define SUBZERO_SRC_ICEREGALLOC_H |
| 18 | 18 |
| 19 #include "IceDefs.h" | 19 #include "IceDefs.h" |
| 20 #include "IceTypes.h" | 20 #include "IceTypes.h" |
| 21 | 21 |
| 22 namespace Ice { | 22 namespace Ice { |
| 23 | 23 |
| 24 class LinearScan { | 24 class LinearScan { |
| 25 LinearScan(const LinearScan &) = delete; | 25 LinearScan(const LinearScan &) = delete; |
| 26 LinearScan &operator=(const LinearScan &) = delete; | 26 LinearScan &operator=(const LinearScan &) = delete; |
| 27 | 27 |
| 28 public: | 28 public: |
| 29 LinearScan(Cfg *Func) : Func(Func) {} | 29 LinearScan(Cfg *Func) : Func(Func) {} |
| 30 void initForGlobalAlloc(); |
| 30 void scan(const llvm::SmallBitVector &RegMask); | 31 void scan(const llvm::SmallBitVector &RegMask); |
| 31 void dump(Cfg *Func) const; | 32 void dump(Cfg *Func) const; |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 Cfg *const Func; | 35 Cfg *const Func; |
| 35 typedef std::vector<Variable *> OrderedRanges; | 36 typedef std::vector<Variable *> OrderedRanges; |
| 36 typedef std::list<Variable *> UnorderedRanges; | 37 typedef std::list<Variable *> UnorderedRanges; |
| 37 OrderedRanges Unhandled; | 38 OrderedRanges Unhandled; |
| 38 // UnhandledPrecolored is a subset of Unhandled, specially collected | 39 // UnhandledPrecolored is a subset of Unhandled, specially collected |
| 39 // for faster processing. | 40 // for faster processing. |
| 40 OrderedRanges UnhandledPrecolored; | 41 OrderedRanges UnhandledPrecolored; |
| 41 UnorderedRanges Active, Inactive, Handled; | 42 UnorderedRanges Active, Inactive, Handled; |
| 43 std::vector<InstNumberT> Kills; |
| 42 }; | 44 }; |
| 43 | 45 |
| 44 } // end of namespace Ice | 46 } // end of namespace Ice |
| 45 | 47 |
| 46 #endif // SUBZERO_SRC_ICEREGALLOC_H | 48 #endif // SUBZERO_SRC_ICEREGALLOC_H |
| OLD | NEW |