[llvm] [LV][EVL] Support call instruction with EVL-vectorization (PR #110412)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 4 03:14:52 PST 2024


================
@@ -994,6 +994,16 @@ void VPWidenIntrinsicRecipe::execute(VPTransformState &State) {
     Args.push_back(Arg);
   }
 
+  if (VPIntrinsic::isVPIntrinsic(VectorIntrinsicID) &&
+      VectorIntrinsicID != Intrinsic::vp_select) {
+    Value *Mask =
+        State.Builder.CreateVectorSplat(State.VF, State.Builder.getTrue());
+    Value *EVL = Args.back();
+    Args.pop_back();
+    Args.push_back(Mask);
+    Args.push_back(EVL);
----------------
Mel-Chen wrote:

> > Why is this needed and for recipes != vp_select? Can't the mask be provided when the recipe is constructed, like for `vp_select`?
> 
> vp_select hasn‘t mask op

Use `VPIntrinsic::getMaskParamPos` to get whether the vp intrinsic requires mask.
Use `VPIntrinsic::getVectorLengthParamPos` to get whether the vp intrinsic requires evl.
Than we can pass in the CallArgument explicitly.
 

https://github.com/llvm/llvm-project/pull/110412


More information about the llvm-commits mailing list