14 #ifndef LLVM_TARGET_TARGETMACHINE_H
15 #define LLVM_TARGET_TARGETMACHINE_H
28 class MachineFunctionInitializer;
34 class MCSubtargetInfo;
36 class raw_pwrite_stream;
38 class TargetIntrinsicInfo;
39 class TargetIRAnalysis;
40 class TargetLoweringObjectFile;
41 class TargetPassConfig;
42 class TargetSubtargetInfo;
46 class PassManagerBase;
48 using legacy::PassManagerBase;
132 return DL == Candidate;
254 Mangler &Mang,
bool MayAlwaysUsePrivate =
false)
const;
290 bool DisableVerify =
true,
AnalysisID StartBefore =
nullptr,
301 bool DisableVerify =
true)
override;
306 #endif // LLVM_TARGET_TARGETMACHINE_H
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.
TargetMachine(const Target &T, StringRef DataLayoutString, const Triple &TargetTriple, StringRef CPU, StringRef FS, const TargetOptions &Options)
A parsed version of the target data layout string in and methods for querying it. ...
StringRef getTargetCPU() const
unsigned PrintMachineCode
PrintMachineCode - This flag is enabled when the -print-machineinstrs option is specified on the comm...
void getNameWithPrefix(SmallVectorImpl< char > &Name, const GlobalValue *GV, Mangler &Mang, bool MayAlwaysUsePrivate=false) const
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
virtual bool addPassesToEmitMC(PassManagerBase &, MCContext *&, raw_pwrite_stream &, bool=true)
Add passes to the specified pass manager to get machine code emitted with the MCJIT.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
unsigned EnableFastISel
EnableFastISel - This flag enables fast-path instruction selection which trades away generated code q...
A Module instance is used to store all the information related to an LLVM module. ...
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
MCSymbol * getSymbol(const GlobalValue *GV) const
unsigned DataSections
Emit data into separate sections.
virtual bool usesPhysRegsForPEI() const
True if the target uses physical regs at Prolog/Epilog insertion time.
void setO0WantsFastISel(bool Enable)
Analysis pass providing the TargetTransformInfo.
virtual bool targetSchedulesPostRAScheduling() const
True if subtarget inserts the final scheduling pass on its own.
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
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
virtual TargetLoweringObjectFile * getObjFileLowering() const
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
const MCSubtargetInfo * STI
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.
unsigned FunctionSections
Emit functions into separate sections.
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
unsigned UniqueSectionNames
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...
bool isCompatibleDataLayout(const DataLayout &Candidate) const
Test if a DataLayout if compatible with the CodeGen for this target.
bool getO0WantsFastISel()
CodeModel::Model getCodeModel() const
Returns the code model.
void operator=(const TargetMachine &)=delete
virtual TargetIRAnalysis getTargetIRAnalysis()
Get a TargetIRAnalysis appropriate for the target.
Interface to description of machine instruction set.
bool isPositionIndependent() const
This class describes a target machine that is implemented with the LLVM target-independent code gener...
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")))
bool getFunctionSections() const
Return true if functions should be emitted into their own section, corresponding to -ffunction-sectio...
bool shouldAssumeDSOLocal(const Module &M, const GlobalValue *GV) const
Triple - Helper class for working with autoconf configuration names.
bool getDataSections() const
Return true if data objects should be emitted into their own section, corresponds to -fdata-sections...
TargetIntrinsicInfo - Interface to description of machine instruction set.
const TargetOptions DefaultOptions
virtual const TargetSubtargetInfo * getSubtargetImpl(const Function &) const
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
StringRef getTargetFeatureString() const
virtual bool addPassesToEmitFile(PassManagerBase &, raw_pwrite_stream &, CodeGenFileType, bool=true, AnalysisID=nullptr, AnalysisID=nullptr, AnalysisID=nullptr, AnalysisID=nullptr, MachineFunctionInitializer *=nullptr)
Add passes to the specified pass manager to get the specified file emitted.
void setRequiresStructuredCFG(bool Value)
void setFastISel(bool Enable)
static const char * Target
LLVMTargetMachine(const Target &T, StringRef DataLayoutString, const Triple &TargetTriple, StringRef CPU, StringRef FS, TargetOptions Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
bool getUniqueSectionNames() const
const STC & getSubtarget(const Function &F) const
This method returns a pointer to the specified type of TargetSubtargetInfo.
Target - Wrapper for Target specific information.
unsigned RequireStructuredCFG
const MCRegisterInfo * MRI
TargetSubtargetInfo - Generic base class for all target subtargets.
virtual const TargetIntrinsicInfo * getIntrinsicInfo() const
If intrinsic information is available, return it. If not, return null.
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
MCSubtargetInfo - Generic base class for all target subtargets.
const MCSubtargetInfo * getMCSubtargetInfo() const
void setOptLevel(CodeGenOpt::Level Level)
Overrides the optimization level.
const DataLayout createDataLayout() const
Create a DataLayout.
bool shouldPrintMachineCode() const
An abstract base class for streams implementations that also support a pwrite operation.
TLSModel::Model getTLSModel(const GlobalValue *GV) const
Returns the TLS model which should be used for the given global variable.
unsigned getPointerSize() const
Get the pointer size for this target.
const DataLayout DL
DataLayout for the target: keep ABI type size and alignment.
LLVM Value Representation.
const Target & getTarget() const
Primary interface to the complete machine description for the target machine.
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.
unsigned getPointerSize(unsigned AS=0) const
Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updat...
bool requiresStructuredCFG() const
virtual void addEarlyAsPossiblePasses(PassManagerBase &)
Add target-specific function passes that should be run as early as possible in the optimization pipel...