43 #define DEBUG_TYPE "subtarget" 45 #define GET_SUBTARGETINFO_TARGET_DESC 46 #define GET_SUBTARGETINFO_CTOR 47 #include "X86GenSubtargetInfo.inc" 53 cl::desc(
"Enable early if-conversion on X86"));
92 if (isa<Function>(GV))
134 if (CR->getUnsignedMax().ult(128))
181 "shouldAssumeDSOLocal gave inconsistent answer");
185 const Function *
F = dyn_cast_or_null<Function>(GV);
224 std::string CPUName = CPU;
228 std::string FullFS = FS;
233 FullFS =
"+sse2," + FullFS;
238 if (CPUName ==
"generic") {
240 FullFS =
"+64bit," + FullFS;
249 FullFS =
"+sahf," + FullFS;
267 ToggleFeature(X86::Mode64Bit);
268 else if (In32BitMode)
269 ToggleFeature(X86::Mode32Bit);
270 else if (In16BitMode)
271 ToggleFeature(X86::Mode16Bit);
284 if (StackAlignOverride)
302 if (PreferVectorWidthOverride)
303 PreferVectorWidth = PreferVectorWidthOverride;
305 PreferVectorWidth = 256;
310 initSubtargetFeatures(CPU, FS);
316 unsigned StackAlignOverride,
317 unsigned PreferVectorWidthOverride,
318 unsigned RequiredVectorWidth)
321 StackAlignOverride(StackAlignOverride),
322 PreferVectorWidthOverride(PreferVectorWidthOverride),
323 RequiredVectorWidth(RequiredVectorWidth),
329 InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),
bool isDeclarationForLinker() const
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
bool is64Bit() const
Is this x86_64? (disregarding specific ABI / programming model)
MO_COFFSTUB - On a symbol operand "FOO", this indicates that the reference is actually to the "...
const CallLowering * getCallLowering() const override
Methods used by Global ISel.
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.
A Module instance is used to store all the information related to an LLVM module. ...
void setPICStyle(PICStyles::Style Style)
Register calling convention used for parameters transfer optimization.
const LegalizerInfo * getLegalizerInfo() const override
static cl::opt< bool > X86EarlyIfConv("x86-early-ifcvt", cl::Hidden, cl::desc("Enable early if-conversion on X86"))
Optional< ConstantRange > getAbsoluteSymbolRange() const
If this is an absolute symbol reference, returns the range of the symbol, otherwise returns None...
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
bool hasDLLImportStorageClass() const
MO_GOTPCREL - On a symbol operand this indicates that the immediate is offset to the GOT entry for th...
unsigned char classifyLocalReference(const GlobalValue *GV) const
Classify a global variable reference for the current subtarget according to how we should reference i...
Holds all the information related to register banks.
MO_DARWIN_NONLAZY_PIC_BASE - On a symbol operand "FOO", this indicates that the reference is actually...
bool isTargetSolaris() const
This class provides the information for the target register banks.
const InstructionSelector * getInstructionSelector() const override
This file contains the simple types necessary to represent the attributes associated with functions a...
bool hasCommonLinkage() const
bool Prefer256Bit
Indicates target prefers 256 bit instructions.
std::unique_ptr< CallLowering > CallLoweringInfo
GlobalISel related APIs.
MO_GOT - On a symbol operand this indicates that the immediate is the offset to the GOT entry for the...
MO_ABS8 - On a symbol operand this indicates that the symbol is known to be an absolute symbol in ran...
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
X863DNowEnum X863DNowLevel
MMX, 3DNow, 3DNow Athlon, or none supported.
X86Subtarget(const Triple &TT, StringRef CPU, StringRef FS, const X86TargetMachine &TM, unsigned StackAlignOverride, unsigned PreferVectorWidthOverride, unsigned RequiredVectorWidth)
This constructor initializes the data members to match that of the specified triple.
MO_DARWIN_NONLAZY - On a symbol operand "FOO", this indicates that the reference is actually to the "...
const X86TargetLowering * getTargetLowering() const override
bool isTargetKFreeBSD() const
bool isLegalToCallImmediateAddr() const
Return true if the subtarget allows calls to immediate address.
bool shouldAssumeDSOLocal(const Module &M, const GlobalValue *GV) const
unsigned getStackAlignment() const
Returns the minimum alignment known to hold of the stack frame on entry to the function and which mus...
PICStyles::Style PICStyle
Which PIC style to use.
bool isPositionIndependent() const
bool enableEarlyIfConversion() const override
bool isTargetDarwin() const
bool IsUAMem16Slow
True if unaligned memory accesses of 16-bytes are slow.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
This file declares the targeting of the RegisterBankInfo class for X86.
const X86RegisterInfo * getRegisterInfo() const override
std::unique_ptr< InstructionSelector > InstSelector
bool HasX86_64
True if the processor supports X86-64 instructions.
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
bool isTargetWin32() const
InstructionSelector * createX86InstructionSelector(const X86TargetMachine &TM, X86Subtarget &, X86RegisterBankInfo &)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
CodeModel::Model getCodeModel() const
Returns the code model.
This file describes how to lower LLVM calls to machine code calls.
std::unique_ptr< RegisterBankInfo > RegBankInfo
bool getRtLibUseGOT() const
Returns true if PLT should be avoided for RTLib calls.
Provides the logic to select generic machine instructions.
MO_GOTOFF - On a symbol operand this indicates that the immediate is the offset to the location of th...
This class provides the information for the target register banks.
X86SSEEnum X86SSELevel
SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, or none supported.
bool isTargetCOFF() const
unsigned char classifyBlockAddressReference() const
Classify a blockaddress reference for the current subtarget according to how we should reference it i...
MO_PLT - On a symbol operand this indicates that the immediate is offset to the PLT entry of symbol n...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Module * getParent()
Get the module that this global value is contained inside of...
bool isTargetLinux() const
This file describes how to lower LLVM calls to machine code calls.
This file declares the targeting of the Machinelegalizer class for X86.
const RegisterBankInfo * getRegBankInfo() const override
unsigned char classifyGlobalFunctionReference(const GlobalValue *GV, const Module &M) const
Classify a global function reference for the current subtarget.
MO_PIC_BASE_OFFSET - On a symbol operand this indicates that the immediate should get the value of th...
StringRef - Represent a constant reference to a string, i.e.
unsigned char classifyGlobalReference(const GlobalValue *GV, const Module &M) const
unsigned stackAlignment
The minimum alignment known to hold of the stack frame on entry to the function and which must be mai...
bool hasFastGather() const
Triple TargetTriple
What processor and OS we're targeting.
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...