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

Jungwook Park llvmlistbot at llvm.org
Wed Jul 30 12:56:58 PDT 2025


================
@@ -1461,6 +1461,28 @@ func.func @execute_region_elim() {
 
 // -----
 
+// CHECK-LABEL: func @execute_region_elim_noinline
+func.func @execute_region_elim_noinline() {
+  affine.for %i = 0 to 100 {
+    "test.foo"() : () -> ()
+    %v = scf.execute_region -> i64 {
+      %x = "test.val"() : () -> i64
+      scf.yield %x : i64
+    } {no_inline}
+    "test.bar"(%v) : (i64) -> ()
+  }
+  return
+}
+
+// CHECK-NEXT:     affine.for %arg0 = 0 to 100 {
+// CHECK-NEXT:       "test.foo"() : () -> ()
+// CHECK-NEXT:       scf.execute_region
+// CHECK-NEXT:       %[[VAL:.*]] = "test.val"() : () -> i64
+// CHECK-NEXT:       scf.yield %[[VAL]] : i64
+// CHECK-NEXT:     }
+
----------------
jungpark-mlir wrote:

I think it confuses more because it originally uses 'elim' in the test. I've documented how canonicalizer inlines the op into its parent and use of `no_inline` in the description and replaced 'elim' in the test with 'inline'

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


More information about the Mlir-commits mailing list