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

Pablo Antonio Martinez llvmlistbot at llvm.org
Mon Dec 4 07:48:17 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()) {
+        wrong_operand_filter = true;
+        return;
+      }
+
+      for (auto const &it :
+           llvm::zip(getFilterOperandTypes().value(), operandTypes)) {
----------------
pabloantoniom wrote:

Solved, thanks for the tip

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


More information about the Mlir-commits mailing list