matthias-springer wrote: I see... The canonicalizer pass would then also remove the op because it is "trivially dead". This is not just a CSE problem. https://github.com/llvm/llvm-project/pull/139521