While trying to extend D59386 to signed add/sub I ran into quite a few issues ... unfortunately our range handling is quite biased in favor of unsigned ranges right now and it'll be necessary to thread preferred signedness through various APIs to get reasonable results.
This is the first step in this direction. computeConstantRange() gets a preferred signedness flag, which is respected for and/or range calculations. InstSimplify calls computeConstantRange() with the signedness of the predicate. This allows us to simplify signed icmps of and/or in InstSimplify.
This is a miscompile, i believe.
https://rise4fun.com/Alive/R6k