This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Legalize scalar G_SSUBSAT + G_SADDSAT
ClosedPublic

Authored by paquette on Aug 9 2021, 11:49 AM.

Details

Summary

These are lowered, matching SDAG behaviour. (See llvm/test/CodeGen/AArch64/ssub_sat.ll and llvm/test/CodeGen/AArch64/sadd_sat.ll)

These fall back ~159 times on a build of clang with GISel enabled.

Abort is disabled here because we can't clamp these instructions yet. The s88 test requires widening to s128 then clamping back down. I think this is consistent with what SDAG does: https://godbolt.org/z/cn3fWGvqx

Diff Detail

Event Timeline

paquette created this revision.Aug 9 2021, 11:49 AM
paquette requested review of this revision.Aug 9 2021, 11:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2021, 11:49 AM

If we have to lower these, would it be better to just do so and then let the simpler, lowered ops be re-legalized if they have odd types?

paquette updated this revision to Diff 366138.EditedAug 12 2021, 3:46 PM

Just lower it

Also add missing update to the legalizer validation test.

aemerson accepted this revision.Aug 12 2021, 8:42 PM
This revision is now accepted and ready to land.Aug 12 2021, 8:42 PM
This revision was landed with ongoing or failed builds.Aug 13 2021, 9:12 AM
This revision was automatically updated to reflect the committed changes.