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