llvm-project
8320b97a - [InstCombine] Fold an unsigned comparison of `add nsw X, C` with a constant into a signed comparison (#103480)

Commit
1 year ago
[InstCombine] Fold an unsigned comparison of `add nsw X, C` with a constant into a signed comparison (#103480) Given an unsigned integer comparison of `add nsw X, C1` with some constant `C2` we can fold it into a signed comparison of `X` and `C2 - C1` under the following conditions: * There's a `nsw` flag on the addition * `C2` is non-negative * `X + C1` is non-negative * `C2 - C1` is non-negative
Author
Parents
Loading