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

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 27 01:07:45 PDT 2023


david-arm marked 3 inline comments as done.
david-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:3402
+                         .value_or(0);
+        if (Stride == -1)
+          return true;
----------------
dmgreen wrote:
> sdesmalen wrote:
> > 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.
> I think it will use gathers for <= -2. At least that is what it does for MVE, it may depend on the costs.
Yeah, you're both right @dmgreen and @sdesmalen, for some reason I was getting mixed up with unknown strides. :confused.


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

https://reviews.llvm.org/D146128



More information about the llvm-commits mailing list