Home | History | Annotate | Download | only in Analysis

Lines Matching refs:exit

9 // Detects single entry single exit regions in the control flow graph.
55 Region::Region(BasicBlock *Entry, BasicBlock *Exit, RegionInfo* RInfo,
57 : RegionNode(Parent, Entry, 1), RI(RInfo), DT(dt), exit(Exit) {}
78 assert(exit && "No exit to replace!");
79 exit = BB;
120 BasicBlock *entry = getEntry(), *exit = getExit();
123 if (!exit)
127 && !(DT->dominates(exit, BB) && DT->dominates(entry, exit)));
188 BasicBlock *exit = getExit();
192 if (!exit)
195 for (pred_iterator PI = pred_begin(exit), PE = pred_end(exit); PI != PE;
241 BasicBlock *entry = getEntry(), *exit = getExit();
244 if (!contains(*SI) && exit != *SI)
254 BasicBlock *exit = getExit();
261 if (*SI != exit && visited->find(*SI) == visited->end())
383 assert(I != children.end() && "Region does not exit. Unable to remove.");
398 unsigned NumSuccessors = exit->getTerminator()->getNumSuccessors();
408 Region *R = RI->getRegionFor(exit);
410 if (R->getEntry() != exit) {
411 if (exit->getTerminator()->getNumSuccessors() == 1)
412 return new Region(getEntry(), *succ_begin(exit), RI, DT);
417 while (R->getParent() && R->getParent()->getEntry() == exit)
484 BasicBlock *exit) const {
487 if (DT->dominates(entry, P) && !DT->dominates(exit, P))
493 bool RegionInfo::isRegion(BasicBlock *entry, BasicBlock *exit) const {
494 assert(entry && exit && "entry and exit must not be null!");
499 // Exit is the header of a loop that contains the entry. In this case,
500 // the dominance frontier must only contain the exit.
501 if (!DT->dominates(entry, exit)) {
504 if (*SI != exit && *SI != entry)
510 DST *exitSuccs = &DF->find(exit)->second;
515 if (*SI == exit || *SI == entry)
519 if (!isCommonDomFrontier(*SI, entry, exit))
526 if (DT->properlyDominates(entry, *SI) && *SI != exit)
533 void RegionInfo::insertShortCut(BasicBlock *entry, BasicBlock *exit,
535 assert(entry && exit && "entry and exit must not be null!");
537 BBtoBBMap::iterator e = ShortCut->find(exit);
540 // No further region at exit available.
541 (*ShortCut)[entry] = exit;
543 // We found a region e that starts at exit. Therefore (entry, e->second)
544 // is also a region, that is larger than (entry, exit). Insert the
561 bool RegionInfo::isTrivialRegion(BasicBlock *entry, BasicBlock *exit) const {
562 assert(entry && exit && "entry and exit must not be null!");
566 if (num_successors <= 1 && exit == *(succ_begin(entry)))
579 Region *RegionInfo::createRegion(BasicBlock *entry, BasicBlock *exit) {
580 assert(entry && exit && "entry and exit must not be null!");
582 if (isTrivialRegion(entry, exit))
585 Region *region = new Region(entry, exit, this, DT);
612 BasicBlock *exit = N->getBlock();
614 if (!exit)
617 if (isRegion(entry, exit)) {
618 Region *newRegion = createRegion(entry, exit);
624 lastExit = exit;
628 if (!DT->dominates(entry, exit))
662 // Passed region exit
699 // ShortCut a function where for every BB the exit of the largest region
762 BasicBlock *Exit = NULL;
770 // Get the single exit of BB.
772 Exit = R->getExit();
774 Exit = *succ_begin(BB);
775 else // No single exit exists.
776 return Exit;
778 // Get largest region that starts at Exit.
779 Region *ExitR = getRegionFor(Exit);
781 && ExitR->getParent()->getEntry() == Exit)
784 for (pred_iterator PI = pred_begin(Exit), PE = pred_end(Exit); PI != PE;
790 if (DT->dominates(Exit, BB))
793 BB = Exit;
796 return Exit;
851 "Detect single entry single exit regions", true, true)
856 "Detect single entry single exit regions", true, true)