| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // LivenessNode::NumGlobals. | 54 // LivenessNode::NumGlobals. |
| 55 LivenessBV LiveIn, LiveOut; | 55 LivenessBV LiveIn, LiveOut; |
| 56 // LiveBegin and LiveEnd track the instruction numbers of the start | 56 // LiveBegin and LiveEnd track the instruction numbers of the start |
| 57 // and end of each variable's live range within this block. The | 57 // and end of each variable's live range within this block. The |
| 58 // index/key of each element is less than NumLocals + | 58 // index/key of each element is less than NumLocals + |
| 59 // Liveness::NumGlobals. | 59 // Liveness::NumGlobals. |
| 60 LiveBeginEndMap LiveBegin, LiveEnd; | 60 LiveBeginEndMap LiveBegin, LiveEnd; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 public: | 63 public: |
| 64 Liveness(Cfg *Func, LivenessMode Mode) : Func(Func), Mode(Mode) {} | 64 Liveness(Cfg *MyFunc, LivenessMode MyMode) : Func(MyFunc), Mode(MyMode) {} |
| 65 void init(); | 65 void init(); |
| 66 Cfg *getFunc() const { return Func; } | 66 Cfg *getFunc() const { return Func; } |
| 67 LivenessMode getMode() const { return Mode; } | 67 LivenessMode getMode() const { return Mode; } |
| 68 Variable *getVariable(SizeT LiveIndex, const CfgNode *Node) const; | 68 Variable *getVariable(SizeT LiveIndex, const CfgNode *Node) const; |
| 69 SizeT getLiveIndex(SizeT VarIndex) const { return VarToLiveMap[VarIndex]; } | 69 SizeT getLiveIndex(SizeT VarIndex) const { return VarToLiveMap[VarIndex]; } |
| 70 SizeT getNumGlobalVars() const { return NumGlobals; } | 70 SizeT getNumGlobalVars() const { return NumGlobals; } |
| 71 SizeT getNumVarsInNode(const CfgNode *Node) const { | 71 SizeT getNumVarsInNode(const CfgNode *Node) const { |
| 72 return NumGlobals + Nodes[Node->getIndex()].NumLocals; | 72 return NumGlobals + Nodes[Node->getIndex()].NumLocals; |
| 73 } | 73 } |
| 74 SizeT &getNumNonDeadPhis(const CfgNode *Node) { | 74 SizeT &getNumNonDeadPhis(const CfgNode *Node) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 /// within its basic block. | 110 /// within its basic block. |
| 111 std::vector<SizeT> VarToLiveMap; | 111 std::vector<SizeT> VarToLiveMap; |
| 112 /// LiveToVarMap is analogous to LivenessNode::LiveToVarMap, but for | 112 /// LiveToVarMap is analogous to LivenessNode::LiveToVarMap, but for |
| 113 /// non-local variables. | 113 /// non-local variables. |
| 114 std::vector<Variable *> LiveToVarMap; | 114 std::vector<Variable *> LiveToVarMap; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } // end of namespace Ice | 117 } // end of namespace Ice |
| 118 | 118 |
| 119 #endif // SUBZERO_SRC_ICELIVENESS_H | 119 #endif // SUBZERO_SRC_ICELIVENESS_H |
| OLD | NEW |