OLD | NEW |
---|---|
1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===// | 1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) 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 CfgNode class, including the complexities | 10 // This file implements the CfgNode class, including the complexities |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
450 continue; | 450 continue; |
451 if (Begin <= FirstInstNum) | 451 if (Begin <= FirstInstNum) |
452 Begin = FirstInstNum; | 452 Begin = FirstInstNum; |
453 if (End == Inst::NumberSentinel) | 453 if (End == Inst::NumberSentinel) |
454 End = LastInstNum + 1; | 454 End = LastInstNum + 1; |
455 Variable *Var = Liveness->getVariable(i, this); | 455 Variable *Var = Liveness->getVariable(i, this); |
456 Liveness->addLiveRange(Var, Begin, End, 1); | 456 Liveness->addLiveRange(Var, Begin, End, 1); |
457 } | 457 } |
458 } | 458 } |
459 | 459 |
460 void CfgNode::doBranchOpt(const CfgNode *NextNode) { | |
461 TargetLowering *Target = Func->getTarget(); | |
462 for (InstList::const_iterator I = Insts.begin(), E = Insts.end(); I != E; | |
463 ++I) { | |
464 Target->doBranchOpt(*I, NextNode); | |
jvoung (off chromium)
2014/09/18 03:56:02
I wonder if it makes sense to search backward and
Jim Stichnoth
2014/09/18 11:45:51
I thought about this a bit, but I think that would
| |
465 } | |
466 } | |
467 | |
460 // ======================== Dump routines ======================== // | 468 // ======================== Dump routines ======================== // |
461 | 469 |
462 void CfgNode::emit(Cfg *Func) const { | 470 void CfgNode::emit(Cfg *Func) const { |
463 Func->setCurrentNode(this); | 471 Func->setCurrentNode(this); |
464 Ostream &Str = Func->getContext()->getStrEmit(); | 472 Ostream &Str = Func->getContext()->getStrEmit(); |
465 if (Func->getEntryNode() == this) { | 473 if (Func->getEntryNode() == this) { |
466 Str << Func->getContext()->mangleName(Func->getFunctionName()) << ":\n"; | 474 Str << Func->getContext()->mangleName(Func->getFunctionName()) << ":\n"; |
467 } | 475 } |
468 Str << getAsmName() << ":\n"; | 476 Str << getAsmName() << ":\n"; |
469 for (PhiList::const_iterator I = Phis.begin(), E = Phis.end(); I != E; ++I) { | 477 for (PhiList::const_iterator I = Phis.begin(), E = Phis.end(); I != E; ++I) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
565 I != E; ++I) { | 573 I != E; ++I) { |
566 if (I != OutEdges.begin()) | 574 if (I != OutEdges.begin()) |
567 Str << ", "; | 575 Str << ", "; |
568 Str << "%" << (*I)->getName(); | 576 Str << "%" << (*I)->getName(); |
569 } | 577 } |
570 Str << "\n"; | 578 Str << "\n"; |
571 } | 579 } |
572 } | 580 } |
573 | 581 |
574 } // end of namespace Ice | 582 } // end of namespace Ice |
OLD | NEW |