| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 LiveBeginEndMap *getLiveBegin(const CfgNode *Node) { | 89 LiveBeginEndMap *getLiveBegin(const CfgNode *Node) { |
| 90 SizeT Index = Node->getIndex(); | 90 SizeT Index = Node->getIndex(); |
| 91 resize(Index); | 91 resize(Index); |
| 92 return &Nodes[Index].LiveBegin; | 92 return &Nodes[Index].LiveBegin; |
| 93 } | 93 } |
| 94 LiveBeginEndMap *getLiveEnd(const CfgNode *Node) { | 94 LiveBeginEndMap *getLiveEnd(const CfgNode *Node) { |
| 95 SizeT Index = Node->getIndex(); | 95 SizeT Index = Node->getIndex(); |
| 96 resize(Index); | 96 resize(Index); |
| 97 return &Nodes[Index].LiveEnd; | 97 return &Nodes[Index].LiveEnd; |
| 98 } | 98 } |
| 99 bool getRangeMask(SizeT Index) const { return RangeMask[Index]; } |
| 99 | 100 |
| 100 private: | 101 private: |
| 101 void initInternal(NodeList::const_iterator FirstNode, | 102 void initInternal(NodeList::const_iterator FirstNode, |
| 102 VarList::const_iterator FirstVar, bool IsFullInit); | 103 VarList::const_iterator FirstVar, bool IsFullInit); |
| 103 /// Resize Nodes so that Nodes[Index] is valid. | 104 /// Resize Nodes so that Nodes[Index] is valid. |
| 104 void resize(SizeT Index) { | 105 void resize(SizeT Index) { |
| 105 if (Index >= Nodes.size()) | 106 if (Index >= Nodes.size()) |
| 106 Nodes.resize(Index + 1); | 107 Nodes.resize(Index + 1); |
| 107 } | 108 } |
| 108 Cfg *Func; | 109 Cfg *Func; |
| 109 LivenessMode Mode; | 110 LivenessMode Mode; |
| 110 SizeT NumGlobals = 0; | 111 SizeT NumGlobals = 0; |
| 111 /// Size of Nodes is Cfg::Nodes.size(). | 112 /// Size of Nodes is Cfg::Nodes.size(). |
| 112 std::vector<LivenessNode> Nodes; | 113 std::vector<LivenessNode> Nodes; |
| 113 /// VarToLiveMap maps a Variable's Variable::Number to its live index | 114 /// VarToLiveMap maps a Variable's Variable::Number to its live index |
| 114 /// within its basic block. | 115 /// within its basic block. |
| 115 std::vector<SizeT> VarToLiveMap; | 116 std::vector<SizeT> VarToLiveMap; |
| 116 /// LiveToVarMap is analogous to LivenessNode::LiveToVarMap, but for | 117 /// LiveToVarMap is analogous to LivenessNode::LiveToVarMap, but for |
| 117 /// non-local variables. | 118 /// non-local variables. |
| 118 std::vector<Variable *> LiveToVarMap; | 119 std::vector<Variable *> LiveToVarMap; |
| 120 /// RangeMask[Variable::Number] indicates whether we want to track that |
| 121 /// Variable's live range. |
| 122 llvm::BitVector RangeMask; |
| 119 }; | 123 }; |
| 120 | 124 |
| 121 } // end of namespace Ice | 125 } // end of namespace Ice |
| 122 | 126 |
| 123 #endif // SUBZERO_SRC_ICELIVENESS_H | 127 #endif // SUBZERO_SRC_ICELIVENESS_H |
| OLD | NEW |