42 void addPipelineStateValidationInfo(
Module &M,
52 return "DXContainer Global Emitter";
65bool DXContainerGlobals::runOnModule(
Module &M) {
69 addSignature(M, Globals);
70 addPipelineStateValidationInfo(M, Globals);
77 static_cast<uint64_t>(getAnalysis<ShaderFlagsAnalysisWrapper>()
82 ConstantInt::get(
M.getContext(),
APInt(64, FeatureFlags));
83 return buildContainerGlobal(M, FeatureFlagsConstant,
"dx.sfi0",
"SFI0");
88 cast<ConstantDataArray>(
M.getNamedGlobal(
"dx.dxil")->getInitializer());
90 Digest.
update(DXILConstant->getRawDataValues());
96 if (
M.debug_compile_units_begin() !=
M.debug_compile_units_end())
97 HashData.
Flags =
static_cast<uint32_t>(dxbc::HashFlags::IncludesSource);
99 memcpy(
reinterpret_cast<void *
>(&HashData.
Digest),
Result.data(), 16);
106 return buildContainerGlobal(M, ModuleConstant,
"dx.hash",
"HASH");
114 GV->setAlignment(
Align(4));
129void DXContainerGlobals::addSignature(
Module &M,
135 Globals.
emplace_back(buildSignature(M, InputSig,
"dx.isg1",
"ISG1"));
138 Globals.
emplace_back(buildSignature(M, OutputSig,
"dx.osg1",
"OSG1"));
141void DXContainerGlobals::addPipelineStateValidationInfo(
169char DXContainerGlobals::ID = 0;
171 "DXContainer Global Emitter",
false,
true)
177 return new DXContainerGlobals();
This file contains the declarations for the subclasses of Constant, which represent the different fla...
dxil DXContainer Global Emitter
Module.h This file contains the declarations for the Module class.
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
This file defines the SmallVector class.
Class for arbitrary precision integers.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
static Constant * getString(LLVMContext &Context, StringRef Initializer, bool AddNull=true)
This method constructs a CDS and initializes it with a text string.
static Constant * get(LLVMContext &Context, ArrayRef< ElementTy > Elts)
get() constructor - Return a constant with array type with an element count and element type matching...
This is an important base class in LLVM.
@ PrivateLinkage
Like Internal, but omit from symbol table.
void update(ArrayRef< uint8_t > Data)
Updates the hash for the byte stream provided.
void final(MD5Result &Result)
Finishes off the hash and puts the result in result.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
virtual bool runOnModule(Module &M)=0
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
A Module instance is used to store all the information related to an LLVM module.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
reference emplace_back(ArgTypes &&... Args)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
Wrapper pass for the legacy pass manager.
void write(raw_ostream &OS)
A raw_ostream that writes to an SmallVector or SmallString.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
constexpr bool IsBigEndianHost
This is an optimization pass for GlobalISel generic memory operations.
ModulePass * createDXContainerGlobalsPass()
Pass for generating DXContainer part globals.
@ Global
Append to llvm.global_dtors.
void appendToCompilerUsed(Module &M, ArrayRef< GlobalValue * > Values)
Adds global values to the llvm.compiler.used list.
void initializeDXContainerGlobalsPass(PassRegistry &)
Initializer for DXContainerGlobals pass.
This struct is a compact representation of a valid (non-zero power of two) alignment.
uint32_t MaximumWaveLaneCount
uint32_t MinimumWaveLaneCount
dxbc::PSV::v3::RuntimeInfo BaseData
llvm::StringRef EntryName
void finalize(Triple::EnvironmentType Stage)
void write(raw_ostream &OS, uint32_t Version=std::numeric_limits< uint32_t >::max()) const