[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:48:54 PDT 2017
efriedma added inline comments.
================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:1086
+ // is always guaranteed to execute.
+ if (ExitBlocks.empty() && Inst.getParent() != CurLoop->getHeader())
return false;
----------------
efriedma wrote:
> 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.
Err, wait, no, sorry, the check would be that Inst dominates the backedge, and there isn't any infinite loop between the start of the loop and the backedge. I guess just checking whether Inst is in the header is good enough for now.
https://reviews.llvm.org/D32720
More information about the llvm-commits
mailing list