goldsteinn wrote: See: https://github.com/llvm/llvm-project/pull/86141 which adds `nneg` flag to IR. Once that gets in I have patches for instcombine,cvp,sccp to do the transform. https://github.com/llvm/llvm-project/pull/82404