joker-eph wrote: There was some discussion at some point for declarative patterns to be compiled to try to be matching both sides when the op is commutative, maybe we could give it a try again to implement it? https://github.com/llvm/llvm-project/pull/195588