[Mlir-commits] [mlir] [mlir] Remove duplicated `SingleBlockImplicitTerminator` member funions (PR #65959)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Sep 11 06:05:05 PDT 2023


https://github.com/victor-eds created https://github.com/llvm/llvm-project/pull/65959:

Avoid member functions duplication caused by `SingleBlockImplicitTerminator` now implying `SingleBlock` (since 0ac21e654f194a0f7c9f5afe42e11924c546f89e).

>From 8857ede558325694107f6df1c6c27e422c5ff052 Mon Sep 17 00:00:00 2001
From: Victor Perez <victor.perez at codeplay.com>
Date: Mon, 11 Sep 2023 13:58:11 +0100
Subject: [PATCH] [mlir] Remove duplicated `SingleBlockImplicitTerminator`
 member functions

Avoid member functions duplication caused by
`SingleBlockImplicitTerminator` now implying `SingleBlock`.

Signed-off-by: Victor Perez <victor.perez at codeplay.com>
---
 mlir/include/mlir/IR/OpDefinition.h | 31 -----------------------------
 1 file changed, 31 deletions(-)

diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h
index 84ba46f4d6f3ec1..fade95f200476f2 100644
--- a/mlir/include/mlir/IR/OpDefinition.h
+++ b/mlir/include/mlir/IR/OpDefinition.h
@@ -996,37 +996,6 @@ struct SingleBlockImplicitTerminator {
       ::mlir::impl::ensureRegionTerminator(region, builder, loc,
                                            buildTerminator);
     }
-
-    //===------------------------------------------------------------------===//
-    // Single Region Utilities
-    //===------------------------------------------------------------------===//
-
-    template <typename OpT, typename T = void>
-    using enable_if_single_region =
-        std::enable_if_t<OpT::template hasTrait<OneRegion>(), T>;
-
-    /// Insert the operation into the back of the body, before the terminator.
-    template <typename OpT = ConcreteType>
-    enable_if_single_region<OpT> push_back(Operation *op) {
-      Block *body = static_cast<SingleBlock<ConcreteType> *>(this)->getBody();
-      insert(Block::iterator(body->getTerminator()), op);
-    }
-
-    /// Insert the operation at the given insertion point. Note: The operation
-    /// is never inserted after the terminator, even if the insertion point is
-    /// end().
-    template <typename OpT = ConcreteType>
-    enable_if_single_region<OpT> insert(Operation *insertPt, Operation *op) {
-      insert(Block::iterator(insertPt), op);
-    }
-    template <typename OpT = ConcreteType>
-    enable_if_single_region<OpT> insert(Block::iterator insertPt,
-                                        Operation *op) {
-      Block *body = static_cast<SingleBlock<ConcreteType> *>(this)->getBody();
-      if (insertPt == body->end())
-        insertPt = Block::iterator(body->getTerminator());
-      body->getOperations().insert(insertPt, op);
-    }
   };
 };
 



More information about the Mlir-commits mailing list