[PATCH] D76132: [LoopUnrollAndJam] Changed safety checks to consider more than 2-levels loop nest.

Whitney Tsang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 17:17:42 PDT 2020


Whitney marked 3 inline comments as done.
Whitney added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp:766
+
+static bool isEligibleLoopForm(const Loop &Root) {
+  // Root must have a child.
----------------
Meinersbur wrote:
> Can the following be handled correctly?
>  * Multiple exits
> 
I think it should, but I will write a LIT test to be sure. Only one AftBlock is allowed in the outermostloop.


================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp:777
+
+    if (!L->isRotatedForm())
+      return false;
----------------
Meinersbur wrote:
> Why is rotated form necessary?
It was there before:
```
if (Latch != Exit)
  return false;
if (SubLoopLatch != SubLoopExit)
  return false;
```
But at that time the function `isRotatedForm` wasn't exist.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76132





More information about the llvm-commits mailing list