14 #ifndef LLVM_TARGET_TARGETMACHINE_H 15 #define LLVM_TARGET_TARGETMACHINE_H 29 class MachineModuleInfo;
35 class MCSubtargetInfo;
37 class raw_pwrite_stream;
38 class PassManagerBuilder;
40 class TargetIntrinsicInfo;
41 class TargetIRAnalysis;
42 class TargetTransformInfo;
43 class TargetLoweringObjectFile;
44 class TargetPassConfig;
45 class TargetSubtargetInfo;
49 class PassManagerBase;
51 using legacy::PassManagerBase;
88 std::unique_ptr<const MCRegisterInfo>
MRI;
89 std::unique_ptr<const MCInstrInfo>
MII;
90 std::unique_ptr<const MCSubtargetInfo>
STI;
122 return *
static_cast<const STC*
>(getSubtargetImpl(F));
134 return DL == Candidate;
159 void resetTargetOptions(
const Function &
F)
const;
184 bool isPositionIndependent()
const;
189 bool useEmulatedTLS()
const;
288 Mangler &Mang,
bool MayAlwaysUsePrivate =
false)
const;
321 bool DisableVerify =
true,
330 bool DisableVerify =
true)
override;
376 #endif // LLVM_TARGET_TARGETMACHINE_H const MCRegisterInfo * getMCRegisterInfo() const
A parsed version of the target data layout string in and methods for querying it. ...
StringRef getTargetFeatureString() const
unsigned PrintMachineCode
PrintMachineCode - This flag is enabled when the -print-machineinstrs option is specified on the comm...
CodeModel::Model getEffectiveCodeModel(Optional< CodeModel::Model > CM, CodeModel::Model Default)
Helper method for getting the code model, returning Default if CM does not have a value...
PassManagerBuilder - This class is used to set up a standard optimization sequence for languages like...
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
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...
unsigned DataSections
Emit data into separate sections.
bool requiresStructuredCFG() const
unsigned EnableMachineOutliner
Enables the MachineOutliner pass.
void setO0WantsFastISel(bool Enable)
Analysis pass providing the TargetTransformInfo.
virtual bool useIPRA() const
True if the target wants to use interprocedural register allocation by default.
unsigned getPointerSizeInBits(unsigned AS=0) const
Layout pointer size, in bits FIXME: The defaults need to be removed once all of the backends/clients ...
unsigned getProgramPointerSize() const
const DataLayout createDataLayout() const
Create a DataLayout.
void setGlobalISelAbort(GlobalISelAbortMode Mode)
virtual bool addPassesToEmitFile(PassManagerBase &, raw_pwrite_stream &, raw_pwrite_stream *, CodeGenFileType, bool=true, MachineModuleInfo *MMI=nullptr)
Add passes to the specified pass manager to get the specified file emitted.
unsigned getAllocaAddrSpace() const
amdgpu Simplify well known AMD library false Value Value const Twine & Name
virtual bool usesPhysRegsForPEI() const
True if the target uses physical regs at Prolog/Epilog insertion time.
bool isCompatibleDataLayout(const DataLayout &Candidate) const
Test if a DataLayout if compatible with the CodeGen for this target.
Target-Independent Code Generator Pass Configuration Options.
virtual bool isMachineVerifierClean() const
Returns true if the target is expected to pass all machine verifier checks.
Context object for machine code objects.
unsigned FunctionSections
Emit functions into separate sections.
unsigned getPointerSizeInBits(unsigned AS) const
std::unique_ptr< const MCSubtargetInfo > STI
StringRef getTargetCPU() const
unsigned UniqueSectionNames
Expected< const typename ELFT::Sym * > getSymbol(typename ELFT::SymRange Symbols, uint32_t Index)
bool getDataSections() const
Return true if data objects should be emitted into their own section, corresponds to -fdata-sections...
unsigned SupportsDefaultOutlining
Set if the target supports default outlining behaviour.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
unsigned getAllocaPointerSize() const
unsigned EnableGlobalISel
EnableGlobalISel - This flag enables global instruction selection.
This class is intended to be used as a base class for asm properties and features specific to the tar...
bool getFunctionSections() const
Return true if functions should be emitted into their own section, corresponding to -ffunction-sectio...
bool getO0WantsFastISel()
unsigned getPointerSize(unsigned AS=0) const
Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updat...
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
Interface to description of machine instruction set.
std::unique_ptr< const MCAsmInfo > AsmInfo
Contains target specific asm information.
This class describes a target machine that is implemented with the LLVM target-independent code gener...
const Triple & getTargetTriple() const
void setMachineOutliner(bool Enable)
const Target & TheTarget
The Target that this machine was created for.
const Target & getTarget() const
void setSupportsDefaultOutlining(bool Enable)
Triple - Helper class for working with autoconf configuration names.
unsigned getPointerSize(unsigned AS) const
Get the pointer size for this target.
TargetIntrinsicInfo - Interface to description of machine instruction set.
const TargetOptions DefaultOptions
virtual void adjustPassManager(PassManagerBuilder &)
Allow the target to modify the pass manager, e.g.
virtual TargetLoweringObjectFile * getObjFileLowering() const
const MCRegisterDesc & get(unsigned RegNo) const
Provide a get method, equivalent to [], but more useful with a pointer to this object.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
void setRequiresStructuredCFG(bool Value)
void setFastISel(bool Enable)
const MCSubtargetInfo * getMCSubtargetInfo() const
virtual bool targetSchedulesPostRAScheduling() const
True if subtarget inserts the final scheduling pass on its own.
unsigned getProgramAddressSpace() const
virtual const TargetSubtargetInfo * getSubtargetImpl(const Function &) const
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
Target - Wrapper for Target specific information.
unsigned RequireStructuredCFG
TargetSubtargetInfo - Generic base class for all target subtargets.
GlobalISelAbortMode
Enable abort calls when global instruction selection fails to lower/select an instruction.
bool getUniqueSectionNames() const
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
virtual const TargetIntrinsicInfo * getIntrinsicInfo() const
If intrinsic information is available, return it. If not, return null.
void setGlobalISel(bool Enable)
Generic base class for all target subtargets.
std::unique_ptr< const MCInstrInfo > MII
bool shouldPrintMachineCode() const
std::unique_ptr< const MCRegisterInfo > MRI
An abstract base class for streams implementations that also support a pwrite operation.
const DataLayout DL
DataLayout for the target: keep ABI type size and alignment.
const MCInstrInfo * getMCInstrInfo() const
LLVM Value Representation.
GlobalISelAbortMode GlobalISelAbort
EnableGlobalISelAbort - Control abort behaviour when global instruction selection fails to lower/sele...
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit...
const STC & getSubtarget(const Function &F) const
This method returns a pointer to the specified type of TargetSubtargetInfo.
This class contains meta information specific to a module.