Jim Stichnoth | d97c7df | 2014-06-04 11:57:08 -0700 | [diff] [blame] | 1 | //===- subzero/src/IceRegAlloc.h - Linear-scan reg. allocation --*- C++ -*-===// |
| 2 | // |
| 3 | // The Subzero Code Generator |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Jim Stichnoth | 5ce0abb | 2014-10-15 10:16:54 -0700 | [diff] [blame^] | 10 | // This file declares the LinearScan data structure used during |
| 11 | // linear-scan register allocation, which holds the various work |
| 12 | // queues for the linear-scan algorithm. |
Jim Stichnoth | d97c7df | 2014-06-04 11:57:08 -0700 | [diff] [blame] | 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #ifndef SUBZERO_SRC_ICEREGALLOC_H |
| 17 | #define SUBZERO_SRC_ICEREGALLOC_H |
| 18 | |
| 19 | #include "IceDefs.h" |
| 20 | #include "IceTypes.h" |
| 21 | |
| 22 | namespace Ice { |
| 23 | |
Jim Stichnoth | d97c7df | 2014-06-04 11:57:08 -0700 | [diff] [blame] | 24 | class LinearScan { |
Jim Stichnoth | 5ce0abb | 2014-10-15 10:16:54 -0700 | [diff] [blame^] | 25 | LinearScan(const LinearScan &) = delete; |
| 26 | LinearScan &operator=(const LinearScan &) = delete; |
| 27 | |
Jim Stichnoth | d97c7df | 2014-06-04 11:57:08 -0700 | [diff] [blame] | 28 | public: |
| 29 | LinearScan(Cfg *Func) : Func(Func) {} |
| 30 | void scan(const llvm::SmallBitVector &RegMask); |
| 31 | void dump(Cfg *Func) const; |
| 32 | |
| 33 | private: |
| 34 | Cfg *const Func; |
Jim Stichnoth | 5ce0abb | 2014-10-15 10:16:54 -0700 | [diff] [blame^] | 35 | typedef std::vector<Variable *> OrderedRanges; |
| 36 | typedef std::list<Variable *> UnorderedRanges; |
Jim Stichnoth | d97c7df | 2014-06-04 11:57:08 -0700 | [diff] [blame] | 37 | OrderedRanges Unhandled; |
Jim Stichnoth | 541ba66 | 2014-10-02 12:58:21 -0700 | [diff] [blame] | 38 | // UnhandledPrecolored is a subset of Unhandled, specially collected |
| 39 | // for faster processing. |
| 40 | OrderedRanges UnhandledPrecolored; |
Jim Stichnoth | d97c7df | 2014-06-04 11:57:08 -0700 | [diff] [blame] | 41 | UnorderedRanges Active, Inactive, Handled; |
Jim Stichnoth | d97c7df | 2014-06-04 11:57:08 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | } // end of namespace Ice |
| 45 | |
| 46 | #endif // SUBZERO_SRC_ICEREGALLOC_H |