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

Side by Side Diff: src/IceCfg.cpp

Issue 1357733004: Subzero: Fix -enable-block-profile. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 3 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 | no next file » | 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.cpp - Control flow graph implementation ---------===// 1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===//
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 getContext()->resetTimer(GlobalContext::TSK_Default); 177 getContext()->resetTimer(GlobalContext::TSK_Default);
178 getContext()->setTimerName(GlobalContext::TSK_Default, Name); 178 getContext()->setTimerName(GlobalContext::TSK_Default, Name);
179 } 179 }
180 if (getContext()->getFlags().getTimeEachFunction()) 180 if (getContext()->getFlags().getTimeEachFunction())
181 FunctionTimer.reset(new TimerMarker( 181 FunctionTimer.reset(new TimerMarker(
182 getContext()->getTimerID(GlobalContext::TSK_Funcs, Name), 182 getContext()->getTimerID(GlobalContext::TSK_Funcs, Name),
183 getContext(), GlobalContext::TSK_Funcs)); 183 getContext(), GlobalContext::TSK_Funcs));
184 } 184 }
185 TimerMarker T(TimerStack::TT_translate, this); 185 TimerMarker T(TimerStack::TT_translate, this);
186 186
187 // Create the Hi and Lo variables where a split was needed
188 for (Variable *Var : Variables)
189 if (auto Var64On32 = llvm::dyn_cast<Variable64On32>(Var))
190 Var64On32->initHiLo(this);
191
192 dump("Initial CFG"); 187 dump("Initial CFG");
193 188
194 if (getContext()->getFlags().getEnableBlockProfile()) { 189 if (getContext()->getFlags().getEnableBlockProfile()) {
195 profileBlocks(); 190 profileBlocks();
196 // TODO(jpp): this is fragile, at best. Figure out a better way of 191 // TODO(jpp): this is fragile, at best. Figure out a better way of
197 // detecting exit functions. 192 // detecting exit functions.
198 if (GlobalContext::matchSymbolName(getFunctionName(), "exit")) { 193 if (GlobalContext::matchSymbolName(getFunctionName(), "exit")) {
199 addCallToProfileSummary(); 194 addCallToProfileSummary();
200 } 195 }
201 dump("Profiled CFG"); 196 dump("Profiled CFG");
202 } 197 }
203 198
199 // Create the Hi and Lo variables where a split was needed
200 for (Variable *Var : Variables)
201 if (auto Var64On32 = llvm::dyn_cast<Variable64On32>(Var))
202 Var64On32->initHiLo(this);
203
204 // The set of translation passes and their order are determined by the 204 // The set of translation passes and their order are determined by the
205 // target. 205 // target.
206 getTarget()->translate(); 206 getTarget()->translate();
207 207
208 dump("Final output"); 208 dump("Final output");
209 if (getFocusedTiming()) 209 if (getFocusedTiming())
210 getContext()->dumpTimers(); 210 getContext()->dumpTimers();
211 } 211 }
212 212
213 void Cfg::computeInOutEdges() { 213 void Cfg::computeInOutEdges() {
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 } 787 }
788 } 788 }
789 // Print each basic block 789 // Print each basic block
790 for (CfgNode *Node : Nodes) 790 for (CfgNode *Node : Nodes)
791 Node->dump(this); 791 Node->dump(this);
792 if (isVerbose(IceV_Instructions)) 792 if (isVerbose(IceV_Instructions))
793 Str << "}\n"; 793 Str << "}\n";
794 } 794 }
795 795
796 } // end of namespace Ice 796 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698