dtcxzyw wrote: BTW, [D143373](https://reviews.llvm.org/D143373) does a similar transformation with this PR. We should put the logic in `foldICmpUsingBoolRange` rather than `foldICmpAddConstant`. https://github.com/llvm/llvm-project/pull/67895