35 cl::desc(
"Enable interprocedural register allocation "
36 "to reduce load/store at procedure calls."));
45 : TheTarget(T), DL(DataLayoutString), TargetTriple(TT), TargetCPU(CPU),
46 TargetFS(FS), AsmInfo(nullptr),
MRI(nullptr), MII(nullptr), STI(nullptr),
47 RequireStructuredCFG(
false), DefaultOptions(Options), Options(Options) {
69 #define RESET_OPTION(X, Y) \
71 if (F.hasFnAttribute(Y)) \
72 Options.X = (F.getFnAttribute(Y).getValueAsString() == "true"); \
74 Options.X = DefaultOptions.X; \
77 RESET_OPTION(LessPreciseFPMADOption,
"less-precise-fpmad");
85 if (Denormal ==
"ieee")
87 else if (Denormal ==
"preserve-sign")
89 else if (Denormal ==
"positive-zero")
157 bool IsAccessViaCopyRelocs =
160 if (!IsTLS && (RM ==
Reloc::Static || IsAccessViaCopyRelocs))
171 bool IsSharedLibrary = RM ==
Reloc::PIC_ && !IsPIE;
175 if (IsSharedLibrary) {
189 if (SelectedModel > Model)
190 return SelectedModel;
208 bool MayAlwaysUsePrivate)
const {
TargetMachine(const Target &T, StringRef DataLayoutString, const Triple &TargetTriple, StringRef CPU, StringRef FS, const TargetOptions &Options)
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
void getNameWithPrefix(SmallVectorImpl< char > &Name, const GlobalValue *GV, Mangler &Mang, bool MayAlwaysUsePrivate=false) const
MCTargetOptions MCOptions
Machine level options.
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module. ...
MCSymbol * getSymbol(const GlobalValue *GV) const
static TLSModel::Model getSelectedTLSModel(const GlobalValue *GV)
Get the IR-specified TLS model for Var.
Mangler & getMangler() const
Analysis pass providing the TargetTransformInfo.
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
PIELevel::Level getPIELevel() const
Returns the PIE level (small or large model)
CodeGenOpt::Level OptLevel
bool isOSWindows() const
Tests whether the OS is Windows.
const Triple & getTargetTriple() const
bool MCPIECopyRelocations
bool hasDefaultVisibility() const
unsigned EnableIPRA
This flag enables InterProcedural Register Allocation (IPRA).
virtual TargetLoweringObjectFile * getObjFileLowering() const
#define RESET_OPTION(X, Y)
bool isStrongDefinitionForLinker() const
Returns true if this global's definition will be the one chosen by the linker.
bool hasPrivateLinkage() const
const MCAsmInfo * AsmInfo
Contains target specific asm information.
virtual void getNameWithPrefix(SmallVectorImpl< char > &OutName, const GlobalValue *GV, const TargetMachine &TM) const
const MCSubtargetInfo * STI
Function Alias Analysis false
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
MCContext & getContext() const
initializer< Ty > init(const Ty &Val)
unsigned const MachineRegisterInfo * MRI
CodeModel::Model getCodeModel() const
Returns the code model.
virtual TargetIRAnalysis getTargetIRAnalysis()
Get a TargetIRAnalysis appropriate for the target.
bool isPositionIndependent() const
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
bool isThreadLocal() const
If the value is "Thread Local", its value isn't shared by the threads.
FPDenormal::DenormalMode FPDenormalMode
FPDenormalMode - This flags specificies which denormal numbers the code is permitted to require...
bool shouldAssumeDSOLocal(const Module &M, const GlobalValue *GV) const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
const TargetOptions DefaultOptions
bool hasDLLImportStorageClass() const
cl::opt< bool > EnableIPRA("enable-ipra", cl::init(false), cl::Hidden, cl::desc("Enable interprocedural register allocation ""to reduce load/store at procedure calls."))
Target - Wrapper for Target specific information.
const MCRegisterInfo * MRI
ThreadLocalMode getThreadLocalMode() const
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
void setOptLevel(CodeGenOpt::Level Level)
Overrides the optimization level.
bool hasLocalLinkage() const
TLSModel::Model getTLSModel(const GlobalValue *GV) const
Returns the TLS model which should be used for the given global variable.
StringRef getValueAsString() const
Return the attribute's value as a string.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Module * getParent()
Get the module that this global value is contained inside of...
StringRef - Represent a constant reference to a string, i.e.
bool isDeclarationForLinker() const
This file describes how to lower LLVM code to machine code.