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

Side by Side Diff: src/IceCfg.cpp

Issue 580903005: Subzero: Add branch optimization. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 6 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 | « src/IceCfg.h ('k') | src/IceCfgNode.h » ('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.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 // This file implements the Cfg class, including constant pool 10 // This file implements the Cfg class, including constant pool
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 Var->dump(this); 283 Var->dump(this);
284 Str << " live range " << Var->getLiveRange() << "\n"; 284 Str << " live range " << Var->getLiveRange() << "\n";
285 } 285 }
286 } 286 }
287 } 287 }
288 } 288 }
289 } 289 }
290 return Valid; 290 return Valid;
291 } 291 }
292 292
293 void Cfg::doBranchOpt() {
294 for (NodeList::iterator I = Nodes.begin(), E = Nodes.end(); I != E; ++I) {
295 NodeList::iterator NextNode = I;
296 ++NextNode;
297 (*I)->doBranchOpt(*NextNode);
298 }
299 }
300
293 // ======================== Dump routines ======================== // 301 // ======================== Dump routines ======================== //
294 302
295 void Cfg::emit() { 303 void Cfg::emit() {
296 Ostream &Str = Ctx->getStrEmit(); 304 Ostream &Str = Ctx->getStrEmit();
297 Timer T_emit; 305 Timer T_emit;
298 if (!Ctx->testAndSetHasEmittedFirstMethod()) { 306 if (!Ctx->testAndSetHasEmittedFirstMethod()) {
299 // Print a helpful command for assembling the output. 307 // Print a helpful command for assembling the output.
300 // TODO: have the Target emit the header 308 // TODO: have the Target emit the header
301 // TODO: need a per-file emit in addition to per-CFG 309 // TODO: need a per-file emit in addition to per-CFG
302 Str << "# $LLVM_BIN_PATH/llvm-mc" 310 Str << "# $LLVM_BIN_PATH/llvm-mc"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 for (NodeList::const_iterator I = Nodes.begin(), E = Nodes.end(); I != E; 383 for (NodeList::const_iterator I = Nodes.begin(), E = Nodes.end(); I != E;
376 ++I) { 384 ++I) {
377 (*I)->dump(this); 385 (*I)->dump(this);
378 } 386 }
379 if (getContext()->isVerbose(IceV_Instructions)) { 387 if (getContext()->isVerbose(IceV_Instructions)) {
380 Str << "}\n"; 388 Str << "}\n";
381 } 389 }
382 } 390 }
383 391
384 } // end of namespace Ice 392 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceCfg.h ('k') | src/IceCfgNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698