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

Shih-Po Hung via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 7 01:43:12 PST 2024


================
@@ -117,9 +117,13 @@ bool llvm::isVectorIntrinsicWithScalarOpAtArg(Intrinsic::ID ID,
                                               unsigned ScalarOpdIdx) {
   switch (ID) {
   case Intrinsic::abs:
+  case Intrinsic::vp_abs:
   case Intrinsic::ctlz:
+  case Intrinsic::vp_ctlz:
   case Intrinsic::cttz:
+  case Intrinsic::vp_cttz:
   case Intrinsic::is_fpclass:
+  case Intrinsic::vp_is_fpclass:
   case Intrinsic::powi:
     return (ScalarOpdIdx == 1);
----------------
arcbbb wrote:

In the example,
```
%r = call <4 x i32> @llvm.vp.abs.v4i32(<4 x i32> %a, <4 x i1> %mask, i32 %evl, i1 false)
```
 the scalar operands are `%evl` and `false` , located at indexes 2 and 3.
It looks like VectorUtil doesn't work well with vp intrinsics.
I’m unsure of the best practice here, but in #115274, I handle `%evl` by addng
```
 if (VPIntrinsic::isVPIntrinsic(ID) &&
      (ScalarOpdIdx == VPIntrinsic::getVectorLengthParamPos(ID)))
    return true;
```


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


More information about the llvm-commits mailing list