[llvm] [NFC] Add GIntrinsic::setIntrinsicID (PR #106236)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 08:34:56 PDT 2024


https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/106236

Add a function to set the intrinsic ID for GIntrinsic.

>From 21f3c5110fb300c573dc311d00b45c3245e247a8 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Tue, 27 Aug 2024 08:32:47 -0700
Subject: [PATCH] [NFC] Add GIntrinsic::setIntrinsicID

Add a function to set the intrinsic ID for GIntrinsic.
---
 llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h b/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h
index ef1171d9f1f64d..9911d7dfaf6400 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h
@@ -511,6 +511,9 @@ class GIntrinsic final : public GenericMachineInstr {
   Intrinsic::ID getIntrinsicID() const {
     return getOperand(getNumExplicitDefs()).getIntrinsicID();
   }
+  void setIntrinsicID(Intrinsic::ID ID) {
+    getOperand(getNumExplicitDefs()).setIntrinsicID(ID);
+  }
 
   bool is(Intrinsic::ID ID) const { return getIntrinsicID() == ID; }
 



More information about the llvm-commits mailing list