Currently there is only an add function for constant range without considering wrap flag. It may produce a conservative range.
For example, currently, full_set +nsw [1,3) will get full_set. But right range should be [SINT_MIN + 1, SINT_MIN)
Add a helper function to consider wrap flag, so we can get a more accurate range.
This is splitted from https://reviews.llvm.org/D64869.
@nikic @shchenz
So i'm trying to look into sub variant, and i'm missing a subtlety here.
In addWithNoSignedWrap() why those overflow checks are needed?
All tests pass without them.
In addWithNoUnsignedWrap() why is that overflow check needed?
All tests pass without it (with it replaced with uadd_sat)