On Mon, 10 Aug 2015, Nathan Sidwell wrote: > Richard, > in looking at how simplify_abs_using_ranges was doing its thing as a guide to > a min/max vrp optimization, I noticed it was doing more work than necessary. > > Firstly, it wasn't taking advantage of the range comparison functions only > returning TRUE or FALSE nodes when there's a definite answer, and NULL > otherwise. Thus if we get a node, we don't have to (a) check if it's either > true or false and (b) we only need to check for one of those values to > determine which specific answer was given. > > Also, it was checking for 'NOT (A >= B)' by inverting the result of a '>=' > check, rather than simply doing a '<' check. (we're dealing with integer > ranges, so that's all well defined) > > Finally, there's a useless check for UNSIGNED_TYPE, which ends up doing > nothing. AFAICT 'ABS (unsigned)' gets folded out very early on. > > booted and tested with the phi-min-max fix I just posted and the new > VRP-min-max optimization I'm about to. > > ok?
Ok. Thanks, Richard.