[PATCH] D74989: [LoopTerminology] Loop Simplify Form

Stefanos Baziotis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 16:11:52 PST 2020


baziotis marked 2 inline comments as done.
baziotis added a comment.

In D74989#1887597 <https://reviews.llvm.org/D74989#1887597>, @Meinersbur wrote:

> In D74989#1887573 <https://reviews.llvm.org/D74989#1887573>, @baziotis wrote:
>
> > Oh thanks, I didn't know that. So, closing. Can I add any part that is not addressed in this draft? For example, rotated loops
> >  I think aren't and personally I feel they really need doc.
>
>
> I think the author abandoned it. In the current state it looks more like a API reference.


Yes, just saw the date. Ok, I'll continue with this.



================
Comment at: llvm/docs/LoopTerminology.rst:147-149
+The Loop Simplify Form is a canonical form that makes
+several analyses and transformations simpler and more effective.
+For a loop to be in Loop Simplify Form, it must have:
----------------
Meinersbur wrote:
> Could you add that the LoopSimplify (`-loop-simplify`) pass ensures this form and is automatically added by the pass managers when scheduling a LoopPass?
Of course.


================
Comment at: llvm/docs/LoopTerminology.rst:152
+* A preheader.
+* A latch which must also be the only backedge.
+* Dedicated exists. That is, no exit block for the loop
----------------
Meinersbur wrote:
> [serious] There can be a single latch with multiple edges to the header (e.g. a switch)
Like this?
```
3:
  // whatever
  switch i32 %something, label %whatever [
    i32 1, label %3
    i32 2, label %3
  ]
```
In that case though, isn't the doc in `LoopSimplify.h` wrong?
"This pass also guarantees that loops will have exactly one backedge."
Assuming that a latch is a backedge, I figured it should be the only one, what do I miss?


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

https://reviews.llvm.org/D74989





More information about the llvm-commits mailing list