aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/IntrinsicInst.cpp
diff options
context:
space:
mode:
authorMichael Maitland <michaeltmaitland@gmail.com>2023-09-13 08:35:17 -0400
committerGitHub <noreply@github.com>2023-09-13 08:35:17 -0400
commit0f4c9a05605c609661c3f57cf1fd65bd6000411b (patch)
treef039cd16607a0b0749b524a522aaa1efccc6c607 /llvm/lib/IR/IntrinsicInst.cpp
parent41eb82f8d12afb7bc4e43534a1a4db0e7980d630 (diff)
downloadllvm-0f4c9a05605c609661c3f57cf1fd65bd6000411b.zip
llvm-0f4c9a05605c609661c3f57cf1fd65bd6000411b.tar.gz
llvm-0f4c9a05605c609661c3f57cf1fd65bd6000411b.tar.bz2
[IR][IntrinsicInst] Add VPBinOpIntrinsic (#66132)
VPIntrinsics with VP_PROPERTY_BINARYOP property should have the ability to be queried with with VPBinOpIntrinsic::isVPBinOp, similiar to how intrinsics with the VP_PROPERTY_REDUCTION property can be queried with VPReductionIntrinsic::isVPReduction. This will be used in #65706. In that PR the usage of this class is tested.
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r--llvm/lib/IR/IntrinsicInst.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp
index c73634e..352af57 100644
--- a/llvm/lib/IR/IntrinsicInst.cpp
+++ b/llvm/lib/IR/IntrinsicInst.cpp
@@ -708,6 +708,18 @@ bool VPCmpIntrinsic::isVPCmp(Intrinsic::ID ID) {
return false;
}
+bool VPBinOpIntrinsic::isVPBinOp(Intrinsic::ID ID) {
+ switch (ID) {
+ default:
+ break;
+#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...) case Intrinsic::VPID:
+#define VP_PROPERTY_BINARYOP return true;
+#define END_REGISTER_VP_INTRINSIC(VPID) break;
+#include "llvm/IR/VPIntrinsics.def"
+ }
+ return false;
+}
+
static ICmpInst::Predicate getIntPredicateFromMD(const Value *Op) {
Metadata *MD = cast<MetadataAsValue>(Op)->getMetadata();
if (!MD || !isa<MDString>(MD))