This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Refactor dxil metadata code
ClosedPublic

Authored by beanz on Sep 21 2022, 4:13 PM.

Details

Summary

DXIL relies on a whole bunch of IR metadata constructs being populated
in the right shape. Rather than just hard coding or using complicated
arrangements of constant data strings, let's make first-class objects
that reprensent the metadata and manage reading and writing the
metadata from the module.

Diff Detail

Event Timeline

beanz created this revision.Sep 21 2022, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2022, 4:13 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
beanz requested review of this revision.Sep 21 2022, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2022, 4:13 PM
python3kgae added inline comments.Sep 21 2022, 4:47 PM
llvm/lib/Target/DirectX/DXILMetadata.h
23

Maybe ValidatorVersionMD?

26

Shall we add something like VersionTuple getValidationVersion() to read the version?

beanz marked an inline comment as done.Sep 22 2022, 9:26 AM
beanz added inline comments.
llvm/lib/Target/DirectX/DXILMetadata.h
23

I like that name better, will update.

26

I don't want to add an API that we don't currently have a use for. I don't see any reason we couldn't add this in the future, but right now we don't need it.

beanz updated this revision to Diff 462214.Sep 22 2022, 9:42 AM
beanz marked an inline comment as done.

Renaming ValidationVersionMD -> ValidatorVersionMD

python3kgae accepted this revision.Sep 22 2022, 10:01 AM
This revision is now accepted and ready to land.Sep 22 2022, 10:01 AM
This revision was automatically updated to reflect the committed changes.