[PATCH] D32720: [LICM] Introduce a finer granularity option to compute early exits.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 14:01:29 PDT 2017


efriedma added inline comments.


================
Comment at: include/llvm/Transforms/Utils/OrderedInstructions.h:40
+  /// Constructors.
+  OrderedInstructions() = default;
   OrderedInstructions(DominatorTree *DT) : DT(DT) {}
----------------
Not sure I like this constructor... easy to misuse.


================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:1086
+  // is always guaranteed to execute.
+  if (ExitBlocks.empty() && Inst.getParent() != CurLoop->getHeader())
     return false;
----------------
See the FIXME below... but I guess there's another way to do this check: if Inst dominates the backedge, then it's guaranteed to execute even if the loop is infinite.  A bit more general than checking that the parent is exactly the header.


https://reviews.llvm.org/D32720





More information about the llvm-commits mailing list