I would like to define an attribute representing a static StrArrayAttr, for example, {“MatMul”, “BiasAdd”}. Does PDLL has support using attribute-expression? like let fused_ops = attr<"...">;
Can you give a sketch of what you’re trying to achieve? I’m having a hard time visualizing it.
@Mogball Thanks for your reply. I am trying to match without a native constraint. Here is the following mlir op that I would like to match:
%result = "my_dialect.my_op"() {fused_ops = ["MatMul", "BiasAdd"]} : () -> (tensor<*xf32>)
So the matcher should match the above, but not the following.
%result = "my_dialect.my_op"() {fused_ops = ["MatMul", "Tanh"]} : () -> (tensor<*xf32>)
@Mogball I just figured out that
The following works for me
Pattern {
let fused_ops = attr<"[\"MatMul\", \"BiasAdd\"]">;
replace op<my_dialect.my_op>{fused_ops = fused_ops} with op<my_dialect.bar>
}