[PATCH] D75013: [LoopTerminology] Rotated Loops

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 12:00:48 PDT 2020


Meinersbur added inline comments.


================
Comment at: llvm/docs/LoopTerminology.rst:325
+because loop-rotate triggers the
+:ref:`-loop-simplify <loop-terminology-loop-simplify>` pass to run.
+In this case, it inserted the %loop.preheader basic block so
----------------
baziotis wrote:
> Meinersbur wrote:
> > [nit] please make clear that -loop-simplify runs //before// -loop-rotate.
> Actually, related to the other comment I wrote, it seems to me that running LoopSimplify before LoopRotate will have no effect. Probably this effect was done because LoopSimplify was ran after. And since LoopRotate broke the form, the //after// LoopSimplify is the one that changed it.
LoopRotation, at least in the legacy pass manager, depends on LoopSimplify (https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Scalar/LoopRotation.cpp#L86), so it will have run when entering LoopRotation. There might be other executions of LoopSimplify added to the pass manager (which then will have no effect)

Also LoopRotation bails out if not in simplified form: https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp#L324

Moreover, LoopRotation ensures simplified form after rotation: https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp#L561


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

https://reviews.llvm.org/D75013





More information about the llvm-commits mailing list