[llvm] [DXIL][Analysis] Add validator version to info collected by Module Metadata Analysis (PR #104828)
Brian Favela via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 19 13:29:00 PDT 2024
================
@@ -25,6 +25,14 @@ static ModuleMetadataInfo collectMetadataInfo(Module &M) {
MMDAI.DXILVersion = TT.getDXILVersion();
MMDAI.ShaderModelVersion = TT.getOSVersion();
MMDAI.ShaderStage = TT.getEnvironment();
+ NamedMDNode *ValidatorVerNode = M.getNamedMetadata("dx.valver");
+ if (ValidatorVerNode) {
+ auto *ValVerMD = cast<MDNode>(ValidatorVerNode->getOperand(0));
+ auto *MajorMD = mdconst::extract<ConstantInt>(ValVerMD->getOperand(0));
+ auto *MinorMD = mdconst::extract<ConstantInt>(ValVerMD->getOperand(1));
----------------
bfavela wrote:
Should there be a check if the tuple isn't well formed, or is there a separate place that's already checked?
AFAIK, there's nothing that guarantees someone couldn't form a bad metadata header, which shouldn't be accidentally evaluated.
https://github.com/llvm/llvm-project/pull/104828
More information about the llvm-commits
mailing list