[PATCH] D134422: Scalarize calls to masked functions in LV

Graham Hunter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 08:27:26 PST 2023


huntergr marked 2 inline comments as done.
huntergr added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3464
+  // masked call with branches.
+  if (!TLI || CI->isNoBuiltin() || !VecFunc || Legal->isMaskRequired(CI))
     return Cost;
----------------
paulwalker-arm wrote:
> Given we cannot scalarise scalable vectors should this return `InvalidCost` somewhere? Or perhaps `blockCanBePredicated` should return false? Perhaps I'm being paranoid but the code should be resilient to the case of somebody adding a bunch of scalable vector TLI mapping before all the LoopVectorize support is finished. Or do tests already exist for scalable vectors that show it does not matter?
So Cost should already be Invalid from the call to getScalarizationOverhead above, but I've added in another check here just to be sure -- while we might one day implement scalarization for a subset of operations if there's a need for it, I don't think this will be one of them due to the standard AArch64 PCS.

I was going to add a test for this but can't find a nice way of doing so yet with the 3rd patch in the series implementing full mask support -- it will probably have to wait until we remove the restriction on needing a variant.


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

https://reviews.llvm.org/D134422



More information about the llvm-commits mailing list