[Mlir-commits] [mlir] [mlir][scf][transform] Add scope op & transform (PR #87352)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Thu Apr 18 04:02:49 PDT 2024


================
@@ -931,6 +931,28 @@ def ReduceReturnOp :
   let hasVerifier = 1;
 }
 
+def ScopeOp : SCF_Op<"scope",
+    [AutomaticAllocationScope,
+     RecursiveMemoryEffects,
+     IsolatedFromAbove,
+     SingleBlockImplicitTerminator<"scf::YieldOp">]> {
+  let summary = "isolated code scope";
+  let description = [{
+    This op models an executed-once region, similar to `execute_region`
+    except it's isolated from above, which facilitates local scoping of
+    code without resorting to function outlining.
----------------
ftynse wrote:

Good points actually, we cannot have a dynamic trait.

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


More information about the Mlir-commits mailing list