This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][GlobalISel] Scalarize add/sub with overflow ops in the legalizer
ClosedPublic

Authored by abinavpp on Mar 31 2022, 5:37 AM.

Diff Detail

Event Timeline

abinavpp created this revision.Mar 31 2022, 5:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2022, 5:37 AM
abinavpp requested review of this revision.Mar 31 2022, 5:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2022, 5:37 AM
foad added inline comments.Mar 31 2022, 5:42 AM
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
635

Surely you don't need both of these lines - all operands are vectors or all are scalars.

abinavpp updated this revision to Diff 419412.Mar 31 2022, 5:53 AM

Remove the explicit scalarize of type-index 1

foad accepted this revision.Mar 31 2022, 6:02 AM

LGTM, though it would be even better if we had some *.ll tests for these so we could see how it affects codegen.

This revision is now accepted and ready to land.Mar 31 2022, 6:02 AM
arsenm accepted this revision.Mar 31 2022, 6:04 AM
arsenm added inline comments.
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-sadde.mir
53

I'm a bit surprised we don't end up with s32 = G_ZEXT s1. Do we have an optimization that puts this back together?

We should probably have some end to end IR tests for these operations too.

abinavpp updated this revision to Diff 419455.Mar 31 2022, 7:41 AM

Rebased on top of D122818

This revision was landed with ongoing or failed builds.Mar 31 2022, 9:24 AM
This revision was automatically updated to reflect the committed changes.