This is an archive of the discontinued LLVM Phabricator instance.

[DAG] PromoteIntRes_ADDSUBSHLSAT - promote ISD::UADDSAT as clamped add
ClosedPublic

Authored by RKSimon on Feb 16 2021, 3:05 AM.

Details

Summary

Similar to D96622, we're better off just promoting uaddsat(x,y) -> umin(add(x,y),c) instead of trying to perform a shifted uaddsat.

I initially tried to just use shifted promotion in cases where we didn't have a legal/custom umin - but we don't appear to have any targets that have uaddsat but not umin, so imo we're better off always using the umin and avoid an untested shifted uaddsat code path.

Diff Detail

Event Timeline

RKSimon created this revision.Feb 16 2021, 3:05 AM
RKSimon requested review of this revision.Feb 16 2021, 3:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2021, 3:05 AM
nikic accepted this revision.Feb 16 2021, 8:47 AM

LGTM

This revision is now accepted and ready to land.Feb 16 2021, 8:47 AM