LLVM 22.0.0git
DXILRootSignature.cpp File Reference

Go to the source code of this file.

Functions

static std::optional< uint32_textractMdIntValue (MDNode *Node, unsigned int OpId)
static bool reportError (LLVMContext *Ctx, Twine Message, DiagnosticSeverity Severity=DS_Error)
static SmallDenseMap< const Function *, mcdxbc::RootSignatureDescanalyzeModule (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

Function Documentation

◆ analyzeModule()

SmallDenseMap< const Function *, mcdxbc::RootSignatureDesc > analyzeModule ( Module & M)
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 assert(), llvm::dyn_cast(), extractMdIntValue(), F, llvm::MDOperand::get(), llvm::NamedMDNode::getNumOperands(), llvm::ValueAsMetadata::getValue(), llvm::handleAllErrors(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::NamedMDNode::operands(), llvm::hlsl::rootsig::MetadataParser::ParseRootSignature(), reportError(), llvm::Triple::RootSignature, and llvm::Expected< T >::takeError().

Referenced by llvm::dxil::RootSignatureAnalysis::run(), and llvm::dxil::RootSignatureAnalysisWrapper::runOnModule().

◆ extractMdIntValue()

std::optional< uint32_t > extractMdIntValue ( MDNode * Node,
unsigned int OpId )
static

Definition at line 38 of file DXILRootSignature.cpp.

References llvm::mdconst::dyn_extract().

Referenced by analyzeModule().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( RootSignatureAnalysisWrapper ,
"dxil-root-signature-analysis" ,
"DXIL Root Signature Analysis" ,
true ,
true  )

References INITIALIZE_PASS_END.

◆ reportError()

bool reportError ( LLVMContext * Ctx,
Twine Message,
DiagnosticSeverity Severity = DS_Error )
static

Definition at line 46 of file DXILRootSignature.cpp.

References llvm::DS_Error.

Referenced by analyzeModule().

Variable Documentation

◆ Analysis

dxil root signature DXIL Root Signature Analysis

Definition at line 259 of file DXILRootSignature.cpp.

◆ analysis

dxil root signature analysis

Definition at line 258 of file DXILRootSignature.cpp.

◆ true

dxil root signature DXIL Root Signature true

Definition at line 259 of file DXILRootSignature.cpp.