Based on the overflow direction information added in D62463, we can now fold always overflowing signed saturating add/sub to signed min/max.
|2074–2075 ↗||(On Diff #201950)|
It works, but I'm wondering whether it's okay to use APSInt for this purpose. It looks like APSInt is used heavily by clang, but the only uses in the LLVM middle end are for interfacing with the convertToInteger() APFloat API.
|2074 ↗||(On Diff #201950)|
What's really happening on this line? APSInt::getMinValue returns an APSInt object which is larger than an APInt object. Does this create an APSInt and then copy the APInt part of that out into a separate APInt? Or does the APInt portion get moved?