[Mlir-commits] [mlir] [mlir] introduce transform.collect_matching (PR #76724)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed Jan 3 02:49:01 PST 2024


================
@@ -459,6 +459,36 @@ def NumAssociationsOp : TransformDialectOp<"num_associations",
   }];
 }
 
+def CollectMatchingOp : TransformDialectOp<"collect_matching", [
+    DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
+    DeclareOpInterfaceMethods<SymbolUserOpInterface>,
+    DeclareOpInterfaceMethods<TransformOpInterface>]> {
+  let summary = "Collects all payload ops that match the given named matcher";
+  let description = [{
+    Collects operations nested under `root` or other payload IR objects that
+    match the given matcher expressed as a named sequence. The matcher sequence
+    must accept exactly one argument that it is not allowed to modify. It must
+    yield as many values as this op has results. Each of the yielded values must
+    be associated with exactly one payload object. If any operation in the
----------------
ftynse wrote:

So we the user can expect a certain number of associations in the result and how they map to associations of the operand. For example, for future co-iteration. We could eventually relax that to all "calls" having equal number of associations for each result, but probably not more than that.

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


More information about the Mlir-commits mailing list