CarlosAlbertoEnciso wrote: @nikic Thanks for your feedback. I uploaded a new patch addressing: - Moved the new logic to `rewriteLoopExitValues`. - Removed from the test cases, the unrelated functions: `nop` and `main`. - Use `isa<SCEVConstant>`. https://github.com/llvm/llvm-project/pull/69920