13 #ifndef LLVM_TARGET_TARGETMACHINE_H 14 #define LLVM_TARGET_TARGETMACHINE_H 28 class MachineModuleInfoWrapperPass;
34 class MCSubtargetInfo;
36 class raw_pwrite_stream;
37 class PassManagerBuilder;
38 struct PerFunctionMIParsingState;
42 class TargetIntrinsicInfo;
43 class TargetIRAnalysis;
44 class TargetTransformInfo;
45 class TargetLoweringObjectFile;
46 class TargetPassConfig;
47 class TargetSubtargetInfo;
51 class PassManagerBase;
53 using legacy::PassManagerBase;
56 struct MachineFunctionInfo;
94 std::unique_ptr<const MCRegisterInfo>
MRI;
95 std::unique_ptr<const MCInstrInfo>
MII;
96 std::unique_ptr<const MCSubtargetInfo>
STI;
149 return *
static_cast<const STC*
>(getSubtargetImpl(F));
161 return DL == Candidate;
186 void resetTargetOptions(
const Function &
F)
const;
211 bool isPositionIndependent()
const;
216 bool useEmulatedTLS()
const;
307 Mangler &Mang,
bool MayAlwaysUsePrivate =
false)
const;
341 bool DisableVerify =
true,
350 bool DisableVerify =
true)
override;
396 #endif // LLVM_TARGET_TARGETMACHINE_H virtual bool parseMachineFunctionInfo(const yaml::MachineFunctionInfo &, PerFunctionMIParsingState &PFS, SMDiagnostic &Error, SMRange &SourceRange) const
Parse out the target's MachineFunctionInfo from the YAML reprsentation.
Represents a range in source code.
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...
virtual bool addPassesToEmitFile(PassManagerBase &, raw_pwrite_stream &, raw_pwrite_stream *, CodeGenFileType, bool=true, MachineModuleInfoWrapperPass *MMIWP=nullptr)
Add passes to the specified pass manager to get the specified file emitted.
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.
virtual yaml::MachineFunctionInfo * createDefaultFuncInfoYAML() const
Allocate and return a default initialized instance of the YAML representation for the MachineFunction...
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. ...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
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)
unsigned getAllocaAddrSpace() const
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
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...
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit...
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.
FileType
Defines the file type this file represents.
virtual TargetLoweringObjectFile * getObjFileLowering() const
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.
virtual yaml::MachineFunctionInfo * convertFuncInfoToYAML(const MachineFunction &MF) const
Allocate and initialize an instance of the YAML representation of the MachineFunctionInfo.
unsigned RequireStructuredCFG
TargetSubtargetInfo - Generic base class for all target subtargets.
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
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
const MCRegisterDesc & get(MCRegister RegNo) const
Provide a get method, equivalent to [], but more useful with a pointer to this object.
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...
Lightweight error class with error context and mandatory checking.
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
const STC & getSubtarget(const Function &F) const
This method returns a pointer to the specified type of TargetSubtargetInfo.
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...