Home | History | Annotate | Download | only in Analysis

Lines Matching defs:exit

9 // Detects single entry single exit regions in the control flow graph.
56 Region::Region(BasicBlock *Entry, BasicBlock *Exit, RegionInfo* RInfo,
58 : RegionNode(Parent, Entry, 1), RI(RInfo), DT(dt), exit(Exit) {}
79 assert(exit && "No exit to replace!");
80 exit = BB;
88 BasicBlock *entry = getEntry(), *exit = getExit();
91 if (!exit)
95 && !(DT->dominates(exit, BB) && DT->dominates(entry, exit)));
156 BasicBlock *exit = getExit();
160 if (!exit)
163 for (pred_iterator PI = pred_begin(exit), PE = pred_end(exit); PI != PE;
211 BasicBlock *entry = getEntry(), *exit = getExit();
214 if (!contains(*SI) && exit != *SI)
224 BasicBlock *exit = getExit();
231 if (*SI != exit && visited->find(*SI) == visited->end())
369 assert(I != children.end() && "Region does not exit. Unable to remove.");
384 unsigned NumSuccessors = exit->getTerminator()->getNumSuccessors();
394 Region *R = RI->getRegionFor(exit);
396 if (R->getEntry() != exit) {
397 if (exit->getTerminator()->getNumSuccessors() == 1)
398 return new Region(getEntry(), *succ_begin(exit), RI, DT);
403 while (R->getParent() && R->getParent()->getEntry() == exit)
468 BasicBlock *exit) const {
471 if (DT->dominates(entry, P) && !DT->dominates(exit, P))
477 bool RegionInfo::isRegion(BasicBlock *entry, BasicBlock *exit) const {
478 assert(entry && exit && "entry and exit must not be null!");
483 // Exit is the header of a loop that contains the entry. In this case,
484 // the dominance frontier must only contain the exit.
485 if (!DT->dominates(entry, exit)) {
488 if (*SI != exit && *SI != entry)
494 DST *exitSuccs = &DF->find(exit)->second;
499 if (*SI == exit || *SI == entry)
503 if (!isCommonDomFrontier(*SI, entry, exit))
510 if (DT->properlyDominates(entry, *SI) && *SI != exit)
517 void RegionInfo::insertShortCut(BasicBlock *entry, BasicBlock *exit,
519 assert(entry && exit && "entry and exit must not be null!");
521 BBtoBBMap::iterator e = ShortCut->find(exit);
524 // No further region at exit available.
525 (*ShortCut)[entry] = exit;
527 // We found a region e that starts at exit. Therefore (entry, e->second)
528 // is also a region, that is larger than (entry, exit). Insert the
545 bool RegionInfo::isTrivialRegion(BasicBlock *entry, BasicBlock *exit) const {
546 assert(entry && exit && "entry and exit must not be null!");
550 if (num_successors <= 1 && exit == *(succ_begin(entry)))
563 Region *RegionInfo::createRegion(BasicBlock *entry, BasicBlock *exit) {
564 assert(entry && exit && "entry and exit must not be null!");
566 if (isTrivialRegion(entry, exit))
569 Region *region = new Region(entry, exit, this, DT);
596 BasicBlock *exit = N->getBlock();
598 if (!exit)
601 if (isRegion(entry, exit)) {
602 Region *newRegion = createRegion(entry, exit);
608 lastExit = exit;
612 if (!DT->dominates(entry, exit))
646 // Passed region exit
683 // ShortCut a function where for every BB the exit of the largest region
746 BasicBlock *Exit = NULL;
754 // Get the single exit of BB.
756 Exit = R->getExit();
758 Exit = *succ_begin(BB);
759 else // No single exit exists.
760 return Exit;
762 // Get largest region that starts at Exit.
763 Region *ExitR = getRegionFor(Exit);
765 && ExitR->getParent()->getEntry() == Exit)
768 for (pred_iterator PI = pred_begin(Exit), PE = pred_end(Exit); PI != PE;
774 if (DT->dominates(Exit, BB))
777 BB = Exit;
780 return Exit;
835 "Detect single entry single exit regions", true, true)
840 "Detect single entry single exit regions", true, true)