This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add functions for composing and decomposing S_WAIT_DEPCTR operands
ClosedPublic

Authored by stepthomas on Jul 4 2023, 2:39 AM.

Details

Summary

Add functions AMDGPU::DepCtr::encodeField*() and AMDGPU::DepCtr::decodeField*()
for each of vm_vsrc, va_vdst and sa_sdst. These are now used in
AMDGPUInsertDelayAlu and GCNHazardRecognizer so as to make working with
S_WAITCNT_DEPCTR operands easier and more readable.

Diff Detail

Event Timeline

stepthomas created this revision.Jul 4 2023, 2:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 4 2023, 2:39 AM
stepthomas requested review of this revision.Jul 4 2023, 2:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 4 2023, 2:39 AM
stepthomas added inline comments.Jul 4 2023, 2:43 AM
llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
1297

This is wrong. it should be a simple test that sa_sdst is zero, not a test that everything that isn't sa_sdst is set while sa_sdst isn't cared about. Fixing this requires a lit test to be updated, however, so I'll make that a separate patch.

foad accepted this revision.Jul 4 2023, 2:58 AM

LGTM.

llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
1173

Strictly speaking changes like this one are not NFC, since the new code ignores the non-VmVsrc bits of the immediate value, but that seems like an obvious improvement.

This revision is now accepted and ready to land.Jul 4 2023, 2:58 AM
This revision was landed with ongoing or failed builds.Jul 4 2023, 3:04 AM
This revision was automatically updated to reflect the committed changes.