This is an archive of the discontinued LLVM Phabricator instance.

[HLSL] Move DXIL validation version out of ModuleFlags
ClosedPublic

Authored by python3kgae on Jul 20 2022, 3:35 PM.

Details

Summary

Put DXIL validation version into separate NamedMetadata to avoid update ModuleFlags.

Currently DXIL validation version is saved in ModuleFlags in clang codeGen.
Then in DirectX backend, the data will be extracted from ModuleFlags and cause rebuild of ModuleFlags.
This patch will build NamedMetadata for DXIL validation version and remove the code to rebuild ModuleFlags.

Diff Detail

Event Timeline

python3kgae created this revision.Jul 20 2022, 3:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2022, 3:35 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
python3kgae requested review of this revision.Jul 20 2022, 3:35 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 20 2022, 3:35 PM

A few nitpicks, otherwise this looks good.

llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp
60–61

Better to remove this function if it is empty. If we need it in the future we can re-introduce it.

78–79

nit: LLVM's coding conventions discourage blanket use of auto. This one is a bit on the edge of the convention. My preference would be for this to have the type because I think that is more clear.

see: https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable

79

This should definitely have the type, not auto.

python3kgae marked 3 inline comments as done.

Remove empty function and replace auto with correct type.

beanz accepted this revision.Aug 26 2022, 7:17 AM
This revision is now accepted and ready to land.Aug 26 2022, 7:17 AM