LLVM: lib/Target/DirectX/DirectXTargetMachine.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

52#include

53

54using namespace llvm;

55

83

85public:

87

92

93protected:

98};

99

131

135 std::optionalReloc::Model RM,

136 std::optionalCodeModel::Model CM,

143}

144

146

148#define GET_PASS_REGISTRY "DirectXPassRegistry.def"

150}

151

158

159 switch (FileType) {

163 break;

167

168

170

171 if (!MMIWP)

173 PM.add(MMIWP);

176 return true;

177 } else

179 break;

181 break;

182 }

183 return false;

184}

185

189 bool DisableVerify) {

190 return true;

191}

192

196

199 return Subtarget.get();

200}

201

206

#define LLVM_EXTERNAL_VISIBILITY

This file provides a bitcode writing pass.

LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeDirectXTarget()

Definition DirectXTargetMachine.cpp:57

This file contains an interface for creating legacy passes to print out IR in various granularities.

PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)

This pass converts vector operations into scalar operations (or, optionally, operations on smaller ve...

static TableGen::Emitter::OptClass< SkeletonEmitter > X("gen-skeleton-class", "Generate example skeleton class")

Target-Independent Code Generator Pass Configuration Options pass.

DXILTargetObjectFile()=default

MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override

Definition DirectXTargetMachine.cpp:94

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...

Definition DirectXTargetMachine.cpp:88

FunctionPass * createTargetRegisterAllocator(bool) override

createTargetRegisterAllocator - Create the register allocator pass for this target at the current opt...

Definition DirectXTargetMachine.cpp:109

void addCodeGenPrepare() override

Add pass to prepare the LLVM IR for code generation.

Definition DirectXTargetMachine.cpp:110

DirectXPassConfig(DirectXTargetMachine &TM, PassManagerBase &PM)

Definition DirectXTargetMachine.cpp:102

DirectXTargetMachine & getDirectXTargetMachine() const

Definition DirectXTargetMachine.cpp:105

CodeGenTargetMachineImpl(const Target &T, StringRef DataLayoutString, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOptLevel OL)

bool addAsmPrinter(PassManagerBase &PM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, MCContext &Context) override

Adds an AsmPrinter pass to the pipeline that prints assembly or machine code from the MI representati...

const DirectXRegisterInfo * getRegisterInfo() const override

DirectXTargetLowering(const DirectXTargetMachine &TM, const DirectXSubtarget &STI)

Definition DirectXTargetMachine.cpp:207

TargetPassConfig * createPassConfig(PassManagerBase &PM) override

Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...

Definition DirectXTargetMachine.cpp:193

TargetTransformInfo getTargetTransformInfo(const Function &F) const override

Get a TargetTransformInfo implementation for the target.

Definition DirectXTargetMachine.cpp:203

~DirectXTargetMachine() override

Definition DirectXTargetMachine.cpp:145

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)

Definition DirectXTargetMachine.cpp:132

const DirectXSubtarget * getSubtargetImpl(const Function &) const override

Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...

Definition DirectXTargetMachine.cpp:198

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.

Definition DirectXTargetMachine.cpp:152

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.

Definition DirectXTargetMachine.cpp:186

void registerPassBuilderCallbacks(PassBuilder &PB) override

Allow the target to modify the pass pipeline.

Definition DirectXTargetMachine.cpp:147

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.

Context object for machine code objects.

LLVM_ABI 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 LLVM_ABI 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.

void computeRegisterProperties(const TargetRegisterInfo *TRI)

Once all of the register classes are added, this allows us to compute derived properties we expose.

void addRegisterClass(MVT VT, const TargetRegisterClass *RC)

Add the specified register class as an available regclass for the specified value type.

TargetLoweringObjectFile()=default

TargetLowering(const TargetLowering &)=delete

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.

TargetPassConfig(TargetMachine &TM, PassManagerBase &PM)

TMC & getTM() const

Get the right type of TargetMachine for this target.

static bool willCompleteCodeGenPipeline()

Returns true if none of the -stop-before and -stop-after options is set.

This pass provides access to the codegen interfaces that are needed for IR-level transformations.

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.

LLVM_ABI void initializeDSELegacyPassPass(PassRegistry &)

void initializeShaderFlagsAnalysisWrapperPass(PassRegistry &)

Initializer for dxil::ShaderFlagsAnalysisWrapper pass.

FunctionPass * createDXILLegalizeLegacyPass()

Pass to Legalize DXIL by remove i8 truncations and i64 insert/extract elements.

void initializeDXILPrettyPrinterLegacyPass(PassRegistry &)

Initializer for DXILPrettyPrinter.

ModulePass * createDXILDataScalarizationLegacyPass()

Pass to scalarize llvm global data into a DXIL legal form.

ModulePass * createDXILWriterPass(raw_ostream &Str)

Create and return a pass that writes the module to the specified ostream.

ModulePass * createDXILPostOptimizationValidationLegacyPass()

Pass to lowering LLVM intrinsic call to DXIL op function call.

ModulePass * createDXILTranslateMetadataLegacyPass()

Pass to emit metadata for DXIL.

void initializeDXILCBufferAccessLegacyPass(PassRegistry &)

Initializer for DXIL CBuffer Access Pass.

void initializeDXILFlattenArraysLegacyPass(PassRegistry &)

Initializer for DXIL Array Flatten Pass.

void initializeRootSignatureAnalysisWrapperPass(PassRegistry &)

Initializer for dxil::RootSignatureAnalysisWrapper pass.

ModulePass * createDXILPrepareModulePass()

Pass to convert modules into DXIL-compatable modules.

ModulePass * createDXContainerGlobalsPass()

Pass for generating DXContainer part globals.

ModulePass * createDXILCBufferAccessLegacyPass()

Pass to translate loads in the cbuffer address space to intrinsics.

LLVM_ABI ModulePass * createGlobalDCEPass()

ModulePass * createDXILFlattenArraysLegacyPass()

Pass to flatten arrays into a one dimensional DXIL legal form.

ModulePass * createDXILResourceImplicitBindingLegacyPass()

Pass to assign register slots to resources without binding.

Target & getTheDirectXTarget()

LLVM_ABI void initializeGlobalDCELegacyPassPass(PassRegistry &)

FunctionPass * createDXILResourceAccessLegacyPass()

Pass to update resource accesses to use load/store directly.

CodeGenFileType

These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...

void initializeDXILResourceImplicitBindingLegacyPass(PassRegistry &)

Initializer for DXILResourceImplicitBindingLegacyPass.

void initializeDXILPrepareModulePass(PassRegistry &)

Initializer for DXIL-prepare.

void initializeDXILForwardHandleAccessesLegacyPass(PassRegistry &)

Initializer for DXIL Forward Handle Accesses Pass.

void initializeDXILDataScalarizationLegacyPass(PassRegistry &)

Initializer for DXIL Data Scalarization Pass.

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.

void initializeDXILLegalizeLegacyPass(PassRegistry &)

Initializer DXIL legalizationPass.

LLVM_ABI 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.

ModulePass * createDXILEmbedderPass()

Create and return a pass that writes the module to a global variable in the module for later emission...

LLVM_ABI FunctionPass * createScalarizerPass(const ScalarizerPassOptions &Options=ScalarizerPassOptions())

Create a legacy pass manager instance of the Scalarizer pass.

ModulePass * createDXILOpLoweringLegacyPass()

Pass to lowering LLVM intrinsic call to DXIL op function call.

LLVM_ABI FunctionPass * createDeadStoreEliminationPass()

void initializeDXILPostOptimizationValidationLegacyPass(PassRegistry &)

Initializer for DXILPostOptimizationValidation.

void initializeDXILOpLoweringLegacyPass(PassRegistry &)

Initializer for DXILOpLowering.

void initializeWriteDXILPassPass(PassRegistry &)

Initializer for dxil writer pass.

ModulePass * createDXILPrettyPrinterLegacyPass(raw_ostream &OS)

Pass to pretty print DXIL metadata.

LLVM_ABI void initializeScalarizerLegacyPassPass(PassRegistry &)

void initializeDXContainerGlobalsPass(PassRegistry &)

Initializer for DXContainerGlobals pass.

FunctionPass * createDXILForwardHandleAccessesLegacyPass()

Pass to eliminate redundant stores and loads from handle globals.

void initializeDXILResourceAccessLegacyPass(PassRegistry &)

Initializer for DXILResourceAccess.

void initializeDXILTranslateMetadataLegacyPass(PassRegistry &)

Initializer for DXILTranslateMetadata.

Implement std::hash so that hash_code can be used in STL containers.

RegisterTargetMachine - Helper template for registering a target machine implementation,...

bool ScalarizeLoadStore

Allow the scalarizer pass to scalarize loads and store.