[PATCH] D91718: [LV] Legalize scalable VF hints

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 11 08:16:03 PST 2020


sdesmalen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5574
+    // Nothing to do if there are no dependencies.
+    if (MaxSafeVectorWidthInBits >= UINT_MAX)
       return UserVF;
----------------
c-rhodes wrote:
> sdesmalen wrote:
> > MaxSafeVectorWidthInBits can't exceed UINT_MAX. If this this early bail out isn't strictly necessary, I'd suggest removing it.
> > MaxSafeVectorWidthInBits can't exceed UINT_MAX. If this this early bail out isn't strictly necessary, I'd suggest removing it.
> 
> There's a couple of existing tests:
> * Transforms/LoopVectorize/scalable-loop-unpredicated-body-scalar-tail.ll
> * Transforms/LoopVectorize/metadata-width.ll
> that will fall over if the hint is ignored when scalable vectorization isn't supported. I suppose those could become target-specific tests.
If the test has a loop-carried distance that may invalidate auto-vectorization that needs checking, I think it's fair enough for the test to be moved to be a target-specific test (because that will require `getMaxVScale`).

For a test like metadata-width.ll it may be useful to add some `-force-target-supports-scalable-vectors=true` flag to avoid making all scalable-vector tests for the LoopVectorizer target-specific.

@fhahn do you have any strong feelings about this?


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

https://reviews.llvm.org/D91718



More information about the llvm-commits mailing list