[llvm] [LV][EVL] Support cast instruction with EVL-vectorization (PR #108351)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 01:47:40 PST 2024


================
@@ -996,22 +996,35 @@ void VPWidenIntrinsicRecipe::execute(VPTransformState &State) {
 
   // Use vector version of the intrinsic.
   Module *M = State.Builder.GetInsertBlock()->getModule();
+  bool IsVPIntrinsic = VPIntrinsic::isVPIntrinsic(VectorIntrinsicID);
   Function *VectorF =
-      Intrinsic::getOrInsertDeclaration(M, VectorIntrinsicID, TysForDecl);
+      IsVPIntrinsic
+          ? VPIntrinsic::getOrInsertDeclarationForParams(M, VectorIntrinsicID,
----------------
fhahn wrote:

Why does `getOrInsertDeclaration` not work for the VP intrinsics? Aren't the types + intrinsic ID sufficient to get the correct declaration?

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


More information about the llvm-commits mailing list