nikic wrote: You can just assert that the op is commutative (after the associativity check). In general, all associative ops we support are also commutative. https://github.com/llvm/llvm-project/pull/106999