OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |