This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Select buffer_atomic_cmpswap* in tblgen
ClosedPublic

Authored by abinavpp on Mar 15 2022, 10:40 PM.

Details

Summary

This change replaces the manual selection of buffer_atomic_cmpswap*
instructions in SelectionDAG and GlobalISel with a tblgen based
selection in BUFInstructions.td. This allows us to select the return and
no-return variants in tblgen.

Diff Detail

Event Timeline

abinavpp created this revision.Mar 15 2022, 10:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2022, 10:40 PM
abinavpp requested review of this revision.Mar 15 2022, 10:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2022, 10:40 PM
arsenm accepted this revision.Mar 16 2022, 7:38 AM
This revision is now accepted and ready to land.Mar 16 2022, 7:38 AM
This revision was landed with ongoing or failed builds.Mar 16 2022, 9:43 PM
This revision was automatically updated to reflect the committed changes.
cdevadas added inline comments.
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgpu-atomic-cmpxchg-global.mir
537

Surprised to see the AV class for gfx6, gfx7 where we don't have AGPRs at all. Also, we don't select AV classes during selection.
They are made allocatable for better handling the spills during regalloc.

abinavpp added inline comments.Mar 17 2022, 10:49 AM
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgpu-atomic-cmpxchg-global.mir
537

Oops. I haven't looked into how these are selected yet. D121933 can fix this, but I'm not sure if there's a better way.