[PATCH] D101374: [LV] Consider Loop Unroll Hints When Making Interleave Decisions

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 28 13:25:42 PDT 2021


Meinersbur accepted this revision.
Meinersbur added a comment.
This revision is now accepted and ready to land.

LGTM, after some in-source comment about the motivation is added.

In D101374#2721310 <https://reviews.llvm.org/D101374#2721310>, @bmahjour wrote:

> Note that `hasUnrollTransformation` does not take `llvm.loop.unroll.runtime.disable` into account. I think that's ok for now, since clang doesn't seem to be generating that MD and we only use it for marking epilogue loops. We could add that in the future as a separate patch, if the need arises.

It based that function on what Clang generates. `llvm.loop.unroll.runtime.disable` would still allow full unrolling, so it does not fit directly into an enable/disable scheme. Maybe we'd need separate `hasFullUnrollTransformation` and `hasPartialUnrollTransformation` functions. Patch welcome.



================
Comment at: llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h:117
+      return Interleave.Value;
+    if (llvm::hasUnrollTransformation(TheLoop) & TM_Disable)
+      return 1;
----------------
Could you add a comment about what the intention of this is?
Suggestion:
```
// If interleaving is not explicitly set, assume that if we do not want unrolling, we also don't want any interleaving.
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101374



More information about the llvm-commits mailing list