1 //===- RegionInfoImpl.h - SESE region detection analysis --------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
9 // Detects single entry single exit regions in the control flow graph.
10 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_ANALYSIS_REGIONINFOIMPL_H
13 #define LLVM_ANALYSIS_REGIONINFOIMPL_H
15 #include "llvm/ADT/PostOrderIterator.h"
16 #include "llvm/Analysis/DominanceFrontier.h"
17 #include "llvm/Analysis/LoopInfo.h"
18 #include "llvm/Analysis/PostDominators.h"
19 #include "llvm/Analysis/RegionInfo.h"
20 #include "llvm/Analysis/RegionIterator.h"
21 #include "llvm/Support/CommandLine.h"
22 #include "llvm/Support/Debug.h"
23 #include "llvm/Support/ErrorHandling.h"
30 #define DEBUG_TYPE "region"
32 //===----------------------------------------------------------------------===//
33 /// RegionBase Implementation
35 RegionBase<Tr>::RegionBase(BlockT *Entry, BlockT *Exit,
36 typename Tr::RegionInfoT *RInfo, DomTreeT *dt,
38 : RegionNodeBase<Tr>(Parent, Entry, 1), RI(RInfo), DT(dt), exit(Exit) {}
41 RegionBase<Tr>::~RegionBase() {
42 // Free the cached nodes.
43 for (typename BBNodeMapT::iterator it = BBNodeMap.begin(),
48 // Only clean the cache for this Region. Caches of child Regions will be
49 // cleaned when the child Regions are deleted.
54 void RegionBase<Tr>::replaceEntry(BlockT *BB) {
55 this->entry.setPointer(BB);
59 void RegionBase<Tr>::replaceExit(BlockT *BB) {
60 assert(exit && "No exit to replace!");
65 void RegionBase<Tr>::replaceEntryRecursive(BlockT *NewEntry) {
66 std::vector<RegionT *> RegionQueue;
67 BlockT *OldEntry = getEntry();
69 RegionQueue.push_back(static_cast<RegionT *>(this));
70 while (!RegionQueue.empty()) {
71 RegionT *R = RegionQueue.back();
72 RegionQueue.pop_back();
74 R->replaceEntry(NewEntry);
75 for (typename RegionT::const_iterator RI = R->begin(), RE = R->end();
77 if ((*RI)->getEntry() == OldEntry)
78 RegionQueue.push_back(RI->get());
84 void RegionBase<Tr>::replaceExitRecursive(BlockT *NewExit) {
85 std::vector<RegionT *> RegionQueue;
86 BlockT *OldExit = getExit();
88 RegionQueue.push_back(static_cast<RegionT *>(this));
89 while (!RegionQueue.empty()) {
90 RegionT *R = RegionQueue.back();
91 RegionQueue.pop_back();
93 R->replaceExit(NewExit);
94 for (typename RegionT::const_iterator RI = R->begin(), RE = R->end();
96 if ((*RI)->getExit() == OldExit)
97 RegionQueue.push_back(RI->get());
103 bool RegionBase<Tr>::contains(const BlockT *B) const {
104 BlockT *BB = const_cast<BlockT *>(B);
106 if (!DT->getNode(BB))
109 BlockT *entry = getEntry(), *exit = getExit();
115 return (DT->dominates(entry, BB) &&
116 !(DT->dominates(exit, BB) && DT->dominates(entry, exit)));
120 bool RegionBase<Tr>::contains(const LoopT *L) const {
121 // BBs that are not part of any loop are element of the Loop
122 // described by the NULL pointer. This loop is not part of any region,
123 // except if the region describes the whole function.
125 return getExit() == nullptr;
127 if (!contains(L->getHeader()))
130 SmallVector<BlockT *, 8> ExitingBlocks;
131 L->getExitingBlocks(ExitingBlocks);
133 for (BlockT *BB : ExitingBlocks) {
142 typename Tr::LoopT *RegionBase<Tr>::outermostLoopInRegion(LoopT *L) const {
146 while (L && contains(L->getParentLoop())) {
147 L = L->getParentLoop();
154 typename Tr::LoopT *RegionBase<Tr>::outermostLoopInRegion(LoopInfoT *LI,
156 assert(LI && BB && "LI and BB cannot be null!");
157 LoopT *L = LI->getLoopFor(BB);
158 return outermostLoopInRegion(L);
162 typename RegionBase<Tr>::BlockT *RegionBase<Tr>::getEnteringBlock() const {
163 BlockT *entry = getEntry();
165 BlockT *enteringBlock = nullptr;
167 for (PredIterTy PI = InvBlockTraits::child_begin(entry),
168 PE = InvBlockTraits::child_end(entry);
171 if (DT->getNode(Pred) && !contains(Pred)) {
175 enteringBlock = Pred;
179 return enteringBlock;
183 typename RegionBase<Tr>::BlockT *RegionBase<Tr>::getExitingBlock() const {
184 BlockT *exit = getExit();
186 BlockT *exitingBlock = nullptr;
191 for (PredIterTy PI = InvBlockTraits::child_begin(exit),
192 PE = InvBlockTraits::child_end(exit);
195 if (contains(Pred)) {
207 bool RegionBase<Tr>::isSimple() const {
208 return !isTopLevelRegion() && getEnteringBlock() && getExitingBlock();
212 std::string RegionBase<Tr>::getNameStr() const {
213 std::string exitName;
214 std::string entryName;
216 if (getEntry()->getName().empty()) {
217 raw_string_ostream OS(entryName);
219 getEntry()->printAsOperand(OS, false);
221 entryName = getEntry()->getName();
224 if (getExit()->getName().empty()) {
225 raw_string_ostream OS(exitName);
227 getExit()->printAsOperand(OS, false);
229 exitName = getExit()->getName();
231 exitName = "<Function Return>";
233 return entryName + " => " + exitName;
237 void RegionBase<Tr>::verifyBBInRegion(BlockT *BB) const {
239 llvm_unreachable("Broken region found: enumerated BB not in region!");
241 BlockT *entry = getEntry(), *exit = getExit();
243 for (SuccIterTy SI = BlockTraits::child_begin(BB),
244 SE = BlockTraits::child_end(BB);
246 if (!contains(*SI) && exit != *SI)
247 llvm_unreachable("Broken region found: edges leaving the region must go "
248 "to the exit node!");
252 for (PredIterTy SI = InvBlockTraits::child_begin(BB),
253 SE = InvBlockTraits::child_end(BB);
256 llvm_unreachable("Broken region found: edges entering the region must "
257 "go to the entry node!");
263 void RegionBase<Tr>::verifyWalk(BlockT *BB, std::set<BlockT *> *visited) const {
264 BlockT *exit = getExit();
268 verifyBBInRegion(BB);
270 for (SuccIterTy SI = BlockTraits::child_begin(BB),
271 SE = BlockTraits::child_end(BB);
273 if (*SI != exit && visited->find(*SI) == visited->end())
274 verifyWalk(*SI, visited);
279 void RegionBase<Tr>::verifyRegion() const {
280 // Only do verification when user wants to, otherwise this expensive check
281 // will be invoked by PMDataManager::verifyPreservedAnalysis when
282 // a regionpass (marked PreservedAll) finish.
283 if (!RegionInfoBase<Tr>::VerifyRegionInfo)
286 std::set<BlockT *> visited;
287 verifyWalk(getEntry(), &visited);
291 void RegionBase<Tr>::verifyRegionNest() const {
292 for (typename RegionT::const_iterator RI = begin(), RE = end(); RI != RE;
294 (*RI)->verifyRegionNest();
300 typename RegionBase<Tr>::element_iterator RegionBase<Tr>::element_begin() {
301 return GraphTraits<RegionT *>::nodes_begin(static_cast<RegionT *>(this));
305 typename RegionBase<Tr>::element_iterator RegionBase<Tr>::element_end() {
306 return GraphTraits<RegionT *>::nodes_end(static_cast<RegionT *>(this));
310 typename RegionBase<Tr>::const_element_iterator
311 RegionBase<Tr>::element_begin() const {
312 return GraphTraits<const RegionT *>::nodes_begin(
313 static_cast<const RegionT *>(this));
317 typename RegionBase<Tr>::const_element_iterator
318 RegionBase<Tr>::element_end() const {
319 return GraphTraits<const RegionT *>::nodes_end(
320 static_cast<const RegionT *>(this));
324 typename Tr::RegionT *RegionBase<Tr>::getSubRegionNode(BlockT *BB) const {
325 typedef typename Tr::RegionT RegionT;
326 RegionT *R = RI->getRegionFor(BB);
331 // If we pass the BB out of this region, that means our code is broken.
332 assert(contains(R) && "BB not in current region!");
334 while (contains(R->getParent()) && R->getParent() != this)
337 if (R->getEntry() != BB)
344 typename Tr::RegionNodeT *RegionBase<Tr>::getBBNode(BlockT *BB) const {
345 assert(contains(BB) && "Can get BB node out of this region!");
347 typename BBNodeMapT::const_iterator at = BBNodeMap.find(BB);
349 if (at != BBNodeMap.end())
352 auto Deconst = const_cast<RegionBase<Tr> *>(this);
353 RegionNodeT *NewNode = new RegionNodeT(static_cast<RegionT *>(Deconst), BB);
354 BBNodeMap.insert(std::make_pair(BB, NewNode));
359 typename Tr::RegionNodeT *RegionBase<Tr>::getNode(BlockT *BB) const {
360 assert(contains(BB) && "Can get BB node out of this region!");
361 if (RegionT *Child = getSubRegionNode(BB))
362 return Child->getNode();
364 return getBBNode(BB);
368 void RegionBase<Tr>::transferChildrenTo(RegionT *To) {
369 for (iterator I = begin(), E = end(); I != E; ++I) {
371 To->children.push_back(std::move(*I));
377 void RegionBase<Tr>::addSubRegion(RegionT *SubRegion, bool moveChildren) {
378 assert(!SubRegion->parent && "SubRegion already has a parent!");
379 assert(std::find_if(begin(), end(), [&](const std::unique_ptr<RegionT> &R) {
380 return R.get() == SubRegion;
381 }) == children.end() &&
382 "Subregion already exists!");
384 SubRegion->parent = static_cast<RegionT *>(this);
385 children.push_back(std::unique_ptr<RegionT>(SubRegion));
390 assert(SubRegion->children.empty() &&
391 "SubRegions that contain children are not supported");
393 for (element_iterator I = element_begin(), E = element_end(); I != E; ++I) {
394 if (!(*I)->isSubRegion()) {
395 BlockT *BB = (*I)->template getNodeAs<BlockT>();
397 if (SubRegion->contains(BB))
398 RI->setRegionFor(BB, SubRegion);
402 std::vector<std::unique_ptr<RegionT>> Keep;
403 for (iterator I = begin(), E = end(); I != E; ++I) {
404 if (SubRegion->contains(I->get()) && I->get() != SubRegion) {
405 (*I)->parent = SubRegion;
406 SubRegion->children.push_back(std::move(*I));
408 Keep.push_back(std::move(*I));
414 std::move_iterator<typename RegionSet::iterator>(Keep.begin()),
415 std::move_iterator<typename RegionSet::iterator>(Keep.end()));
419 typename Tr::RegionT *RegionBase<Tr>::removeSubRegion(RegionT *Child) {
420 assert(Child->parent == this && "Child is not a child of this region!");
421 Child->parent = nullptr;
422 typename RegionSet::iterator I = std::find_if(
423 children.begin(), children.end(),
424 [&](const std::unique_ptr<RegionT> &R) { return R.get() == Child; });
425 assert(I != children.end() && "Region does not exit. Unable to remove.");
426 children.erase(children.begin() + (I - begin()));
431 unsigned RegionBase<Tr>::getDepth() const {
434 for (RegionT *R = getParent(); R != nullptr; R = R->getParent())
441 typename Tr::RegionT *RegionBase<Tr>::getExpandedRegion() const {
442 unsigned NumSuccessors = Tr::getNumSuccessors(exit);
444 if (NumSuccessors == 0)
447 RegionT *R = RI->getRegionFor(exit);
449 if (R->getEntry() != exit) {
450 for (PredIterTy PI = InvBlockTraits::child_begin(getExit()),
451 PE = InvBlockTraits::child_end(getExit());
455 if (Tr::getNumSuccessors(exit) == 1)
456 return new RegionT(getEntry(), *BlockTraits::child_begin(exit), RI, DT);
460 while (R->getParent() && R->getParent()->getEntry() == exit)
463 for (PredIterTy PI = InvBlockTraits::child_begin(getExit()),
464 PE = InvBlockTraits::child_end(getExit());
466 if (!(contains(*PI) || R->contains(*PI)))
470 return new RegionT(getEntry(), R->getExit(), RI, DT);
474 void RegionBase<Tr>::print(raw_ostream &OS, bool print_tree, unsigned level,
475 PrintStyle Style) const {
477 OS.indent(level * 2) << '[' << level << "] " << getNameStr();
479 OS.indent(level * 2) << getNameStr();
483 if (Style != PrintNone) {
484 OS.indent(level * 2) << "{\n";
485 OS.indent(level * 2 + 2);
487 if (Style == PrintBB) {
488 for (const auto *BB : blocks())
489 OS << BB->getName() << ", "; // TODO: remove the last ","
490 } else if (Style == PrintRN) {
491 for (const_element_iterator I = element_begin(), E = element_end();
493 OS << **I << ", "; // TODO: remove the last ",
501 for (const_iterator RI = begin(), RE = end(); RI != RE; ++RI)
502 (*RI)->print(OS, print_tree, level + 1, Style);
505 if (Style != PrintNone)
506 OS.indent(level * 2) << "} \n";
509 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
511 void RegionBase<Tr>::dump() const {
512 print(dbgs(), true, getDepth(), RegionInfoBase<Tr>::printStyle);
517 void RegionBase<Tr>::clearNodeCache() {
518 // Free the cached nodes.
519 for (typename BBNodeMapT::iterator I = BBNodeMap.begin(),
520 IE = BBNodeMap.end();
525 for (typename RegionT::iterator RI = begin(), RE = end(); RI != RE; ++RI)
526 (*RI)->clearNodeCache();
529 //===----------------------------------------------------------------------===//
530 // RegionInfoBase implementation
534 RegionInfoBase<Tr>::RegionInfoBase()
535 : TopLevelRegion(nullptr) {}
538 RegionInfoBase<Tr>::~RegionInfoBase() {
543 void RegionInfoBase<Tr>::verifyBBMap(const RegionT *R) const {
544 assert(R && "Re must be non-null");
545 for (auto I = R->element_begin(), E = R->element_end(); I != E; ++I) {
546 if (I->isSubRegion()) {
547 const RegionT *SR = I->template getNodeAs<RegionT>();
550 BlockT *BB = I->template getNodeAs<BlockT>();
551 if (getRegionFor(BB) != R)
552 llvm_unreachable("BB map does not match region nesting");
558 bool RegionInfoBase<Tr>::isCommonDomFrontier(BlockT *BB, BlockT *entry,
559 BlockT *exit) const {
560 for (PredIterTy PI = InvBlockTraits::child_begin(BB),
561 PE = InvBlockTraits::child_end(BB);
564 if (DT->dominates(entry, P) && !DT->dominates(exit, P))
572 bool RegionInfoBase<Tr>::isRegion(BlockT *entry, BlockT *exit) const {
573 assert(entry && exit && "entry and exit must not be null!");
574 typedef typename DomFrontierT::DomSetType DST;
576 DST *entrySuccs = &DF->find(entry)->second;
578 // Exit is the header of a loop that contains the entry. In this case,
579 // the dominance frontier must only contain the exit.
580 if (!DT->dominates(entry, exit)) {
581 for (typename DST::iterator SI = entrySuccs->begin(),
582 SE = entrySuccs->end();
584 if (*SI != exit && *SI != entry)
591 DST *exitSuccs = &DF->find(exit)->second;
593 // Do not allow edges leaving the region.
594 for (typename DST::iterator SI = entrySuccs->begin(), SE = entrySuccs->end();
596 if (*SI == exit || *SI == entry)
598 if (exitSuccs->find(*SI) == exitSuccs->end())
600 if (!isCommonDomFrontier(*SI, entry, exit))
604 // Do not allow edges pointing into the region.
605 for (typename DST::iterator SI = exitSuccs->begin(), SE = exitSuccs->end();
607 if (DT->properlyDominates(entry, *SI) && *SI != exit)
615 void RegionInfoBase<Tr>::insertShortCut(BlockT *entry, BlockT *exit,
616 BBtoBBMap *ShortCut) const {
617 assert(entry && exit && "entry and exit must not be null!");
619 typename BBtoBBMap::iterator e = ShortCut->find(exit);
621 if (e == ShortCut->end())
622 // No further region at exit available.
623 (*ShortCut)[entry] = exit;
625 // We found a region e that starts at exit. Therefore (entry, e->second)
626 // is also a region, that is larger than (entry, exit). Insert the
628 BlockT *BB = e->second;
629 (*ShortCut)[entry] = BB;
634 typename Tr::DomTreeNodeT *
635 RegionInfoBase<Tr>::getNextPostDom(DomTreeNodeT *N, BBtoBBMap *ShortCut) const {
636 typename BBtoBBMap::iterator e = ShortCut->find(N->getBlock());
638 if (e == ShortCut->end())
641 return PDT->getNode(e->second)->getIDom();
645 bool RegionInfoBase<Tr>::isTrivialRegion(BlockT *entry, BlockT *exit) const {
646 assert(entry && exit && "entry and exit must not be null!");
648 unsigned num_successors =
649 BlockTraits::child_end(entry) - BlockTraits::child_begin(entry);
651 if (num_successors <= 1 && exit == *(BlockTraits::child_begin(entry)))
658 typename Tr::RegionT *RegionInfoBase<Tr>::createRegion(BlockT *entry,
660 assert(entry && exit && "entry and exit must not be null!");
662 if (isTrivialRegion(entry, exit))
666 new RegionT(entry, exit, static_cast<RegionInfoT *>(this), DT);
667 BBtoRegion.insert(std::make_pair(entry, region));
670 region->verifyRegion();
672 DEBUG(region->verifyRegion());
675 updateStatistics(region);
680 void RegionInfoBase<Tr>::findRegionsWithEntry(BlockT *entry,
681 BBtoBBMap *ShortCut) {
684 DomTreeNodeT *N = PDT->getNode(entry);
688 RegionT *lastRegion = nullptr;
689 BlockT *lastExit = entry;
691 // As only a BasicBlock that postdominates entry can finish a region, walk the
692 // post dominance tree upwards.
693 while ((N = getNextPostDom(N, ShortCut))) {
694 BlockT *exit = N->getBlock();
699 if (isRegion(entry, exit)) {
700 RegionT *newRegion = createRegion(entry, exit);
703 newRegion->addSubRegion(lastRegion);
705 lastRegion = newRegion;
709 // This can never be a region, so stop the search.
710 if (!DT->dominates(entry, exit))
714 // Tried to create regions from entry to lastExit. Next time take a
715 // shortcut from entry to lastExit.
716 if (lastExit != entry)
717 insertShortCut(entry, lastExit, ShortCut);
721 void RegionInfoBase<Tr>::scanForRegions(FuncT &F, BBtoBBMap *ShortCut) {
722 typedef typename std::add_pointer<FuncT>::type FuncPtrT;
723 BlockT *entry = GraphTraits<FuncPtrT>::getEntryNode(&F);
724 DomTreeNodeT *N = DT->getNode(entry);
726 // Iterate over the dominance tree in post order to start with the small
727 // regions from the bottom of the dominance tree. If the small regions are
728 // detected first, detection of bigger regions is faster, as we can jump
729 // over the small regions.
730 for (auto DomNode : post_order(N))
731 findRegionsWithEntry(DomNode->getBlock(), ShortCut);
735 typename Tr::RegionT *RegionInfoBase<Tr>::getTopMostParent(RegionT *region) {
736 while (region->getParent())
737 region = region->getParent();
743 void RegionInfoBase<Tr>::buildRegionsTree(DomTreeNodeT *N, RegionT *region) {
744 BlockT *BB = N->getBlock();
746 // Passed region exit
747 while (BB == region->getExit())
748 region = region->getParent();
750 typename BBtoRegionMap::iterator it = BBtoRegion.find(BB);
752 // This basic block is a start block of a region. It is already in the
753 // BBtoRegion relation. Only the child basic blocks have to be updated.
754 if (it != BBtoRegion.end()) {
755 RegionT *newRegion = it->second;
756 region->addSubRegion(getTopMostParent(newRegion));
759 BBtoRegion[BB] = region;
762 for (typename DomTreeNodeT::iterator CI = N->begin(), CE = N->end(); CI != CE;
764 buildRegionsTree(*CI, region);
770 bool RegionInfoBase<Tr>::VerifyRegionInfo = true;
773 bool RegionInfoBase<Tr>::VerifyRegionInfo = false;
777 typename Tr::RegionT::PrintStyle RegionInfoBase<Tr>::printStyle =
778 RegionBase<Tr>::PrintNone;
781 void RegionInfoBase<Tr>::print(raw_ostream &OS) const {
782 OS << "Region tree:\n";
783 TopLevelRegion->print(OS, true, 0, printStyle);
784 OS << "End region tree\n";
787 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
789 void RegionInfoBase<Tr>::dump() const { print(dbgs()); }
793 void RegionInfoBase<Tr>::releaseMemory() {
796 delete TopLevelRegion;
797 TopLevelRegion = nullptr;
801 void RegionInfoBase<Tr>::verifyAnalysis() const {
802 // Do only verify regions if explicitely activated using XDEBUG or
803 // -verify-region-info
804 if (!RegionInfoBase<Tr>::VerifyRegionInfo)
807 TopLevelRegion->verifyRegionNest();
809 verifyBBMap(TopLevelRegion);
812 // Region pass manager support.
814 typename Tr::RegionT *RegionInfoBase<Tr>::getRegionFor(BlockT *BB) const {
815 typename BBtoRegionMap::const_iterator I = BBtoRegion.find(BB);
816 return I != BBtoRegion.end() ? I->second : nullptr;
820 void RegionInfoBase<Tr>::setRegionFor(BlockT *BB, RegionT *R) {
825 typename Tr::RegionT *RegionInfoBase<Tr>::operator[](BlockT *BB) const {
826 return getRegionFor(BB);
830 typename RegionInfoBase<Tr>::BlockT *
831 RegionInfoBase<Tr>::getMaxRegionExit(BlockT *BB) const {
832 BlockT *Exit = nullptr;
835 // Get largest region that starts at BB.
836 RegionT *R = getRegionFor(BB);
837 while (R && R->getParent() && R->getParent()->getEntry() == BB)
840 // Get the single exit of BB.
841 if (R && R->getEntry() == BB)
843 else if (++BlockTraits::child_begin(BB) == BlockTraits::child_end(BB))
844 Exit = *BlockTraits::child_begin(BB);
845 else // No single exit exists.
848 // Get largest region that starts at Exit.
849 RegionT *ExitR = getRegionFor(Exit);
850 while (ExitR && ExitR->getParent() &&
851 ExitR->getParent()->getEntry() == Exit)
852 ExitR = ExitR->getParent();
854 for (PredIterTy PI = InvBlockTraits::child_begin(Exit),
855 PE = InvBlockTraits::child_end(Exit);
857 if (!R->contains(*PI) && !ExitR->contains(*PI))
861 // This stops infinite cycles.
862 if (DT->dominates(Exit, BB))
872 typename Tr::RegionT *RegionInfoBase<Tr>::getCommonRegion(RegionT *A,
874 assert(A && B && "One of the Regions is NULL");
879 while (!B->contains(A))
886 typename Tr::RegionT *
887 RegionInfoBase<Tr>::getCommonRegion(SmallVectorImpl<RegionT *> &Regions) const {
888 RegionT *ret = Regions.back();
891 for (RegionT *R : Regions)
892 ret = getCommonRegion(ret, R);
898 typename Tr::RegionT *
899 RegionInfoBase<Tr>::getCommonRegion(SmallVectorImpl<BlockT *> &BBs) const {
900 RegionT *ret = getRegionFor(BBs.back());
903 for (BlockT *BB : BBs)
904 ret = getCommonRegion(ret, getRegionFor(BB));
910 void RegionInfoBase<Tr>::calculate(FuncT &F) {
911 typedef typename std::add_pointer<FuncT>::type FuncPtrT;
913 // ShortCut a function where for every BB the exit of the largest region
914 // starting with BB is stored. These regions can be threated as single BBS.
915 // This improves performance on linear CFGs.
918 scanForRegions(F, &ShortCut);
919 BlockT *BB = GraphTraits<FuncPtrT>::getEntryNode(&F);
920 buildRegionsTree(DT->getNode(BB), TopLevelRegion);
925 } // end namespace llvm