[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:35 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)) {
----------------
matthias-springer wrote:
nit: Use `llvm::zip_equal`
https://github.com/llvm/llvm-project/pull/67994
More information about the Mlir-commits
mailing list