[llvm] PreISelIntrinsicLowering: Lower llvm.exp/llvm.exp2 to a loop if scalable vec arg (PR #117568)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 07:04:34 PST 2025


================
@@ -453,6 +454,21 @@ bool PreISelIntrinsicLowering::lowerIntrinsics(Module &M) const {
     case Intrinsic::objc_sync_exit:
       Changed |= lowerObjCCall(F, "objc_sync_exit");
       break;
+    case Intrinsic::exp:
+    case Intrinsic::exp2:
+      Changed |= forEachCall(F, [&](CallInst *CI) {
+        unsigned Op = ISD::FEXP;
+        if (F.getIntrinsicID() == Intrinsic::exp2)
+          Op = ISD::FEXP2;
+        Type *Ty = CI->getArgOperand(0)->getType();
+        if (!Ty->isVectorTy() || !Ty->isScalableTy())
----------------
arsenm wrote:

```suggestion
        if (!isa<ScalableVectorType>(Ty))
```

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


More information about the llvm-commits mailing list