Home | History | Annotate | Download | only in Analysis

Lines Matching defs:exit

9 // Detects single entry single exit regions in the control flow graph.
34 RegionBase<Tr>::RegionBase(BlockT *Entry, BlockT *Exit,
37 : RegionNodeBase<Tr>(Parent, Entry, 1), RI(RInfo), DT(dt), exit(Exit) {}
53 assert(exit && "No exit to replace!");
54 exit = BB;
100 BlockT *entry = getEntry(), *exit = getExit();
103 if (!exit)
107 !(DT->dominates(exit, BB) && DT->dominates(entry, exit)));
172 BlockT *exit = getExit();
175 if (!exit)
178 for (BlockT *Pred : make_range(InvBlockTraits::child_begin(exit),
179 InvBlockTraits::child_end(exit))) {
226 BlockT *entry = getEntry(), *exit = getExit();
230 if (!contains(Succ) && exit != Succ)
232 "to the exit node!");
247 BlockT *exit = getExit();
255 if (Succ != exit && visited->find(Succ) == visited->end())
408 assert(I != children.end() && "Region does not exit. Unable to remove.");
425 unsigned NumSuccessors = Tr::getNumSuccessors(exit);
430 RegionT *R = RI->getRegionFor(exit);
432 if (R->getEntry() != exit) {
437 if (Tr::getNumSuccessors(exit) == 1)
438 return new RegionT(getEntry(), *BlockTraits::child_begin(exit), RI, DT);
442 while (R->getParent() && R->getParent()->getEntry() == exit)
533 BlockT *exit) const {
536 if (DT->dominates(entry, P) && !DT->dominates(exit, P))
544 bool RegionInfoBase<Tr>::isRegion(BlockT *entry, BlockT *exit) const {
545 assert(entry && exit && "entry and exit must not be null!");
550 // Exit is the header of a loop that contains the entry. In this case,
551 // the dominance frontier must only contain the exit.
552 if (!DT->dominates(entry, exit)) {
556 if (*SI != exit && *SI != entry)
563 DST *exitSuccs = &DF->find(exit)->second;
567 if (Succ == exit || Succ == entry)
571 if (!isCommonDomFrontier(Succ, entry, exit))
577 if (DT->properlyDominates(entry, Succ) && Succ != exit)
585 void RegionInfoBase<Tr>::insertShortCut(BlockT *entry, BlockT *exit,
587 assert(entry && exit && "entry and exit must not be null!");
589 typename BBtoBBMap::iterator e = ShortCut->find(exit);
592 // No further region at exit available.
593 (*ShortCut)[entry] = exit;
595 // We found a region e that starts at exit. Therefore (entry, e->second)
596 // is also a region, that is larger than (entry, exit). Insert the
615 bool RegionInfoBase<Tr>::isTrivialRegion(BlockT *entry, BlockT *exit) const {
616 assert(entry && exit && "entry and exit must not be null!");
621 if (num_successors <= 1 && exit == *(BlockTraits::child_begin(entry)))
629 BlockT *exit) {
630 assert(entry && exit && "entry and exit must not be null!");
632 if (isTrivialRegion(entry, exit))
636 new RegionT(entry, exit, static_cast<RegionInfoT *>(this), DT);
664 BlockT *exit = N->getBlock();
666 if (!exit)
669 if (isRegion(entry, exit)) {
670 RegionT *newRegion = createRegion(entry, exit);
676 lastExit = exit;
680 if (!DT->dominates(entry, exit))
716 // Passed region exit
801 BlockT *Exit = nullptr;
809 // Get the single exit of BB.
811 Exit = R->getExit();
813 Exit = *BlockTraits::child_begin(BB);
814 else // No single exit exists.
815 return Exit;
817 // Get largest region that starts at Exit.
818 RegionT *ExitR = getRegionFor(Exit);
820 ExitR->getParent()->getEntry() == Exit)
823 for (BlockT *Pred : make_range(InvBlockTraits::child_begin(Exit),
824 InvBlockTraits::child_end(Exit))) {
830 if (DT->dominates(Exit, BB))
833 BB = Exit;
836 return Exit;
881 // ShortCut a function where for every BB the exit of the largest region