[llvm] [IR] Remove MemSetPatternIntrinsic class [nfc] (PR #138888)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 7 08:00:37 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Philip Reames (preames)

<details>
<summary>Changes</summary>

This class appears to serve no purpose.  It looks to be modeled after the MemIntrinsic/MemTransferInst family of classes, but right now, we only have a single intrinsic in this "family".

---
Full diff: https://github.com/llvm/llvm-project/pull/138888.diff


1 Files Affected:

- (modified) llvm/include/llvm/IR/IntrinsicInst.h (+4-14) 


``````````diff
diff --git a/llvm/include/llvm/IR/IntrinsicInst.h b/llvm/include/llvm/IR/IntrinsicInst.h
index ea9257bd0d95b..1217a628dcb29 100644
--- a/llvm/include/llvm/IR/IntrinsicInst.h
+++ b/llvm/include/llvm/IR/IntrinsicInst.h
@@ -1167,8 +1167,10 @@ class MemSetInst : public MemSetBase<MemIntrinsic> {
   }
 };
 
-/// This is the base class for llvm.experimental.memset.pattern
-class MemSetPatternIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
+/// This class wraps the llvm.experimental.memset.pattern intrinsic.
+/// Note that despite the inheritance, this is not part of the
+/// MemIntrinsic hierachy in terms of isa/cast.
+class MemSetPatternInst : public MemSetBase<MemIntrinsic> {
 private:
   enum { ARG_VOLATILE = 3 };
 
@@ -1181,18 +1183,6 @@ class MemSetPatternIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
 
   void setVolatile(Constant *V) { setArgOperand(ARG_VOLATILE, V); }
 
-  // Methods for support of type inquiry through isa, cast, and dyn_cast:
-  static bool classof(const IntrinsicInst *I) {
-    return I->getIntrinsicID() == Intrinsic::experimental_memset_pattern;
-  }
-  static bool classof(const Value *V) {
-    return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
-  }
-};
-
-/// This class wraps the llvm.experimental.memset.pattern intrinsic.
-class MemSetPatternInst : public MemSetBase<MemSetPatternIntrinsic> {
-public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::experimental_memset_pattern;

``````````

</details>


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


More information about the llvm-commits mailing list