[PATCH] D146128: [SVE][LoopVectorize] Add option to disable tail-folding for reverse loops

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 24 06:33:34 PDT 2023


sdesmalen accepted this revision.
sdesmalen added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:3402
+                         .value_or(0);
+        if (Stride == -1)
+          return true;
----------------
david-arm wrote:
> sdesmalen wrote:
> > Does it also need to return `true` for Strides < -1?
> In practice if abs(Stride) > 1 we will always version the loop and only enter the vectorised loop if abs(Stride)==1, but checking for all values < 0 doesn't do any harm.
> In practice if abs(Stride) > 1 we will always version the loop and only enter the vectorised loop if abs(Stride)==1
I thought that's only the case when the stride of the induction variable is unknown. It's still possible to use LD2/3/4 for known strides > 1 or vectorize a loop using gathers.


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

https://reviews.llvm.org/D146128



More information about the llvm-commits mailing list