Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: src/IceCfg.h

Issue 620373004: Subzero: Add a few performance measurement tools. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Improve the use of containers Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/IceCfg.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 TargetLowering *getTarget() const { return Target.get(); } 89 TargetLowering *getTarget() const { return Target.get(); }
90 VariablesMetadata *getVMetadata() const { return VMetadata.get(); } 90 VariablesMetadata *getVMetadata() const { return VMetadata.get(); }
91 Liveness *getLiveness() const { return Live.get(); } 91 Liveness *getLiveness() const { return Live.get(); }
92 template <typename T> T *getAssembler() const { 92 template <typename T> T *getAssembler() const {
93 return static_cast<T *>(TargetAssembler.get()); 93 return static_cast<T *>(TargetAssembler.get());
94 } 94 }
95 bool UseIntegratedAssembler() const { 95 bool UseIntegratedAssembler() const {
96 return getContext()->getFlags().UseIntegratedAssembler; 96 return getContext()->getFlags().UseIntegratedAssembler;
97 } 97 }
98 bool hasComputedFrame() const; 98 bool hasComputedFrame() const;
99 bool getFocusedTiming() const { return FocusedTiming; }
100 void setFocusedTiming() { FocusedTiming = true; }
99 101
100 // Passes over the CFG. 102 // Passes over the CFG.
101 void translate(); 103 void translate();
102 // After the CFG is fully constructed, iterate over the nodes and 104 // After the CFG is fully constructed, iterate over the nodes and
103 // compute the predecessor edges, in the form of 105 // compute the predecessor edges, in the form of
104 // CfgNode::InEdges[]. 106 // CfgNode::InEdges[].
105 void computePredecessors(); 107 void computePredecessors();
106 void renumberInstructions(); 108 void renumberInstructions();
107 void placePhiLoads(); 109 void placePhiLoads();
108 void placePhiStores(); 110 void placePhiStores();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // order to use a "Recycler" to preserve memory. If we keep all allocation 160 // order to use a "Recycler" to preserve memory. If we keep all allocation
159 // requests from the Cfg exposed via methods, we can always switch the 161 // requests from the Cfg exposed via methods, we can always switch the
160 // implementation over at a later point. 162 // implementation over at a later point.
161 llvm::BumpPtrAllocator Allocator; 163 llvm::BumpPtrAllocator Allocator;
162 164
163 GlobalContext *Ctx; 165 GlobalContext *Ctx;
164 IceString FunctionName; 166 IceString FunctionName;
165 Type ReturnType; 167 Type ReturnType;
166 bool IsInternalLinkage; 168 bool IsInternalLinkage;
167 bool HasError; 169 bool HasError;
170 bool FocusedTiming;
168 IceString ErrorMessage; 171 IceString ErrorMessage;
169 CfgNode *Entry; // entry basic block 172 CfgNode *Entry; // entry basic block
170 NodeList Nodes; // linearized node list; Entry should be first 173 NodeList Nodes; // linearized node list; Entry should be first
171 InstNumberT NextInstNumber; 174 InstNumberT NextInstNumber;
172 VarList Variables; 175 VarList Variables;
173 VarList Args; // subset of Variables, in argument order 176 VarList Args; // subset of Variables, in argument order
174 VarList ImplicitArgs; // subset of Variables 177 VarList ImplicitArgs; // subset of Variables
175 std::unique_ptr<Liveness> Live; 178 std::unique_ptr<Liveness> Live;
176 std::unique_ptr<TargetLowering> Target; 179 std::unique_ptr<TargetLowering> Target;
177 std::unique_ptr<VariablesMetadata> VMetadata; 180 std::unique_ptr<VariablesMetadata> VMetadata;
178 std::unique_ptr<Assembler> TargetAssembler; 181 std::unique_ptr<Assembler> TargetAssembler;
179 182
180 // CurrentNode is maintained during dumping/emitting just for 183 // CurrentNode is maintained during dumping/emitting just for
181 // validating Variable::DefNode. Normally, a traversal over 184 // validating Variable::DefNode. Normally, a traversal over
182 // CfgNodes maintains this, but before global operations like 185 // CfgNodes maintains this, but before global operations like
183 // register allocation, resetCurrentNode() should be called to avoid 186 // register allocation, resetCurrentNode() should be called to avoid
184 // spurious validation failures. 187 // spurious validation failures.
185 const CfgNode *CurrentNode; 188 const CfgNode *CurrentNode;
186 189
187 Cfg(const Cfg &) = delete; 190 Cfg(const Cfg &) = delete;
188 Cfg &operator=(const Cfg &) = delete; 191 Cfg &operator=(const Cfg &) = delete;
189 }; 192 };
190 193
191 } // end of namespace Ice 194 } // end of namespace Ice
192 195
193 #endif // SUBZERO_SRC_ICECFG_H 196 #endif // SUBZERO_SRC_ICECFG_H
OLDNEW
« no previous file with comments | « no previous file | src/IceCfg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698