[PATCH] D63885: [LOOPINFO] Introduce the loop guard API.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 12:15:25 PDT 2019


Meinersbur added inline comments.


================
Comment at: llvm/lib/Analysis/LoopInfo.cpp:418-419
+      // loops.
+      if (!Succ->getUniqueSuccessor())
+        return true;
+
----------------
Whitney wrote:
> Meinersbur wrote:
> > With this added, we don't need a DominatorTree anymore. Any guard will directly branch into the header (or a series of unconditional branches such as the preheader).
> Without DominatorTree, how can we know a given branch will directly/indirectly branch into the header? It could be a branch after the loop. Did I miss something?
By following the loop header's predecessors until there is a non-unconditional branch. With the restriction of not allowing conditional branches between guard and header, it's the only candidate for a loop guard.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63885/new/

https://reviews.llvm.org/D63885





More information about the llvm-commits mailing list