[LV] Synthesize all true masks for masked vector function variants
authorGraham Hunter <graham.hunter@arm.com>
Fri, 9 Sep 2022 08:41:02 +0000 (09:41 +0100)
committerGraham Hunter <graham.hunter@arm.com>
Tue, 14 Feb 2023 14:33:18 +0000 (14:33 +0000)
commit0fa5df1959faaf474697fae4fd36b9749b67f815
tree3234bc08d10c4fc84048946f5fac53167fe4cfde
parent09dd4d870e192da73594b713bb201859e5a09efb
[LV] Synthesize all true masks for masked vector function variants

When vectorizing code with function calls in it, if we encounter
a function which only has vectorized variants requiring a mask
we can synthesize an all-true mask to enable us to proceed.

Since we want the mask to be represented in vplan, the pointer
to the chosen Function is now stored as part of the
VPWidenCallRecipe, and mask arguments are added at the
appropriate index to the recipe operands.

Reviewed By: david-arm, fhahn, reames

Differential Revision: https://reviews.llvm.org/D132458
llvm/include/llvm/Analysis/VectorUtils.h
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
llvm/test/Transforms/LoopVectorize/AArch64/masked-call.ll
llvm/test/Transforms/LoopVectorize/AArch64/synthesize-mask-for-call.ll [new file with mode: 0644]
llvm/test/Transforms/LoopVectorize/AArch64/widen-call-with-intrinsic-or-libfunc.ll