[PATCH] D75013: [LoopTerminology] Rotated Loops

Stefanos Baziotis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 23 04:20:48 PST 2020


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


================
Comment at: llvm/docs/LoopTerminology.rst:161-163
+Loops are rotated by the loop-rotate pass. The purpose
+of this transformation is to convert loops into
+do/while style loops. Example:
----------------
Meinersbur wrote:
> Converting to do/while style is a description of loop-rotation. One of the purposes is to allow hoisting invariant loads into the preheader. In non-rotated loops, a load in the preaheader would be executed even if the memory was never accessed in the original loop.
Oh, because you might do no iterations at all right? So, with the do-while, you'll do at least once. Regarding the wording, is this better?
"Loops are rotated by the loop-rotate pass, which converts loops into do/while style loops."
Then follow with examples and then mention the purposes. Also, should I add to the purposes that a latch block is an exiting block (and that this is useful to loop fusion) ? Although, as I stated in the comment, I have not completely understood this part with the latch.


================
Comment at: llvm/docs/LoopTerminology.rst:197
+a single successor, which implies that the loop latch
+is also an exiting block. It is done by the `loop-rotate`
+pass.
----------------
Meinersbur wrote:
> The LoopRotate pass was already mentioned at the beginning. Maybe you could also link to https://llvm.org/docs/Passes.html#loop-rotate-rotate-loops.
Yes, my bad, I forgot I had mentioned in the beginning, I'll put the link there.


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

https://reviews.llvm.org/D75013





More information about the llvm-commits mailing list