This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen][X86] Expand UADDSAT to NOT+UMIN+ADD
ClosedPublic

Authored by nikic on Jan 17 2019, 11:33 AM.

Details

Summary

Followup to D56636, this time handling the UADDSAT case by expanding uadd.sat(a, b) to umin(a, ~b) + b.

For the cost model I'm assuming the vector not (pcmpeq idiom + pxor) has a cost of 1, not sure if that's alright.

Diff Detail

Repository
rL LLVM

Event Timeline

nikic created this revision.Jan 17 2019, 11:33 AM

@nikic Please can you look at D56907 and if you're happy add the UADDSAT equivalent here?

I'm currently traveling and won't be able to rebase until Monday. Feel free to rebase/commit this before then though.

RKSimon accepted this revision.Jan 28 2019, 10:36 AM

LGTM with a couple of minors

lib/Target/X86/X86TargetTransformInfo.cpp
1927 ↗(On Diff #183901)

Move this UADDSAT to be with the others above

1964 ↗(On Diff #183901)

Move this UADDSAT to be with the others above

This revision is now accepted and ready to land.Jan 28 2019, 10:36 AM
This revision was automatically updated to reflect the committed changes.