| OLD | NEW |
| 1 //===- subzero/src/IceLiveness.h - Liveness analysis ------------*- C++ -*-===// | 1 //===- subzero/src/IceLiveness.h - Liveness analysis ------------*- 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 29 matching lines...) Expand all Loading... |
| 40 /// NumLocals is the number of Variables local to this block. | 40 /// NumLocals is the number of Variables local to this block. |
| 41 SizeT NumLocals = 0; | 41 SizeT NumLocals = 0; |
| 42 /// NumNonDeadPhis tracks the number of Phi instructions that | 42 /// NumNonDeadPhis tracks the number of Phi instructions that |
| 43 /// Inst::liveness() identified as tentatively live. If NumNonDeadPhis | 43 /// Inst::liveness() identified as tentatively live. If NumNonDeadPhis |
| 44 /// changes from the last liveness pass, then liveness has not yet | 44 /// changes from the last liveness pass, then liveness has not yet |
| 45 /// converged. | 45 /// converged. |
| 46 SizeT NumNonDeadPhis = 0; | 46 SizeT NumNonDeadPhis = 0; |
| 47 // LiveToVarMap maps a liveness bitvector index to a Variable. This is | 47 // LiveToVarMap maps a liveness bitvector index to a Variable. This is |
| 48 // generally just for printing/dumping. The index should be less than | 48 // generally just for printing/dumping. The index should be less than |
| 49 // NumLocals + Liveness::NumGlobals. | 49 // NumLocals + Liveness::NumGlobals. |
| 50 std::vector<Variable *> LiveToVarMap; | 50 CfgVector<Variable *> LiveToVarMap; |
| 51 // LiveIn and LiveOut track the in- and out-liveness of the global | 51 // LiveIn and LiveOut track the in- and out-liveness of the global |
| 52 // variables. The size of each vector is LivenessNode::NumGlobals. | 52 // variables. The size of each vector is LivenessNode::NumGlobals. |
| 53 LivenessBV LiveIn, LiveOut; | 53 LivenessBV LiveIn, LiveOut; |
| 54 // LiveBegin and LiveEnd track the instruction numbers of the start and end | 54 // LiveBegin and LiveEnd track the instruction numbers of the start and end |
| 55 // of each variable's live range within this block. The index/key of each | 55 // of each variable's live range within this block. The index/key of each |
| 56 // element is less than NumLocals + Liveness::NumGlobals. | 56 // element is less than NumLocals + Liveness::NumGlobals. |
| 57 LiveBeginEndMap LiveBegin, LiveEnd; | 57 LiveBeginEndMap LiveBegin, LiveEnd; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 public: | 60 public: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 VarList::const_iterator FirstVar, bool IsFullInit); | 100 VarList::const_iterator FirstVar, bool IsFullInit); |
| 101 /// Resize Nodes so that Nodes[Index] is valid. | 101 /// Resize Nodes so that Nodes[Index] is valid. |
| 102 void resize(SizeT Index) { | 102 void resize(SizeT Index) { |
| 103 if (Index >= Nodes.size()) | 103 if (Index >= Nodes.size()) |
| 104 Nodes.resize(Index + 1); | 104 Nodes.resize(Index + 1); |
| 105 } | 105 } |
| 106 Cfg *Func; | 106 Cfg *Func; |
| 107 LivenessMode Mode; | 107 LivenessMode Mode; |
| 108 SizeT NumGlobals = 0; | 108 SizeT NumGlobals = 0; |
| 109 /// Size of Nodes is Cfg::Nodes.size(). | 109 /// Size of Nodes is Cfg::Nodes.size(). |
| 110 std::vector<LivenessNode> Nodes; | 110 CfgVector<LivenessNode> Nodes; |
| 111 /// VarToLiveMap maps a Variable's Variable::Number to its live index within | 111 /// VarToLiveMap maps a Variable's Variable::Number to its live index within |
| 112 /// its basic block. | 112 /// its basic block. |
| 113 std::vector<SizeT> VarToLiveMap; | 113 CfgVector<SizeT> VarToLiveMap; |
| 114 /// LiveToVarMap is analogous to LivenessNode::LiveToVarMap, but for non-local | 114 /// LiveToVarMap is analogous to LivenessNode::LiveToVarMap, but for non-local |
| 115 /// variables. | 115 /// variables. |
| 116 std::vector<Variable *> LiveToVarMap; | 116 CfgVector<Variable *> LiveToVarMap; |
| 117 /// RangeMask[Variable::Number] indicates whether we want to track that | 117 /// RangeMask[Variable::Number] indicates whether we want to track that |
| 118 /// Variable's live range. | 118 /// Variable's live range. |
| 119 llvm::BitVector RangeMask; | 119 llvm::BitVector RangeMask; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 } // end of namespace Ice | 122 } // end of namespace Ice |
| 123 | 123 |
| 124 #endif // SUBZERO_SRC_ICELIVENESS_H | 124 #endif // SUBZERO_SRC_ICELIVENESS_H |
| OLD | NEW |