38 : TheTarget(T), DL(DataLayoutString), TargetTriple(TT), TargetCPU(CPU),
39 TargetFS(FS), AsmInfo(nullptr),
MRI(nullptr), MII(nullptr), STI(nullptr),
40 RequireStructuredCFG(
false), DefaultOptions(Options), Options(Options) {
55 #define RESET_OPTION(X, Y) \ 57 if (F.hasFnAttribute(Y)) \ 58 Options.X = (F.getFnAttribute(Y).getValueAsString() == "true"); \ 60 Options.X = DefaultOptions.X; \ 66 RESET_OPTION(NoSignedZerosFPMath,
"no-signed-zeros-fp-math");
71 if (Denormal ==
"ieee")
73 else if (Denormal ==
"preserve-sign")
75 else if (Denormal ==
"positive-zero")
145 isa<GlobalVariable>(GV))
184 const Function *
F = dyn_cast_or_null<Function>(GV);
189 bool IsAccessViaCopyRelocs =
195 if (!IsTLS && !IsPPC && (RM ==
Reloc::Static || IsAccessViaCopyRelocs))
214 bool IsSharedLibrary = RM ==
Reloc::PIC_ && !IsPIE;
218 if (IsSharedLibrary) {
232 if (SelectedModel > Model)
233 return SelectedModel;
249 bool MayAlwaysUsePrivate)
const {
bool isDeclarationForLinker() const
TargetMachine(const Target &T, StringRef DataLayoutString, const Triple &TargetTriple, StringRef CPU, StringRef FS, const TargetOptions &Options)
ThreadLocalMode getThreadLocalMode() const
MCTargetOptions MCOptions
Machine level options.
bool hasPrivateLinkage() const
This class represents lattice values for constants.
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. ...
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
static TLSModel::Model getSelectedTLSModel(const GlobalValue *GV)
Get the IR-specified TLS model for Var.
Analysis pass providing the TargetTransformInfo.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
bool hasDLLImportStorageClass() const
bool hasExternalWeakLinkage() const
CodeGenOpt::Level OptLevel
bool MCPIECopyRelocations
amdgpu Simplify well known AMD library false Value Value const Twine & Name
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
bool hasDefaultEmulatedTLS() const
Tests whether the target uses emulated TLS as default.
#define RESET_OPTION(X, Y)
void getNameWithPrefix(SmallVectorImpl< char > &Name, const GlobalValue *GV, Mangler &Mang, bool MayAlwaysUsePrivate=false) const
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
TLSModel::Model getTLSModel(const GlobalValue *GV) const
Returns the TLS model which should be used for the given global variable.
bool isWindowsGNUEnvironment() const
virtual TargetTransformInfo getTargetTransformInfo(const Function &F)
Return a TargetTransformInfo for a given function.
bool useEmulatedTLS() const
Returns true if this target uses emulated TLS.
bool isOSWindows() const
Tests whether the OS is Windows.
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
unsigned const MachineRegisterInfo * MRI
bool shouldAssumeDSOLocal(const Module &M, const GlobalValue *GV) const
PIELevel::Level getPIELevel() const
Returns the PIE level (small or large model)
unsigned ExplicitEmulatedTLS
Whether -emulated-tls or -no-emulated-tls is set.
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
TargetIRAnalysis getTargetIRAnalysis()
Get a TargetIRAnalysis appropriate for the target.
MCSymbol * getSymbol(const GlobalValue *GV) const
MCContext & getContext() const
const Triple & getTargetTriple() const
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
FPDenormal::DenormalMode FPDenormalMode
FPDenormalMode - This flags specificies which denormal numbers the code is permitted to require...
#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
virtual TargetLoweringObjectFile * getObjFileLowering() const
Target - Wrapper for Target specific information.
CodeModel::Model getCodeModel() const
Returns the code model.
unsigned EmulatedTLS
EmulatedTLS - This flag enables emulated TLS model, using emutls function in the runtime library...
bool getRtLibUseGOT() const
Returns true if PLT should be avoided for RTLib calls.
bool isStrongDefinitionForLinker() const
Returns true if this global's definition will be the one chosen by the linker.
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
StringRef getValueAsString() const
Return the attribute's value as a string.
bool isPositionIndependent() const
void setOptLevel(CodeGenOpt::Level Level)
Overrides the optimization level.
virtual void getNameWithPrefix(SmallVectorImpl< char > &OutName, const GlobalValue *GV, const TargetMachine &TM) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Module * getParent()
Get the module that this global value is contained inside of...
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
bool hasDefaultVisibility() const
Mangler & getMangler() const
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
bool isThreadLocal() const
If the value is "Thread Local", its value isn't shared by the threads.
StringRef - Represent a constant reference to a string, i.e.