https://github.com/nikic commented: This does not look like a great fit for InstCombine. Would (IP)SCCP be able to handle this if we teach ConstantRange::truncate() to make use of the nuw flag? https://github.com/llvm/llvm-project/pull/151961