[PATCH] D94378: [LoopDeletion] Handle inner loops w/untaken backedges

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 14:51:12 PST 2021


reames added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUtils.cpp:805
+  // loop which might have a had a block removed.
+  if (OutermostLoop != L)
+    formLCSSARecursively(*OutermostLoop, DT, &LI, &SE);
----------------
fhahn wrote:
> From the arguments, it seems like `changeToUnreachable` at least tries to preserve LCSSA, but clearly misses the case at hand. I've not looked at the details on what exactly needs updating Do you think it would be possible to directly fix the values broken after removing the block?
We're introducing a whole new set of exit blocks which used to be inside the loop.  We either have to scan all defs in the loop (which this does), or all uses in the blocks removed from the loop.  Is the later any better than the former?  The former has the benefit that we can reuse existing code.  (Remember we have to do this for all loop levels, so it's slightly tricky.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94378



More information about the llvm-commits mailing list