[Mlir-commits] [mlir] [mlir] Add insert method for ApplyToEachResultList class (PR #107686)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Sep 7 03:35:57 PDT 2024


https://github.com/fawdlstty created https://github.com/llvm/llvm-project/pull/107686

#94968

>From e99e72b5e4d7945c77b788cab4054239446f6619 Mon Sep 17 00:00:00 2001
From: fawdlstty <f at fawdlstty.com>
Date: Sat, 7 Sep 2024 18:34:48 +0800
Subject: [PATCH] add insert method

---
 .../mlir/Dialect/Transform/Interfaces/TransformInterfaces.h  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h b/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h
index 842e244dcde56c..af57ba51d310b3 100644
--- a/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h
+++ b/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h
@@ -1428,6 +1428,11 @@ class ApplyToEachResultList {
   void push_back(Attribute attr) { results.push_back(attr); }
   void push_back(ApplyToEachResult r) { results.push_back(r); }
 
+  // Inserts an element to the list.
+  void insert(iterator I, Operation *op) { results.insert(I, op); }
+  void insert(iterator I, Attribute attr) { results.insert(I, attr); }
+  void insert(iterator I, ApplyToEachResult r) { results.insert(I, r); }
+
   /// Reserves space for `size` elements in the list.
   void reserve(unsigned size) { results.reserve(size); }
 



More information about the Mlir-commits mailing list