Add support for srem() to ConstantRange so we can use it in LVI. For srem the sign of the result matches the sign of the LHS. For the RHS only the absolute value is important. Apart from that the logic is like urem.
Just like for urem this is only an approximate implementation. The tests check a few specific cases and run an exhaustive test for conservative correctness (but not exactness).
Hm, i wonder if we can also check that the result
is exact when the ranges contain a single element?
Not sure if that would hold for the current implementations though.
I also wonder if some kind of a "precision" metric should be calculated,
e.g. ConstantRange returned range with 75 elements, and exhaustive test
returned range with 67 elements then let's say it's 67/75.
And then just average that metric over all the checked ranges.