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

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 06:01:37 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:

You may have misunderstood what I meant.
What I mean is to directly pass the mask and evl as call arguments when creating `VPWidenIntrinsicRecipe`. `VPIntrinsic::getMaskParamPos` and `VPIntrinsic::getVectorLengthParamPos` only provide a way for you to check whether a specific vp intrinsic requires a mask or evl. 
If you need to pass an all-true mask, you can use 
```
VPValue *AllTrue = Plan.getOrAddLiveIn(ConstantInt::getTrue(Ctx));
```
, as Florian mentioned.

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


More information about the llvm-commits mailing list