43 cl::desc(
"Enable the \"fast\" instruction selector"));
47 cl::desc(
"Enable the \"global\" instruction selector"));
65 assert(TmpAsmInfo &&
"MCAsmInfo not initialized. "
66 "Make sure you include the correct TargetSelect.h"
67 "and that InitializeAllTargetMCs() is being invoked!");
201 StopBefore, StopAfter, MFInitializer);
205 if (StopBefore || StopAfter) {
218 std::unique_ptr<MCStreamer> AsmStreamer;
233 auto FOut = llvm::make_unique<formatted_raw_ostream>(Out);
238 AsmStreamer.
reset(S);
255 AsmStreamer.reset(
getTarget().createMCObjectStreamer(
287 bool DisableVerify) {
310 std::unique_ptr<MCStreamer> AsmStreamer(
getTarget().createMCObjectStreamer(
bool addPassesToEmitFile(PassManagerBase &PM, raw_pwrite_stream &Out, CodeGenFileType FileType, bool DisableVerify=true, AnalysisID StartBefore=nullptr, AnalysisID StartAfter=nullptr, AnalysisID StopBefore=nullptr, AnalysisID StopAfter=nullptr, MachineFunctionInitializer *MFInitializer=nullptr) override
Add passes to the specified pass manager to get the specified file emitted.
unsigned getAssemblerDialect() const
StringRef getTargetCPU() const
MCTargetOptions MCOptions
Machine level options.
void setCompressDebugSections(DebugCompressionType CompressDebugSections)
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
virtual void setUseIntegratedAssembler(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
#define LLVM_UNLIKELY(EXPR)
void setDisableVerify(bool Disable)
MCRegisterInfo * createMCRegInfo(StringRef TT) const
createMCRegInfo - Create a MCRegisterInfo implementation.
virtual void reset()
State management.
MCStreamer * createNullStreamer(MCContext &Ctx)
Create a dummy machine code streamer, which does nothing.
ImmutablePass * createTargetTransformInfoWrapperPass(TargetIRAnalysis TIRA)
Create an analysis pass wrapper around a TTI object.
void setO0WantsFastISel(bool Enable)
Analysis pass providing the TargetTransformInfo.
print alias Alias Set Printer
CodeGenOpt::Level OptLevel
virtual TargetPassConfig * createPassConfig(PassManagerBase &PM)
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
const MCRegisterInfo * getMCRegisterInfo() const
const Triple & getTargetTriple() const
MCInstrInfo * createMCInstrInfo() const
createMCInstrInfo - Create a MCInstrInfo implementation.
MCSubtargetInfo * createMCSubtargetInfo(StringRef TheTriple, StringRef CPU, StringRef Features) const
createMCSubtargetInfo - Create a MCSubtargetInfo implementation.
unsigned DisableIntegratedAS
Disable the integrated assembler.
MachineFunctionPass * createResetMachineFunctionPass(bool EmitFallbackDiag)
This pass resets a MachineFunction when it has the FailedISel property as if it was just created...
MCAsmBackend * createMCAsmBackend(const MCRegisterInfo &MRI, StringRef TheTriple, StringRef CPU, const MCTargetOptions &Options) const
createMCAsmBackend - Create a target specific assembly parser.
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
virtual bool addLegalizeMachineIR()
This method should install a legalize pass, which converts the instruction sequence into one that can...
void setUseNamesOnTempLabels(bool Value)
virtual bool isGlobalISelAbortEnabled() const
Check whether or not GlobalISel should abort on error.
ExceptionHandling ExceptionModel
What exception model to use.
AsmPrinter * createAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > &&Streamer) const
createAsmPrinter - Create a target specific assembly printer pass.
Target-Independent Code Generator Pass Configuration Options.
const MCAsmInfo * AsmInfo
Contains target specific asm information.
Context object for machine code objects.
const MCInstrInfo * getMCInstrInfo() const
virtual void addMachinePasses()
Add the complete, standard set of LLVM CodeGen passes.
void setStartStopPasses(AnalysisID StartBefore, AnalysisID StartAfter, AnalysisID StopBefore, AnalysisID StopAfter)
Set the StartAfter, StartBefore and StopAfter passes to allow running only a portion of the normal co...
const MCSubtargetInfo * STI
virtual bool reportDiagnosticWhenGlobalISelFallback() const
Check whether or not a diagnostic should be emitted when GlobalISel uses the fallback path...
bool addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx, raw_pwrite_stream &OS, bool DisableVerify=true) override
Add passes to the specified pass manager to get machine code emitted with the MCJIT.
virtual void addPreLegalizeMachineIR()
This method may be implemented by targets that want to run passes immediately before legalization...
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
bool PreserveAsmComments
Preserve Comments in Assembly.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
This class is intended to be used as a base class for asm properties and features specific to the tar...
initializer< Ty > init(const Ty &Val)
MCAsmInfo * createMCAsmInfo(const MCRegisterInfo &MRI, StringRef TheTriple) const
createMCAsmInfo - Create a MCAsmInfo implementation for the specified target triple.
Streaming machine code generation interface.
virtual void setPreserveAsmComments(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
bool getO0WantsFastISel()
void setAllowTemporaryLabels(bool Value)
Concrete BasicTTIImpl that can be used if no further customization is needed.
bool MCIncrementalLinkerCompatible
MCCodeEmitter - Generic instruction encoding interface.
Interface to description of machine instruction set.
FunctionPass * createFreeMachineFunctionPass()
This pass frees the memory occupied by the MachineFunction.
virtual bool addInstSelector()
addInstSelector - This method should install an instruction selector pass, which converts from LLVM c...
MCCodeEmitter * createMCCodeEmitter(const MCInstrInfo &II, const MCRegisterInfo &MRI, MCContext &Ctx) const
createMCCodeEmitter - Create a target specific code emitter.
This class describes a target machine that is implemented with the LLVM target-independent code gener...
FunctionPass class - This class is used to implement most global optimizations.
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
virtual void addISelPrepare()
Add common passes that perform LLVM IR to IR transforms in preparation for instruction selection...
virtual void addCodeGenPrepare()
Add pass to prepare the LLVM IR for code generation.
void setRelaxELFRelocations(bool V)
const Target & TheTarget
The Target that this machine was created for.
cl::opt< TargetMachine::CodeGenFileType > FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile), cl::desc("Choose a file type (not all types are supported by all targets):"), cl::values(clEnumValN(TargetMachine::CGFT_AssemblyFile,"asm","Emit an assembly ('.s') file"), clEnumValN(TargetMachine::CGFT_ObjectFile,"obj","Emit a native object ('.o') file"), clEnumValN(TargetMachine::CGFT_Null,"null","Emit nothing, for performance testing")))
void adjustCodeGenOpts(const Triple &TT, Reloc::Model RM, CodeModel::Model &CM) const
MCInstPrinter * createMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI) const
void addPassesToHandleExceptions()
Add passes to lower exception handling for the code generator.
unsigned CompressDebugSections
Compress DWARF debug sections.
static cl::opt< cl::boolOrDefault > EnableFastISelOption("fast-isel", cl::Hidden, cl::desc("Enable the \"fast\" instruction selector"))
Triple - Helper class for working with autoconf configuration names.
virtual void addPreRegBankSelect()
This method may be implemented by targets that want to run passes immediately before the register ban...
void setMachineFunctionInitializer(MachineFunctionInitializer *MFInit)
StringRef getTargetFeatureString() const
const MCContext & getContext() const
void setFastISel(bool Enable)
LLVMTargetMachine(const Target &T, StringRef DataLayoutString, const Triple &TargetTriple, StringRef CPU, StringRef FS, TargetOptions Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
virtual bool addGlobalInstructionSelect()
This method should install a (global) instruction selector pass, which converts possibly generic inst...
static MCContext * addPassesToGenerateCode(LLVMTargetMachine *TM, PassManagerBase &PM, bool DisableVerify, AnalysisID StartBefore, AnalysisID StartAfter, AnalysisID StopBefore, AnalysisID StopAfter, MachineFunctionInitializer *MFInitializer=nullptr)
addPassesToX helper drives creation and initialization of TargetPassConfig.
Target - Wrapper for Target specific information.
unsigned EmulatedTLS
EmulatedTLS - This flag enables emulated TLS model, using emutls function in the runtime library...
virtual bool addRegBankSelect()
This method should install a register bank selector pass, which assigns register banks to virtual reg...
unsigned RelaxELFRelocations
const MCRegisterInfo * MRI
MCStreamer * createAsmStreamer(MCContext &Ctx, std::unique_ptr< formatted_raw_ostream > OS, bool IsVerboseAsm, bool UseDwarfDirectory, MCInstPrinter *InstPrint, MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst) const
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
virtual void addPreGlobalInstructionSelect()
This method may be implemented by targets that want to run passes immediately before the (global) ins...
MCSubtargetInfo - Generic base class for all target subtargets.
const MCSubtargetInfo * getMCSubtargetInfo() const
ModulePass * createLowerEmuTLSPass(const TargetMachine *TM)
LowerEmuTLS - This pass generates __emutls_[vt].xyz variables for all TLS variables for the emulated ...
This file defines passes to print out IR in various granularities.
An abstract base class for streams implementations that also support a pwrite operation.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Generic interface to target specific assembler backends.
ModulePass * createPreISelIntrinsicLoweringPass()
This pass lowers the .load.relative intrinsic to instructions.
const Target & getTarget() const
Primary interface to the complete machine description for the target machine.
void setExceptionsType(ExceptionHandling EH)
StringRef - Represent a constant reference to a string, i.e.
This interface provides a way to initialize machine functions after they are created by the machine f...
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit...
TargetIRAnalysis getTargetIRAnalysis() override
Get a TargetIRAnalysis implementation for the target.
virtual bool addIRTranslator()
This method should install an IR translator pass, which converts from LLVM code to machine instructio...
MachineFunctionPass * createPrintMIRPass(raw_ostream &OS)
MIRPrinting pass - this pass prints out the LLVM IR into the given stream using the MIR serialization...
static cl::opt< bool > EnableGlobalISel("global-isel", cl::Hidden, cl::init(false), cl::desc("Enable the \"global\" instruction selector"))
This class contains meta information specific to a module.