[PATCH] D93716: [LoopDeletion] Also consider loops with subloops for deletion.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 06:55:10 PST 2021


fhahn added a comment.

In D93716#2468772 <https://reviews.llvm.org/D93716#2468772>, @reames wrote:

> LGTM
>
> Reading through the code, I had a couple of separate thoughts.  If you're interested, feel free to follow up on these.  If not, feel free to disregard.
>
> 1. It's not clear to my why the unreachable loop case requires an exit block.  That seems like an overly strict check for the transformation.
>
> 2. I was surprised we didn't break the backedge of loops with exit count == 0.  This isn't strictly loop deletion, but it sure seems analogous.  We seem to rely on simplifycfg for this today which seems likely to cause pass ordering problems.
>
> 3. Extending the invariant case to handle multiple exits where all but one are trivially dead might be useful.  (IndVarSimplify likes to produce exactly that form.  Again, we rely on simplifycfg for cleanup before loop deletion and thus pass ordering is an issue.)

Thank you very much for taking a loop Philip!

Thanks for also sharing the additional thoughts, I'll try to look into them when I have a bit more time. IIUC 2) is already fixed by D93906 <https://reviews.llvm.org/D93906>.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93716



More information about the llvm-commits mailing list