OLD | NEW |
1 //===- subzero/src/IceCfg.h - Control flow graph ----------------*- C++ -*-===// | 1 //===- subzero/src/IceCfg.h - Control flow graph ----------------*- 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 Cfg class, which represents the control flow | 10 // This file declares the Cfg class, which represents the control flow |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 // Manage Variables. | 63 // Manage Variables. |
64 Variable *makeVariable(Type Ty, const CfgNode *Node, | 64 Variable *makeVariable(Type Ty, const CfgNode *Node, |
65 const IceString &Name = ""); | 65 const IceString &Name = ""); |
66 SizeT getNumVariables() const { return Variables.size(); } | 66 SizeT getNumVariables() const { return Variables.size(); } |
67 const VarList &getVariables() const { return Variables; } | 67 const VarList &getVariables() const { return Variables; } |
68 | 68 |
69 // Manage arguments to the function. | 69 // Manage arguments to the function. |
70 void addArg(Variable *Arg); | 70 void addArg(Variable *Arg); |
71 const VarList &getArgs() const { return Args; } | 71 const VarList &getArgs() const { return Args; } |
| 72 VarList &getArgs() { return Args; } |
72 | 73 |
73 // Miscellaneous accessors. | 74 // Miscellaneous accessors. |
74 TargetLowering *getTarget() const { return Target.get(); } | 75 TargetLowering *getTarget() const { return Target.get(); } |
75 Liveness *getLiveness() const { return Live.get(); } | 76 Liveness *getLiveness() const { return Live.get(); } |
76 bool hasComputedFrame() const; | 77 bool hasComputedFrame() const; |
77 | 78 |
78 // Passes over the CFG. | 79 // Passes over the CFG. |
79 void translate(); | 80 void translate(); |
80 // After the CFG is fully constructed, iterate over the nodes and | 81 // After the CFG is fully constructed, iterate over the nodes and |
81 // compute the predecessor edges, in the form of | 82 // compute the predecessor edges, in the form of |
82 // CfgNode::InEdges[]. | 83 // CfgNode::InEdges[]. |
83 void computePredecessors(); | 84 void computePredecessors(); |
84 void renumberInstructions(); | 85 void renumberInstructions(); |
85 void placePhiLoads(); | 86 void placePhiLoads(); |
86 void placePhiStores(); | 87 void placePhiStores(); |
87 void deletePhis(); | 88 void deletePhis(); |
88 void doAddressOpt(); | 89 void doAddressOpt(); |
| 90 void doArgLowering(); |
89 void genCode(); | 91 void genCode(); |
90 void genFrame(); | 92 void genFrame(); |
91 void livenessLightweight(); | 93 void livenessLightweight(); |
92 void liveness(LivenessMode Mode); | 94 void liveness(LivenessMode Mode); |
93 bool validateLiveness() const; | 95 bool validateLiveness() const; |
94 | 96 |
95 // Manage the CurrentNode field, which is used for validating the | 97 // Manage the CurrentNode field, which is used for validating the |
96 // Variable::DefNode field during dumping/emitting. | 98 // Variable::DefNode field during dumping/emitting. |
97 void setCurrentNode(const CfgNode *Node) { CurrentNode = Node; } | 99 void setCurrentNode(const CfgNode *Node) { CurrentNode = Node; } |
98 const CfgNode *getCurrentNode() const { return CurrentNode; } | 100 const CfgNode *getCurrentNode() const { return CurrentNode; } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // avoid spurious validation failures. | 157 // avoid spurious validation failures. |
156 const CfgNode *CurrentNode; | 158 const CfgNode *CurrentNode; |
157 | 159 |
158 Cfg(const Cfg &) LLVM_DELETED_FUNCTION; | 160 Cfg(const Cfg &) LLVM_DELETED_FUNCTION; |
159 Cfg &operator=(const Cfg &) LLVM_DELETED_FUNCTION; | 161 Cfg &operator=(const Cfg &) LLVM_DELETED_FUNCTION; |
160 }; | 162 }; |
161 | 163 |
162 } // end of namespace Ice | 164 } // end of namespace Ice |
163 | 165 |
164 #endif // SUBZERO_SRC_ICECFG_H | 166 #endif // SUBZERO_SRC_ICECFG_H |
OLD | NEW |