[Mlir-commits] [mlir] [MLIR][Transform] Add attribute in MatchOp to filter by operand type (PR #67994)

Matthias Springer llvmlistbot at llvm.org
Fri Dec 1 17:51:37 PST 2023


================
@@ -1180,12 +1181,34 @@ transform::MatchOp::apply(transform::TransformRewriter &rewriter,
         return;
     }
 
+    if (getFilterOperandTypes().has_value()) {
+      mlir::ArrayAttr types = getFilterOperandTypes().value();
+      auto operandTypes = op->getOperandTypes();
+      if (types.size() != operandTypes.size()) {
----------------
matthias-springer wrote:

This is different from the op documentation:
```
all the operands of the matched op must must be of
        this type
```
Does not handle the case where an op has multiple operands but only one type is specified in the transform op. (If you did not intend to support such cases, update the documentation. It sounds like if there's 1 type but the op has multiple operands, then all operands must have that type.)


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


More information about the Mlir-commits mailing list