[PATCH] D75013: [LoopTerminology] Rotated Loops

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 19:26:18 PDT 2020


Meinersbur added inline comments.


================
Comment at: llvm/docs/LoopTerminology.rst:392
+    } while (i < n);
+  }
----------------
baziotis wrote:
> I should make clear here that such movement of code does not happen from `-loop-rotate` (but e.g. LICM). Although we should be careful on the wording because LoopRotate //does// [[ https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp#L397 | move some code  ]]. As matter of fact though, I don't understand this: https://godbolt.org/z/hgYhHX
> `%invcond` doesn't write to / read from memory, has invariant operands, is not a terminator and is not debuginfo intrinsic.
> So, I don't get why it isn't moved outside, I'll take a look tomorrow.
> I should make clear here that such movement of code does not happen from -loop-rotate 

Yes, that would be good.

> because LoopRotate does move some code.

good catch!

> %invcond doesn't write to / read from memory, has invariant operands, is not a terminator and is not debuginfo intrinsic.

The current implementation is limited to only look loop header. If moving %invconv to the header, we get: https://godbolt.org/z/hmodWG


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

https://reviews.llvm.org/D75013





More information about the llvm-commits mailing list