[MLIR][PDL] Extending PDL/PDLInterp/ByteCode to Enable Commutative Matching

Hi I just came across this thread and was just wondering if the “maybe restore the operand order if match failed” part has also been considered or implemented? I have a similar case where the number of patterns grow exponentially while they have the same semantics. If there is a functionality that temporarily canonicalizes a graph for matching and reverts if it’s a no-match it would be really useful.