[Mlir-commits] [flang] [mlir] [mlir][CSE] Introduce hoist-pure-ops logic to CSE pass (PR #180556)

lonely eagle llvmlistbot at llvm.org
Wed Feb 25 09:26:24 PST 2026


================
@@ -0,0 +1,41 @@
+//===- HoistingContainerOpInterface.td - Interface Decl. -*- tablegen -*---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This is the definition file for the HoistingContainerOpInterface. 
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_INTERFACES_HOISTING_CONTAINER_OP_INTERFACE
+#define MLIR_INTERFACES_HOISTING_CONTAINER_OP_INTERFACE
+
+include "mlir/IR/OpBase.td"
+
+def HoistingContainerOpInterface : OpInterface<"HoistingContainerOpInterface"> {
+  let description = [{
+    This interface models whether an operation's regions are capable of 
+    acting as a container for operations hoisted from nested regions.
----------------
linuxlonelyeagle wrote:

> Can you please clarify this?
This is just an implementation detail. When hoisting, I need to determine the new insertion point. I only need to check whether the post-hoist position and the original position are within the same region.
>  Do you mean this is a practical constraint due to the current state of things in the other dialects?
Yes. This was done because there are indeed certain constraints in practice (Let's leave a TODO here and revisit this once the constraints are lifted.).
> I just do not think this should be a limitation for CSE, in general.
I think so, too.

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


More information about the Mlir-commits mailing list