LLVM 22.0.0git
|
#include "DXILRootSignature.h"
#include "DirectX.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/DXILMetadataAnalysis.h"
#include "llvm/BinaryFormat/DXContainer.h"
#include "llvm/Frontend/HLSL/RootSignatureMetadata.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/MC/DXContainerRootSignature.h"
#include "llvm/Pass.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdint>
Go to the source code of this file.
Functions | |
static std::optional< uint32_t > | extractMdIntValue (MDNode *Node, unsigned int OpId) |
static bool | reportError (LLVMContext *Ctx, Twine Message, DiagnosticSeverity Severity=DS_Error) |
static SmallDenseMap< const Function *, mcdxbc::RootSignatureDesc > | analyzeModule (Module &M) |
INITIALIZE_PASS_BEGIN (RootSignatureAnalysisWrapper, "dxil-root-signature-analysis", "DXIL Root Signature Analysis", true, true) INITIALIZE_PASS_END(RootSignatureAnalysisWrapper | |
Variables | |
dxil root signature | analysis |
dxil root signature DXIL Root Signature | Analysis |
dxil root signature DXIL Root Signature | true |
|
static |
Root Signature are specified as following in the metadata:
!dx.rootsignatures = !{!2} ; list of function/root signature pairs !2 = !{ ptr @main, !3 } ; function, root signature !3 = !{ !4, !5, !6, !7 } ; list of root signature elements
So for each MDNode inside dx.rootsignatures NamedMDNode (the Root parameter of this function), the parsing process needs to loop through each of its operands and process the function, signature pair.
Definition at line 53 of file DXILRootSignature.cpp.
References extractMdIntValue(), F, llvm::MDOperand::get(), llvm::ValueAsMetadata::getValue(), llvm::handleAllErrors(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::NamedMDNode::operands(), llvm::hlsl::rootsig::MetadataParser::ParseRootSignature(), reportError(), and llvm::Expected< T >::takeError().
Referenced by llvm::dxil::RootSignatureAnalysis::run(), and llvm::dxil::RootSignatureAnalysisWrapper::runOnModule().
Definition at line 38 of file DXILRootSignature.cpp.
Referenced by analyzeModule().
INITIALIZE_PASS_BEGIN | ( | RootSignatureAnalysisWrapper | , |
"dxil-root-signature-analysis" | , | ||
"DXIL Root Signature Analysis" | , | ||
true | , | ||
true | |||
) |
|
static |
Definition at line 46 of file DXILRootSignature.cpp.
References llvm::LLVMContext::diagnose().
Referenced by analyzeModule().
dxil root signature analysis |
Definition at line 246 of file DXILRootSignature.cpp.
dxil root signature DXIL Root Signature Analysis |
Definition at line 247 of file DXILRootSignature.cpp.
dxil root signature DXIL Root Signature true |
Definition at line 247 of file DXILRootSignature.cpp.