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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 16:30:45 PST 2024


================
@@ -0,0 +1,70 @@
+//===- LowerMathIntrinsics.cpp ---------------------------------*- C++ -*--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Transforms/Utils/LowerMathIntrinsics.h"
+#include "llvm/IR/IRBuilder.h"
+#include "llvm/IR/IntrinsicInst.h"
+#include "llvm/Support/Debug.h"
+
+#define DEBUG_TYPE "lower-math-intrinsics"
+
+using namespace llvm;
+
+bool llvm::lowerUnaryMathIntrinsicWithScalableVecArgAsLoop(Module &M,
+                                                           CallInst *CI) {
+  ScalableVectorType *ScalableTy =
+      dyn_cast<ScalableVectorType>(CI->getArgOperand(0)->getType());
+  if (!ScalableTy) {
+    return false;
+  }
----------------
arsenm wrote:

Don't handle the non-scalable case? 

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


More information about the llvm-commits mailing list