This patch adds support for multiply and left shift variants which use NoWrap flags to restrict the range returned. It directly follows the pattern already taken for add/sub, and extends it to mul/shl.
This is a WIP for two major reasons, both of which I'd appreciate some input on.
- I don't understand the bits in add/sub about being required to return empty ranges on definite overflow. I can see that from a precision perspective, but since both the 2s complement and saturating variants are valid implementations of the no-wrap behavior, it seems like intersecting them should always be valid. Am I right here? Or is my code subtly wrong?
- Suggestions on how to test this? I glanced at the ConstantRangeTest file, and am looking for specific guidance on which exhaustive test harness to use. This file has gotten quite complicated.
Once complete, I plan to use this in SCEV to help refine the ranges returned for multiplies.