[Mlir-commits] [mlir] 373a2f1 - [mlir][scf] ExecuteRegionOp bufferization to consider no_inline attr (#160697)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 25 06:53:04 PDT 2025


Author: Dor Arad
Date: 2025-09-25T15:53:00+02:00
New Revision: 373a2f1f222608d1f274c42281f4ffeed47a17a1

URL: https://github.com/llvm/llvm-project/commit/373a2f1f222608d1f274c42281f4ffeed47a17a1
DIFF: https://github.com/llvm/llvm-project/commit/373a2f1f222608d1f274c42281f4ffeed47a17a1.diff

LOG: [mlir][scf] ExecuteRegionOp bufferization to consider no_inline attr (#160697)

Fix a bug where ExecuteRegionOp bufferization dropped the "no_inline"
attribute.

Co-authored-by: Dor Arad <dor.arad at mobileye.com>

Added: 
    

Modified: 
    mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
    mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
index fb179e64d8e7b..47c99642b9c37 100644
--- a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
@@ -188,8 +188,8 @@ struct ExecuteRegionOpInterface
     TypeRange newResultTypes(yieldOp.getResults());
 
     // Create new op and move over region.
-    auto newOp =
-        scf::ExecuteRegionOp::create(rewriter, op->getLoc(), newResultTypes);
+    auto newOp = scf::ExecuteRegionOp::create(
+        rewriter, op->getLoc(), newResultTypes, executeRegionOp.getNoInline());
     newOp.getRegion().takeBody(executeRegionOp.getRegion());
 
     // Bufferize every block.

diff  --git a/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir b/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir
index eb0093106dc11..6054a61912532 100644
--- a/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir
+++ b/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir
@@ -380,6 +380,20 @@ func.func @execute_region_test(%t1 : tensor<?xf32>)
 
 // -----
 
+// CHECK-LABEL: func @no_inline_execute_region_not_canonicalized
+func.func @no_inline_execute_region_not_canonicalized() {
+  %c = arith.constant 42 : i32
+  // CHECK: scf.execute_region
+  // CHECK-SAME: no_inline
+  %v = scf.execute_region -> i32 no_inline {
+    scf.yield %c : i32
+  }
+  // CHECK: return
+  return
+}
+
+// -----
+
 //      CHECK:  func private @some_external_func(memref<?xf32, strided<[?], offset: ?>>)
 func.func private @some_external_func(tensor<?xf32>)
 


        


More information about the Mlir-commits mailing list