[IRCE] Support half-range checks.
authorSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 17 Mar 2015 00:42:13 +0000 (00:42 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 17 Mar 2015 00:42:13 +0000 (00:42 +0000)
commiteaf8532f7aba7c226ed37533f09b88e085067b8f
tree276e3711c446f0450f9925f3389d2f193e3c4036
parentbdd2212363c440b17b8664c90f67c6f9910ff7c7
[IRCE] Support half-range checks.

This change to IRCE gets it to recognize "half" range checks.  Half
range checks are range checks that only either check if the index is
`slt` some positive integer ("length") or if the index is `sge` `0`.

The range solver does not try to be clever / aggressive about solving
half-range checks -- it transforms "I < L" to "0 <= I < L" and "0 <= I"
to "0 <= I < INT_SMAX".  This is safe, but not always optimal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232444 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
test/Transforms/IRCE/only-lower-check.ll [new file with mode: 0644]
test/Transforms/IRCE/only-upper-check.ll [new file with mode: 0644]