[Mlir-commits] [mlir] [mlir][scf] Add `no_inline` attribute to `scf.execute_region` (PR #151352)

Mehdi Amini llvmlistbot at llvm.org
Thu Jul 31 09:41:13 PDT 2025


================
@@ -87,6 +87,9 @@ def ExecuteRegionOp : SCF_Op<"execute_region", [
     be accessed inside the op. The op's region can have multiple blocks and the
     blocks can have multiple distinct terminators. Values returned from this op's
     region define the op's results.
+    Canonicalizer inlines an ExecuteRegionOp into its parent if it only contains 
+    one block or its parent can contain multiple blocks, 'no_inline' attribute
+    can be set to prevent an ExecuteRegionOp from being inlined.
----------------
joker-eph wrote:

It's a bit weird to describe an op semantics in terms of a specific pass.

```suggestion
    The optional 'no_inline' flag can be set to request the ExecuteRegionOp to be
     preserved as much as possible and not being inlined in the parent block until
     an explicit lowering step.
```

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


More information about the Mlir-commits mailing list