commit | f74443e53a62e5a26d4db0d804ef9e3d8d6b2499 | [log] [tgz] |
---|---|---|
author | David Majnemer <david.majnemer@gmail.com> | Sat Nov 01 09:09:51 2014 +0000 |
committer | David Majnemer <david.majnemer@gmail.com> | Sat Nov 01 09:09:51 2014 +0000 |
tree | d1af6feeb3aaa98768d19c22b9f5f5ce023cf7f3 | |
parent | 666a51320e75d3a3fc1b38c0b683496b40f49c18 [diff] |
InstCombine: Combine (X+cst) < 0 --> X < -cst This can happen pretty often in code that looks like: int foo = bar - 1; if (foo < 0) do stuff In this case, bar < 1 is an equivalent condition. This transform requires that the add instruction be annotated with nsw. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221045 91177308-0d34-0410-b5e6-96231b3b80d8