[PATCH] D47624: [SimpleLoopUnswitch] Invalidate SCEV after making structural changes to a loop

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 3 20:41:43 PDT 2018


mkazantsev added inline comments.


================
Comment at: lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:2017
+  if (Changed && !L->isInvalid())
+    if (auto *SEWP = getAnalysisIfAvailable<ScalarEvolutionWrapperPass>())
+      SEWP->getSE().forgetTopmostLoop(L);
----------------
chandlerc wrote:
> We need this to happen for both pass managers. I would suggest passing SCEV into unswitchLoop for both and sinking this invalidation into that common code.
I agree that we should do it, however we need to get rid of this `isInvalid()` check before. Once this code becomes just `if (Changed)`, we can sink it to the common part. I will add a TODO on that.


https://reviews.llvm.org/D47624





More information about the llvm-commits mailing list