[PATCH] D60093: [LoopPredication] Allow predication of loop invariant computations

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 08:52:23 PDT 2019


reames marked an inline comment as done.
reames added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopPredication.cpp:478
+    if (!SE->isLoopInvariant(Op, L) ||
+        !isSafeToExpandAt(Op, Preheader->getTerminator(), *SE))
       return Use;
----------------
reames wrote:
> apilipenko wrote:
> > Am I right that this is not specific to the change you make and just a fix for an existing bug? If so,  can be integrated separately with a test demonstrating the problem.
> You are correct, and I'd completely missed that when writing.  Will do!
Actually, no.  On further reflection, this is a silent bug without the rest of this change.  All of the operands to the expressions we call this on have previously been checked via isSafeToSpeculate.  It's only with this change that we weaken that precondition and expose the latent issue.  Given that, I'm not going to submit this separately.


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

https://reviews.llvm.org/D60093





More information about the llvm-commits mailing list