[HLSL] Move DXIL validation version out of ModuleFlags
authorXiang Li <python3kgae@outlook.com>
Wed, 20 Jul 2022 22:27:41 +0000 (15:27 -0700)
committerXiang Li <python3kgae@outlook.com>
Fri, 26 Aug 2022 16:20:45 +0000 (09:20 -0700)
commita0ecb4a2991d6163c16c29bee8cd63720ee7d3d7
treeb8428dc820f2e633d1971ae89337424154e22651
parent7744253f12a84879aa58522346e919df8b65364e
[HLSL] Move DXIL validation version out of ModuleFlags

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.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D130207
clang/lib/CodeGen/CGHLSLRuntime.cpp
clang/test/CodeGenHLSL/validator_version.hlsl
llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp
llvm/test/CodeGen/DirectX/dxil_ver.ll