https://github.com/dcaballe commented: Thanks! It's great to have these canonicalizations as we were relying on LLVM to deal with this kind of simplifications! Just one comment but otherwise LGTM, thanks! https://github.com/llvm/llvm-project/pull/69456