This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add support for GFX11 LDSDIR hazards
ClosedPublic

Authored by foad on Jun 16 2022, 7:16 AM.

Details

Summary

Detect LDS direct WAR/WAW hazards and compute values for
wait_vdst (va_vdst) parameter. Where appropriate this
raises wait_vdst from the default 0 to allow concurrent
issue of LDS direct with VALU execution.

Also detect LDS direct versus VMEM source VGPR hazards
and insert vm_vsrc=0 waits using s_waitcnt_depctr.

Diff Detail

Event Timeline

foad created this revision.Jun 16 2022, 7:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2022, 7:16 AM
foad requested review of this revision.Jun 16 2022, 7:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2022, 7:16 AM
foad added a reviewer: Restricted Project.Jun 16 2022, 7:17 AM
rampitec added inline comments.Jun 16 2022, 10:27 AM
llvm/test/CodeGen/AMDGPU/lds-direct-hazards.mir
5

This check does not mean there is no wait. Either use GCN-NEXT, or just generate the checks.

foad added inline comments.Jun 17 2022, 3:55 AM
llvm/test/CodeGen/AMDGPU/lds-direct-hazards.mir
5

@critson this was yours originally - any preference on how to write this test?

critson added inline comments.Jun 19 2022, 11:41 PM
llvm/test/CodeGen/AMDGPU/lds-direct-hazards.mir
5

This is testing that the LDS_PARAM_LOAD has the correct value for wait_vdst (last operand) not explicitly that there is no S_WAITCNT; however, it could make sense to do that too.
In which case we might as well generate the test now.

foad updated this revision to Diff 438270.Jun 20 2022, 12:15 AM

Generate checks.

foad marked 2 inline comments as done.Jun 20 2022, 12:15 AM
foad added inline comments.
llvm/test/CodeGen/AMDGPU/lds-direct-hazards.mir
5

OK, done!

rampitec accepted this revision.Jun 20 2022, 10:30 AM
This revision is now accepted and ready to land.Jun 20 2022, 10:30 AM
This revision was landed with ongoing or failed builds.Jun 20 2022, 1:58 PM
This revision was automatically updated to reflect the committed changes.
foad marked an inline comment as done.