[llvm] [VP] Use the interface of 'getFunctionalIntrinsicID' to get the non-p… (PR #68508)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 8 00:23:33 PDT 2023
https://github.com/LiqinWeng created https://github.com/llvm/llvm-project/pull/68508
…redicated Intrinsic ID
>From ac4fea6bbacbe278e115ce2d5afaae816e6c2a17 Mon Sep 17 00:00:00 2001
From: "liqin.weng" <liqin.weng at spacemit.com>
Date: Sun, 8 Oct 2023 14:59:10 +0800
Subject: [PATCH] [VP] Use the interface of 'getFunctionalIntrinsicID' to get
the non-predicated Intrinsic ID
---
llvm/lib/CodeGen/ExpandVectorPredication.cpp | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/llvm/lib/CodeGen/ExpandVectorPredication.cpp b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
index 50182ce0bbf278f..53f4b39160fa15e 100644
--- a/llvm/lib/CodeGen/ExpandVectorPredication.cpp
+++ b/llvm/lib/CodeGen/ExpandVectorPredication.cpp
@@ -479,7 +479,7 @@ Value *CachingVPExpander::expandPredicationToCastIntrinsic(IRBuilder<> &Builder,
Value *CastOp = nullptr;
switch (VPI.getIntrinsicID()) {
default:
- llvm_unreachable("Not a VP memory intrinsic");
+ llvm_unreachable("Not a VP cast intrinsic");
case Intrinsic::vp_sext:
CastOp =
Builder.CreateSExt(VPI.getOperand(0), VPI.getType(), VPI.getName());
@@ -705,23 +705,18 @@ Value *CachingVPExpander::expandPredication(VPIntrinsic &VPI) {
return NewNegOp;
}
case Intrinsic::vp_abs:
- return expandPredicationToIntCall(Builder, VPI, Intrinsic::abs);
case Intrinsic::vp_smax:
- return expandPredicationToIntCall(Builder, VPI, Intrinsic::smax);
case Intrinsic::vp_smin:
- return expandPredicationToIntCall(Builder, VPI, Intrinsic::smin);
case Intrinsic::vp_umax:
- return expandPredicationToIntCall(Builder, VPI, Intrinsic::umax);
case Intrinsic::vp_umin:
- return expandPredicationToIntCall(Builder, VPI, Intrinsic::umin);
+ return expandPredicationToIntCall(Builder, VPI,
+ VPI.getFunctionalIntrinsicID().value());
case Intrinsic::vp_fabs:
- return expandPredicationToFPCall(Builder, VPI, Intrinsic::fabs);
case Intrinsic::vp_sqrt:
- return expandPredicationToFPCall(Builder, VPI, Intrinsic::sqrt);
case Intrinsic::vp_maxnum:
- return expandPredicationToFPCall(Builder, VPI, Intrinsic::maxnum);
case Intrinsic::vp_minnum:
- return expandPredicationToFPCall(Builder, VPI, Intrinsic::minnum);
+ return expandPredicationToFPCall(Builder, VPI,
+ VPI.getFunctionalIntrinsicID().value());
case Intrinsic::vp_load:
case Intrinsic::vp_store:
case Intrinsic::vp_gather:
More information about the llvm-commits
mailing list