[llvm] [IR] Initial introduction of memset_pattern (PR #97583)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 09:43:05 PST 2024


================
@@ -1263,6 +1263,46 @@ class MemSetInlineInst : public MemSetInst {
   }
 };
 
+/// This is the base class for memset.pattern
+class MemSetPatternIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
+private:
+  enum { ARG_VOLATILE = 3 };
+
+public:
+  ConstantInt *getVolatileCst() const {
+    return cast<ConstantInt>(const_cast<Value *>(getArgOperand(ARG_VOLATILE)));
+  }
+
+  bool isVolatile() const { return !getVolatileCst()->isZero(); }
+
+  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) {
+    switch (I->getIntrinsicID()) {
----------------
topperc wrote:

`return I->getIntrinsicID() == Intrinsic::experimental_memset_pattern`?

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


More information about the llvm-commits mailing list