Closed bogner closed 1 month ago
To do this we'll need to start by doing something like the resource analysis in #100700 and #100699, but with a much simpler analysis result - essentially just a struct containing the various pieces of metadata we'll need throughout the backend. We can collect the necessary info from the various internal LLVM constructs (like the target triple, entry point attributes, etc) and then consumers can just look at the analysis result. Keep in mind that at some point we'll also want to be able to collect the same info from the DXIL metadata itself so that we can support translation in the other direction through the same abstraction.
Item2 of AC viz, "DXILTranslateMetadata uses the types defined for the analysis results of that pass where appropriate" needs to be implemented.
We need an analysis pass, DXILMetadataAnalysis, that reads information such as the validator version, shader model and stage, entry point properties, and pre SM6.6 resource bindings from a DXIL module. The result of this analysis should be an abstraction of the various pieces of metadata that DXIL stores. This will be used for translating DXIL into modern LLVM for tooling and testing purposes.
This should also mean we can drop the abstractions in lib/Target/DirectX/DXILMetadata.cpp and have DXILTranslateMetadata and friends use the DXILMetadataAnalysis structures as necessary instead.
Acceptance Criteria