76 return getTM<DirectXTargetMachine>();
92 std::optional<Reloc::Model> RM,
93 std::optional<CodeModel::Model> CM,
96 "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-"
97 "f32:32-f64:64-n8:16:32:64",
98 TT, CPU, FS,
Options, Reloc::Static, CodeModel::Small,
108#define GET_PASS_REGISTRY "DirectXPassRegistry.def"
149 bool DisableVerify) {
159 return Subtarget.get();
#define LLVM_EXTERNAL_VISIBILITY
This file provides a bitcode writing pass.
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeDirectXTarget()
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This file contains an interface for creating legacy passes to print out IR in various granularities.
PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)
Target-Independent Code Generator Pass Configuration Options pass.
DXILTargetObjectFile()=default
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Targets should implement this method to assign a section to globals with an explicit section specfied...
FunctionPass * createTargetRegisterAllocator(bool) override
createTargetRegisterAllocator - Create the register allocator pass for this target at the current opt...
void addCodeGenPrepare() override
Add pass to prepare the LLVM IR for code generation.
DirectXPassConfig(DirectXTargetMachine &TM, PassManagerBase &PM)
DirectXTargetMachine & getDirectXTargetMachine() const
DirectXTargetLowering(const DirectXTargetMachine &TM, const DirectXSubtarget &STI)
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
TargetTransformInfo getTargetTransformInfo(const Function &F) const override
Get a TargetTransformInfo implementation for the target.
~DirectXTargetMachine() override
DirectXTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOptLevel OL, bool JIT)
const DirectXSubtarget * getSubtargetImpl(const Function &) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
bool addPassesToEmitFile(PassManagerBase &PM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, bool DisableVerify, MachineModuleInfoWrapperPass *MMIWP) override
Add passes to the specified pass manager to get the specified file emitted.
bool addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx, raw_pwrite_stream &Out, bool DisableVerify) override
Add passes to the specified pass manager to get machine code emitted with the MCJIT.
void registerPassBuilderCallbacks(PassBuilder &PB) override
Allow the target to modify the pass pipeline.
FunctionPass class - This class is used to implement most global optimizations.
StringRef getSection() const
Get the custom section of this global if it has one.
This class describes a target machine that is implemented with the LLVM target-independent code gener...
bool addAsmPrinter(PassManagerBase &PM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, MCContext &Context)
Adds an AsmPrinter pass to the pipeline that prints assembly or machine code from the MI representati...
Context object for machine code objects.
MCSectionDXContainer * getDXContainerSection(StringRef Section, SectionKind K)
Get the section for the provided Section name.
MCContext & getContext() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
MachineModuleInfo & getMMI()
const MCContext & getContext() const
This class provides access to building LLVM's passes.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
SectionKind - This is a simple POD value that classifies the properties of a section.
StringRef - Represent a constant reference to a string, i.e.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Primary interface to the complete machine description for the target machine.
Target-Independent Code Generator Pass Configuration Options.
virtual void addCodeGenPrepare()
Add pass to prepare the LLVM IR for code generation.
AnalysisID addPass(AnalysisID PassID)
Utilities for targets to add passes to the pass manager.
static bool willCompleteCodeGenPipeline()
Returns true if none of the -stop-before and -stop-after options is set.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
virtual void add(Pass *P)=0
Add a pass to the queue of passes to run.
An abstract base class for streams implementations that also support a pwrite operation.
Interfaces for registering analysis passes, producing common pass manager configurations,...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
void initializeShaderFlagsAnalysisWrapperPass(PassRegistry &)
Initializer for dxil::ShaderFlagsAnalysisWrapper pass.
ModulePass * createDXILWriterPass(raw_ostream &Str)
Create and return a pass that writes the module to the specified ostream.
ModulePass * createDXILPrepareModulePass()
Pass to convert modules into DXIL-compatable modules.
ModulePass * createDXContainerGlobalsPass()
Pass for generating DXContainer part globals.
Target & getTheDirectXTarget()
void initializeDXILResourceMDWrapperPass(PassRegistry &)
Initializer for DXILTranslateMetadata.
ModulePass * createDXILTranslateMetadataPass()
Pass to emit metadata for DXIL.
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...
ModulePass * createDXILPrettyPrinterPass(raw_ostream &OS)
Pass to pretty print DXIL metadata.
void initializeDXILPrepareModulePass(PassRegistry &)
Initializer for DXIL-prepare.
ModulePass * createDXILFinalizeLinkageLegacyPass()
Pass to finalize linkage of functions.
void initializeEmbedDXILPassPass(PassRegistry &)
Initializer for dxil embedder pass.
CodeGenOptLevel
Code generation optimization level.
ModulePass * createDXILIntrinsicExpansionLegacyPass()
Pass to expand intrinsic operations that lack DXIL opCodes.
void initializeDXILFinalizeLinkageLegacyPass(PassRegistry &)
Initializer for DXILFinalizeLinkage pass.
void initializeDXILIntrinsicExpansionLegacyPass(PassRegistry &)
Initializer for DXIL Intrinsic Expansion.
ModulePass * createDXILEmbedderPass()
Create and return a pass that writes the module to a global variable in the module for later emission...
ModulePass * createDXILOpLoweringLegacyPass()
Pass to lowering LLVM intrinsic call to DXIL op function call.
ModulePass * createPrintModulePass(raw_ostream &OS, const std::string &Banner="", bool ShouldPreserveUseListOrder=false)
Create and return a pass that writes the module to the specified raw_ostream.
void initializeDXILOpLoweringLegacyPass(PassRegistry &)
Initializer for DXILOpLowering.
void initializeWriteDXILPassPass(PassRegistry &)
Initializer for dxil writer pass.
void initializeDXILTranslateMetadataPass(PassRegistry &)
Initializer for DXILTranslateMetadata.
void initializeDXContainerGlobalsPass(PassRegistry &)
Initializer for DXContainerGlobals pass.
Implement std::hash so that hash_code can be used in STL containers.
RegisterTargetMachine - Helper template for registering a target machine implementation,...