14 #ifndef LLVM_LIB_TARGET_X86_X86SUBTARGET_H 15 #define LLVM_LIB_TARGET_X86_X86SUBTARGET_H 33 #define GET_SUBTARGETINFO_HEADER 34 #include "X86GenSubtargetInfo.inc" 74 NoSSE, SSE1, SSE2, SSE3,
SSSE3, SSE41, SSE42, AVX, AVX2, AVX512F
100 bool HasNOPL =
false;
104 bool HasCMov =
false;
107 bool HasX86_64 =
false;
110 bool HasPOPCNT =
false;
113 bool HasSSE4A =
false;
117 bool HasVAES =
false;
120 bool HasFXSR =
false;
123 bool HasXSAVE =
false;
126 bool HasXSAVEOPT =
false;
129 bool HasXSAVEC =
false;
132 bool HasXSAVES =
false;
135 bool HasPCLMUL =
false;
136 bool HasVPCLMULQDQ =
false;
139 bool HasGFNI =
false;
145 bool HasFMA4 =
false;
157 bool HasMOVBE =
false;
160 bool HasRDRAND =
false;
163 bool HasF16C =
false;
166 bool HasFSGSBase =
false;
169 bool HasLZCNT =
false;
175 bool HasBMI2 =
false;
178 bool HasVBMI =
false;
181 bool HasVBMI2 =
false;
184 bool HasIFMA =
false;
196 bool HasPRFCHW =
false;
199 bool HasRDSEED =
false;
202 bool HasLAHFSAHF =
false;
205 bool HasMWAITX =
false;
208 bool HasCLZERO =
false;
211 bool HasCLDEMOTE =
false;
214 bool HasMOVDIRI =
false;
217 bool HasMOVDIR64B =
false;
220 bool HasPTWRITE =
false;
223 bool HasPREFETCHWT1 =
false;
226 bool IsSHLDSlow =
false;
230 bool IsPMULLDSlow =
false;
233 bool IsUAMem16Slow =
false;
236 bool IsUAMem32Slow =
false;
240 bool HasSSEUnalignedMem =
false;
244 bool HasCmpxchg16b =
false;
248 bool UseLeaForSP =
false;
251 bool HasPOPCNTFalseDeps =
false;
254 bool HasLZCNTFalseDeps =
false;
258 bool HasFastVariableShuffle =
false;
262 bool HasFastPartialYMMorZMMWrite =
false;
266 bool HasFast11ByteNOP =
false;
270 bool HasFast15ByteNOP =
false;
274 bool HasFastGather =
false;
278 bool HasFastScalarFSQRT =
false;
282 bool HasFastVectorFSQRT =
false;
286 bool HasSlowDivide32 =
false;
290 bool HasSlowDivide64 =
false;
293 bool HasFastLZCNT =
false;
296 bool HasFastSHLDRotate =
false;
299 bool HasMacroFusion =
false;
302 bool HasERMSB =
false;
306 bool PadShortFunctions =
false;
310 bool SlowTwoMemOps =
false;
314 bool LEAUsesAG =
false;
317 bool SlowLEA =
false;
322 bool Slow3OpsLEA =
false;
325 bool SlowIncDec =
false;
337 bool HasVPOPCNTDQ =
false;
352 bool HasVNNI =
false;
355 bool HasBITALG =
false;
362 bool HasSHSTK =
false;
365 bool HasINVPCID =
false;
371 bool HasCLFLUSHOPT =
false;
374 bool HasCLWB =
false;
377 bool HasWBNOINVD =
false;
380 bool HasRDPID =
false;
383 bool HasWAITPKG =
false;
386 bool HasPCONFIG =
false;
390 bool UseRetpoline =
false;
394 bool UseRetpolineExternalThunk =
false;
397 bool UseSoftFloat =
false;
401 unsigned stackAlignment = 4;
406 unsigned MaxInlineSizeThreshold = 128;
409 bool Prefer256Bit =
false;
422 unsigned StackAlignOverride;
425 unsigned PreferVectorWidthOverride;
429 unsigned PreferVectorWidth = UINT32_MAX;
432 unsigned RequiredVectorWidth;
444 int GatherOverhead = 1024;
445 int ScatterOverhead = 1024;
460 unsigned PreferVectorWidthOverride,
461 unsigned RequiredVectorWidth);
470 return &FrameLowering;
478 return &getInstrInfo()->getRegisterInfo();
538 bool hasSSE1()
const {
return X86SSELevel >= SSE1; }
539 bool hasSSE2()
const {
return X86SSELevel >= SSE2; }
540 bool hasSSE3()
const {
return X86SSELevel >= SSE3; }
541 bool hasSSSE3()
const {
return X86SSELevel >= SSSE3; }
542 bool hasSSE41()
const {
return X86SSELevel >= SSE41; }
543 bool hasSSE42()
const {
return X86SSELevel >= SSE42; }
544 bool hasAVX()
const {
return X86SSELevel >= AVX; }
545 bool hasAVX2()
const {
return X86SSELevel >= AVX2; }
546 bool hasAVX512()
const {
return X86SSELevel >= AVX512F; }
549 bool hasMMX()
const {
return X863DNowLevel >= MMX; }
551 bool has3DNowA()
const {
return X863DNowLevel >= ThreeDNowA; }
567 bool hasAnyFMA()
const {
return hasFMA() || hasFMA4(); }
584 bool hasPRFCHW()
const {
return HasPRFCHW || HasPREFETCHWT1; }
590 return hasSSE1() || (hasPRFCHW() && !has3DNow()) || hasPREFETCHWT1();
612 return HasFastVariableShuffle;
615 return HasFastPartialYMMorZMMWrite;
663 return hasAVX512() && (!hasVLX() || getPreferVectorWidth() >= 512);
666 return hasBWI() && canExtendTo512DQ();
672 return hasAVX512() && (canExtendTo512DQ() || RequiredVectorWidth > 256);
676 return hasBWI() && useAVX512Regs();
684 bool isAtom()
const {
return X86ProcFamily == IntelAtom; }
685 bool isSLM()
const {
return X86ProcFamily == IntelSLM; }
687 return X86ProcFamily == IntelGLM ||
688 X86ProcFamily == IntelGLP ||
689 X86ProcFamily == IntelTRM;
772 return isTargetWin64();
787 unsigned char classifyLocalReference(
const GlobalValue *GV)
const;
789 unsigned char classifyGlobalReference(
const GlobalValue *GV,
791 unsigned char classifyGlobalReference(
const GlobalValue *GV)
const;
794 unsigned char classifyGlobalFunctionReference(
const GlobalValue *GV,
796 unsigned char classifyGlobalFunctionReference(
const GlobalValue *GV)
const;
800 unsigned char classifyBlockAddressReference()
const;
803 bool isLegalToCallImmediateAddr()
const;
815 bool enableEarlyIfConversion()
const override;
818 return TargetSubtargetInfo::ANTIDEP_CRITICAL;
826 #endif // LLVM_LIB_TARGET_X86_X86SUBTARGET_H
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
bool is64Bit() const
Is this x86_64? (disregarding specific ABI / programming model)
bool supportPrintSchedInfo() const override
C - The default llvm calling convention, compatible with C.
Compute iterated dominance frontiers using a linear time algorithm.
bool hasSSEPrefetch() const
A Module instance is used to store all the information related to an LLVM module. ...
bool hasSlowDivide64() const
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
const X86InstrInfo * getInstrInfo() const override
const X86FrameLowering * getFrameLowering() const override
void setPICStyle(PICStyles::Style Style)
bool enableMachineScheduler() const override
Enable the MachineScheduler pass for all X86 subtargets.
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
bool useAVX512Regs() const
bool isTargetNaCl64() const
bool isWindowsCygwinEnvironment() const
bool isTargetKnownWindowsMSVC() const
bool slowTwoMemOps() const
bool isTargetWindowsMSVC() const
bool isTargetMachO() const
int getGatherOverhead() const
bool isUnalignedMem32Slow() const
bool isPICStyleStubPIC() const
bool hasVPOPCNTDQ() const
bool hasPREFETCHWT1() const
Holds all the information related to register banks.
bool isPICStyleRIPRel() const
bool padShortFunctions() const
bool isTargetSolaris() const
bool isTarget64BitLP64() const
Is this x86_64 with the LP64 programming model (standard AMD64, no x32)?
Intel_OCL_BI - Calling conventions for Intel OpenCL built-ins.
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
bool canExtendTo512DQ() const
bool hasCmpxchg16b() const
bool hasFastLZCNT() const
The C convention as specified in the x86-64 supplement to the System V ABI, used on most non-Windows ...
bool useRetpolineExternalThunk() const
std::unique_ptr< CallLowering > CallLoweringInfo
GlobalISel related APIs.
bool hasFastSHLDRotate() const
bool isTargetNaCl() const
bool isTargetCygMing() const
bool isWindowsItaniumEnvironment() const
bool isWindowsGNUEnvironment() const
bool hasFastVariableShuffle() const
bool isWindowsCoreCLREnvironment() const
bool isOSDragonFly() const
bool isOSWindows() const
Tests whether the OS is Windows.
const X86TargetLowering * getTargetLowering() const override
bool isTargetKFreeBSD() const
X86_ThisCall - Similar to X86_StdCall.
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
unsigned getStackAlignment() const
Returns the minimum alignment known to hold of the stack frame on entry to the function and which mus...
X86_FastCall - 'fast' analog of X86_StdCall.
bool isTargetNaCl32() const
static bool is64Bit(const char *name)
bool isXRaySupported() const override
bool hasSSEUnalignedMem() const
X86_StdCall - stdcall is the calling conventions mostly used by the Win32 API.
bool isTargetWindowsGNU() const
bool isPS4CPU() const
Tests whether the target is the PS4 CPU.
bool isTargetFreeBSD() const
PICStyles::Style PICStyle
Which PIC style to use.
bool isOSKFreeBSD() const
Tests whether the OS is kFreeBSD.
bool isPositionIndependent() const
bool isTargetGlibc() const
X86ProcFamilyEnum getProcFamily() const
const Triple & getTargetTriple() const
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
bool isTargetDarwin() const
ThreeDNow - This indicates that the instruction uses the wacky 0x0F 0x0F prefix for 3DNow! instructio...
bool isPMULLDSlow() const
bool isTargetWin64() const
Fast - This calling convention attempts to make calls as fast as possible (e.g.
Triple - Helper class for working with autoconf configuration names.
bool hasVPCLMULQDQ() const
const X86RegisterInfo * getRegisterInfo() const override
std::unique_ptr< InstructionSelector > InstSelector
bool isUnalignedMem16Slow() const
bool isAtom() const
TODO: to be removed later and replaced with suitable properties.
unsigned getMaxInlineSizeThreshold() const
Returns the maximum memset / memcpy size that still makes it profitable to inline the call...
bool isPICStyleGOT() const
bool hasMOVDIR64B() const
bool hasFastPartialYMMorZMMWrite() const
MSVC calling convention that passes vectors and vector aggregates in SSE registers.
unsigned getPreferVectorWidth() const
bool isOSLinux() const
Tests whether the OS is Linux.
EnvironmentType getEnvironment() const
getEnvironment - Get the parsed environment type of this triple.
bool isTargetWin32() const
bool isTargetAndroid() const
bool canExtendTo512BW() const
bool isTarget64BitILP32() const
Is this x86_64 with the ILP32 programming model (x32 ABI)?
bool hasFastScalarFSQRT() const
bool hasCLFLUSHOPT() const
bool hasPOPCNTFalseDeps() const
int getScatterOverhead() const
bool isOSCygMing() const
Tests for either Cygwin or MinGW OS.
bool enableAdvancedRASplitCost() const override
bool useSoftFloat() const
std::unique_ptr< RegisterBankInfo > RegBankInfo
std::unique_ptr< LegalizerInfo > Legalizer
bool enableIndirectBrExpand() const override
If we are using retpolines, we need to expand indirectbr to avoid it lowering to an actual indirect j...
Provides the logic to select generic machine instructions.
bool isOSGlibc() const
Tests whether the OS uses glibc.
unsigned getRequiredVectorWidth() const
const X86SelectionDAGInfo * getSelectionDAGInfo() const override
bool isTargetDragonFly() const
bool isPositionIndependent() const
bool isTargetCOFF() const
bool isTargetFuchsia() const
bool isTargetWindowsItanium() const
bool hasSlowDivide32() const
bool isTargetLinux() const
This file describes how to lower LLVM calls to machine code calls.
bool isCallingConvWin64(CallingConv::ID CC) const
PICStyles::Style getPICStyle() const
bool isAndroid() const
Tests whether the target is Android.
bool hasMacroFusion() const
bool isTargetWindowsCygwin() const
bool useRetpoline() const
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
AntiDepBreakMode getAntiDepBreakMode() const override
bool hasFastGather() const
bool isWindowsMSVCEnvironment() const
Checks if the environment could be MSVC.
Triple TargetTriple
What processor and OS we're targeting.
The C convention as implemented on Windows/x86-64 and AArch64.
bool hasMFence() const
Use mfence if we have SSE2 or we're on x86-64 (even if we asked for no-sse2).
bool hasLZCNTFalseDeps() const
bool hasFastVectorFSQRT() const
bool isTargetWindowsCoreCLR() const