[Mlir-commits] [mlir] baefd66 - [mlir] clarify transform.foreach_match documentation

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue May 30 07:01:03 PDT 2023


Author: Oleksandr "Alex" Zinenko
Date: 2023-05-30T16:00:59+02:00
New Revision: baefd6650cfea499e940e2c2f5718d9ae694df7a

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

LOG: [mlir] clarify transform.foreach_match documentation

Clarify the restrictions on actions that are implied by the implementation as a post-order walk.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Transform/IR/TransformOps.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Transform/IR/TransformOps.td b/mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
index a313d285492d..62b2cd698fb8 100644
--- a/mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
+++ b/mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
@@ -150,7 +150,12 @@ def ForeachMatchOp : TransformDialectOp<"foreach_match", [
     satisfies the constraints of actual types on both sides). The action symbol
     may not have results. The actions are expected to only modify payload
     operations nested in the `root` payload operations associated with the
-    operand of this transform operation.
+    operand of this transform operation. Furhermore, the actions may not modify
+    operations outside of the currently matched payload operation, e.g., they
+    may not modify sibling or parent operations. If such behavior is desired,
+    the parent must be matched first and the nested operations obtained by
+    traversing the IR from the parent. This is due to the matching being
+    performed as a post-order IR walk.
 
     This operation consumes the operand and produces a new handle associated
     with the same payload. This is necessary to trigger invalidation of handles
@@ -511,7 +516,7 @@ def NamedSequenceOp : TransformDialectOp<"named_sequence",
       return getResAttrs().value_or(nullptr);
     }
   }];
-}
+}siblings must be matched explicitly 
 
 def SplitHandleOp : TransformDialectOp<"split_handle",
     [FunctionalStyleTransformOpTrait,


        


More information about the Mlir-commits mailing list