gysit wrote: I do not have a strong opinion on keeping vs removing the canonicalization (as long as the bug is fixed). It is true that the output of the patterns seems more canonical from an arith dialect perspective. https://github.com/llvm/llvm-project/pull/144787