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

Slava Zakharin llvmlistbot at llvm.org
Wed Feb 25 08:56:41 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.
----------------
vzakhari wrote:

> Seems like a problem with the op design to me...

Yes, I agree. We came to the same conclusion in https://github.com/llvm/llvm-project/pull/175108 for OpenACC/OpenMP operations, and I ended up creating a custom Flang-LICM pass that uses `OperationMoveOpInterface` to control the hoisting.

I do not think we can change the core MLIR CSE like this before we "fix" FIR/OpenACC/OpenMP operations design. Rephrasing: if we change the core MLIR CSE like this, we will definitely end up with new failures in Fortran/OpenMP/OpenACC tests.

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


More information about the Mlir-commits mailing list