This follows up to D104665 (which added umulo handling alongside the existing uaddo case), and generalizes for the remaining overflow intrinsics.
I went to add analogous handling to LVI, and discovered that LVI already had a more general implementation. Instead, we can port was LVI does to instcombine. :)
A couple of points for review discussion:
- I could have just generated two compares, and let instcombine refold them into the sub form. Not sure which is cleaner here.
- Sanjay was nice enough to improve instcombine such that the profitability of ssub and usub is no longer questionable. Thanks!
Why are we leaving this code in? Is there some pattern that would escape the new proposed block, but still be caught by this?