summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/overflow_to_sat.ll
Commit message (Collapse)AuthorAgeFilesLines
* [InstCombine] Canonicalize ssub.with.overflow with clamp to ssub.satDavid Green2019-11-171-54/+9
| | | | | | Working on top of D69252, this adds canonicalisation patterns for ssub.with.overflow to ssub.sats. Differential Revision: https://reviews.llvm.org/D69753
* [InstCombine] Canonicalize sadd.with.overflow with clamp to sadd.satDavid Green2019-11-171-54/+9
| | | | | | | | | | | | | This adds to D69245, adding extra signed patterns for folding from a sadd_with_overflow to a sadd_sat. These are more complex than the unsigned patterns, as the overflow can occur in either direction. For the add case, the positive overflow can only occur if both of the values are positive (same for both the values being negative). So there is an extra select on whether to use the positive or negative overflow limit. Differential Revision: https://reviews.llvm.org/D69252
* [InstCombine] Add extra tests for overflow_to_sat.ll. NFCDavid Green2019-11-171-0/+76
|
* [InstCombine] Canonicalize uadd.with.overflow to uadd.satDavid Green2019-10-311-8/+2
| | | | | | | | | | | This adds some patterns to transform uadd.with.overflow to uadd.sat (with usub.with.overflow to usub.sat too). The patterns selects from UINTMAX (or 0 for subs) depending on whether the operation overflowed. Signed patterns are a little more involved (they can wrap in two directions), but can be added here in a followup patch too. Differential Revision: https://reviews.llvm.org/D69245
* [InstCombine][NFC] Tests for uadd.sat and sadd.sat canonicalisation.David Green2019-10-281-0/+730
OpenPOWER on IntegriCloud