[PATCH] D146839: [TLI][AArch64] Extend SLEEF vectorized functions mapping with VLA functions

Paul Osmialowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 27 13:04:44 PDT 2023


pawosm01 marked an inline comment as done.
pawosm01 added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp:645
          ElementCount::isKnownLE(VF, WidestFixedVF); VF *= 2)
-      Scalarize &= !TLI.isFunctionVectorizable(ScalarName, VF);
+      Scalarize &= !TLI.isFunctionVectorizable(ScalarName, VF, false);
     for (ElementCount VF = ElementCount::getScalable(1);
----------------
sdesmalen wrote:
> I feel a bit uncomfortable about this code, because there may be two variants available, a masked and an unmasked variant, where one may be vectorizable and the other one is not. I wonder if `isFunctionVectorizable` should return `true` when `false` is passed there is a predicated variant available. That should be safe, because it is always valid to use a predicated vector function when the vector loop itself doesn't require predication (although the opposite doesn't hold). It would require changing the interface a bit to also return whether the vectorizable function is predicated.
Considering this is the only place where this overload is used, there is no point in changing or extending the interface. I've reverted to old parameter list and handle your idea inside of the overload of `isFunctionVectorizable()` called from here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146839



More information about the llvm-commits mailing list