Page MenuHomePhabricator

[InstCombine] Support ssub.sat canonicalization for non-splats
ClosedPublic

Authored by nikic on Nov 28 2018, 10:04 AM.

Details

Summary

This is a small followup to D54534, which extends the ssub.sat(X, C) -> sadd.sat(X, -C) canonicalization to support non-splat constants. This is done by generalizing the implementation of the isNotMinSignedValue() helper to return true for constants that are non-splat, but don't contain any signed min elements.

Diff Detail

Event Timeline

nikic created this revision.Nov 28 2018, 10:04 AM
spatel accepted this revision.Nov 30 2018, 2:36 PM

LGTM

This revision is now accepted and ready to land.Nov 30 2018, 2:36 PM
spatel added inline comments.Nov 30 2018, 2:37 PM
test/Transforms/InstCombine/saturating-add-sub.ll
340

Update comment: non-splat works now.

This revision was automatically updated to reflect the committed changes.