This is an archive of the discontinued LLVM Phabricator instance.

[DX] Add support for PSV signature elements
ClosedPublic

Authored by beanz on Aug 10 2023, 6:48 PM.

Details

Summary

The pipeline state data captured in the PSV0 section of the DXContainer
file encodes signature elements which are read by the runtime to map
inputs and outputs from the GPU program.

This change adds support for generating and parsing signature elements
with testing driven through the ObjectYAML tooling.

Diff Detail

Event Timeline

beanz created this revision.Aug 10 2023, 6:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2023, 6:48 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
beanz requested review of this revision.Aug 10 2023, 6:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2023, 6:48 PM
bogner accepted this revision.Aug 15 2023, 12:38 PM
bogner added inline comments.
llvm/include/llvm/BinaryFormat/DXContainer.h
281

Please undef SEMANTIC_KIND after the include here (and similarly below). That's generally a good practice and avoids leaking the define into a later include.

llvm/include/llvm/MC/DXContainerPSVInfo.h
71

Probably not for this change, but it would be nice to clean up all of this swapBytes stuff to use the helpers in llvm/Endian.h instead

This revision is now accepted and ready to land.Aug 15 2023, 12:38 PM
beanz added inline comments.Aug 15 2023, 3:21 PM
llvm/include/llvm/BinaryFormat/DXContainer.h
281

I do the #undef in the header since I can't imagine a case where you'd include the .def file and not want to immediately undef the macro.

MaskRay added inline comments.Aug 15 2023, 5:09 PM
llvm/lib/MC/DXContainerPSVInfo.cpp
40

const auto &? PSVSignatureElement is large.

beanz updated this revision to Diff 550745.Aug 16 2023, 7:23 AM

Use const auto & instead of auto

bogner added inline comments.Aug 16 2023, 11:20 AM
llvm/include/llvm/BinaryFormat/DXContainer.h
281

Makes sense. Thanks!

This revision was landed with ongoing or failed builds.Aug 16 2023, 11:44 AM
This revision was automatically updated to reflect the committed changes.