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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 LivenessBV &getLiveIn(const CfgNode *Node) { | 78 LivenessBV &getLiveIn(const CfgNode *Node) { |
79 SizeT Index = Node->getIndex(); | 79 SizeT Index = Node->getIndex(); |
80 resize(Index); | 80 resize(Index); |
81 return Nodes[Index].LiveIn; | 81 return Nodes[Index].LiveIn; |
82 } | 82 } |
83 LivenessBV &getLiveOut(const CfgNode *Node) { | 83 LivenessBV &getLiveOut(const CfgNode *Node) { |
84 SizeT Index = Node->getIndex(); | 84 SizeT Index = Node->getIndex(); |
85 resize(Index); | 85 resize(Index); |
86 return Nodes[Index].LiveOut; | 86 return Nodes[Index].LiveOut; |
87 } | 87 } |
| 88 LivenessBV &getScratchBV() { return ScratchBV; } |
88 LiveBeginEndMap *getLiveBegin(const CfgNode *Node) { | 89 LiveBeginEndMap *getLiveBegin(const CfgNode *Node) { |
89 SizeT Index = Node->getIndex(); | 90 SizeT Index = Node->getIndex(); |
90 resize(Index); | 91 resize(Index); |
91 return &Nodes[Index].LiveBegin; | 92 return &Nodes[Index].LiveBegin; |
92 } | 93 } |
93 LiveBeginEndMap *getLiveEnd(const CfgNode *Node) { | 94 LiveBeginEndMap *getLiveEnd(const CfgNode *Node) { |
94 SizeT Index = Node->getIndex(); | 95 SizeT Index = Node->getIndex(); |
95 resize(Index); | 96 resize(Index); |
96 return &Nodes[Index].LiveEnd; | 97 return &Nodes[Index].LiveEnd; |
97 } | 98 } |
(...skipping 14 matching lines...) Expand all Loading... |
112 CfgVector<LivenessNode> Nodes; | 113 CfgVector<LivenessNode> Nodes; |
113 /// VarToLiveMap maps a Variable's Variable::Number to its live index within | 114 /// VarToLiveMap maps a Variable's Variable::Number to its live index within |
114 /// its basic block. | 115 /// its basic block. |
115 CfgVector<SizeT> VarToLiveMap; | 116 CfgVector<SizeT> VarToLiveMap; |
116 /// LiveToVarMap is analogous to LivenessNode::LiveToVarMap, but for non-local | 117 /// LiveToVarMap is analogous to LivenessNode::LiveToVarMap, but for non-local |
117 /// variables. | 118 /// variables. |
118 CfgVector<Variable *> LiveToVarMap; | 119 CfgVector<Variable *> LiveToVarMap; |
119 /// RangeMask[Variable::Number] indicates whether we want to track that | 120 /// RangeMask[Variable::Number] indicates whether we want to track that |
120 /// Variable's live range. | 121 /// Variable's live range. |
121 LivenessBV RangeMask; | 122 LivenessBV RangeMask; |
| 123 /// ScratchBV is a bitvector that can be reused across CfgNode passes, to |
| 124 /// avoid having to allocate/deallocate memory so frequently. |
| 125 LivenessBV ScratchBV; |
122 }; | 126 }; |
123 | 127 |
124 } // end of namespace Ice | 128 } // end of namespace Ice |
125 | 129 |
126 #endif // SUBZERO_SRC_ICELIVENESS_H | 130 #endif // SUBZERO_SRC_ICELIVENESS_H |
OLD | NEW |