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" 68 NoSSE, SSE1, SSE2, SSE3,
SSSE3, SSE41, SSE42, AVX, AVX2, AVX512F
101 bool HasX86_64 =
false;
104 bool HasPOPCNT =
false;
107 bool HasSSE4A =
false;
111 bool HasVAES =
false;
114 bool HasFXSR =
false;
117 bool HasXSAVE =
false;
120 bool HasXSAVEOPT =
false;
123 bool HasXSAVEC =
false;
126 bool HasXSAVES =
false;
129 bool HasPCLMUL =
false;
130 bool HasVPCLMULQDQ =
false;
133 bool HasGFNI =
false;
139 bool HasFMA4 =
false;
151 bool HasMOVBE =
false;
154 bool HasRDRAND =
false;
157 bool HasF16C =
false;
160 bool HasFSGSBase =
false;
163 bool HasLZCNT =
false;
169 bool HasBMI2 =
false;
172 bool HasVBMI =
false;
175 bool HasVBMI2 =
false;
178 bool HasIFMA =
false;
190 bool HasPRFCHW =
false;
193 bool HasRDSEED =
false;
196 bool HasLAHFSAHF =
false;
199 bool HasMWAITX =
false;
202 bool HasCLZERO =
false;
205 bool HasCLDEMOTE =
false;
208 bool HasMOVDIRI =
false;
211 bool HasMOVDIR64B =
false;
214 bool HasPTWRITE =
false;
217 bool HasPREFETCHWT1 =
false;
220 bool IsSHLDSlow =
false;
224 bool IsPMULLDSlow =
false;
227 bool IsPMADDWDSlow =
false;
230 bool IsUAMem16Slow =
false;
233 bool IsUAMem32Slow =
false;
237 bool HasSSEUnalignedMem =
false;
241 bool HasCmpxchg16b =
false;
245 bool UseLeaForSP =
false;
248 bool HasPOPCNTFalseDeps =
false;
251 bool HasLZCNTFalseDeps =
false;
255 bool HasFastVariableShuffle =
false;
259 bool HasFastPartialYMMorZMMWrite =
false;
263 bool HasFast11ByteNOP =
false;
267 bool HasFast15ByteNOP =
false;
271 bool HasFastGather =
false;
275 bool HasFastScalarFSQRT =
false;
279 bool HasFastVectorFSQRT =
false;
283 bool HasSlowDivide32 =
false;
287 bool HasSlowDivide64 =
false;
290 bool HasFastLZCNT =
false;
293 bool HasFastSHLDRotate =
false;
296 bool HasMacroFusion =
false;
299 bool HasERMSB =
false;
303 bool PadShortFunctions =
false;
307 bool SlowTwoMemOps =
false;
311 bool LEAUsesAG =
false;
314 bool SlowLEA =
false;
319 bool Slow3OpsLEA =
false;
322 bool SlowIncDec =
false;
334 bool HasVPOPCNTDQ =
false;
349 bool HasVNNI =
false;
352 bool HasBITALG =
false;
359 bool HasSHSTK =
false;
362 bool HasINVPCID =
false;
368 bool HasCLFLUSHOPT =
false;
371 bool HasCLWB =
false;
374 bool HasWBNOINVD =
false;
377 bool HasRDPID =
false;
380 bool HasWAITPKG =
false;
383 bool HasPCONFIG =
false;
386 bool HasFastBEXTR =
false;
389 bool HasFastHorizontalOps =
false;
393 bool UseRetpolineIndirectCalls =
false;
397 bool UseRetpolineIndirectBranches =
false;
401 bool DeprecatedUseRetpoline =
false;
405 bool UseRetpolineExternalThunk =
false;
408 bool UseSoftFloat =
false;
412 unsigned stackAlignment = 4;
417 unsigned MaxInlineSizeThreshold = 128;
420 bool Prefer256Bit =
false;
423 bool ThreewayBranchProfitable =
false;
436 unsigned StackAlignOverride;
439 unsigned PreferVectorWidthOverride;
443 unsigned PreferVectorWidth = UINT32_MAX;
446 unsigned RequiredVectorWidth;
458 int GatherOverhead = 1024;
459 int ScatterOverhead = 1024;
474 unsigned PreferVectorWidthOverride,
475 unsigned RequiredVectorWidth);
484 return &FrameLowering;
492 return &getInstrInfo()->getRegisterInfo();
554 bool hasSSE1()
const {
return X86SSELevel >= SSE1; }
555 bool hasSSE2()
const {
return X86SSELevel >= SSE2; }
556 bool hasSSE3()
const {
return X86SSELevel >= SSE3; }
557 bool hasSSSE3()
const {
return X86SSELevel >= SSSE3; }
558 bool hasSSE41()
const {
return X86SSELevel >= SSE41; }
559 bool hasSSE42()
const {
return X86SSELevel >= SSE42; }
560 bool hasAVX()
const {
return X86SSELevel >= AVX; }
561 bool hasAVX2()
const {
return X86SSELevel >= AVX2; }
562 bool hasAVX512()
const {
return X86SSELevel >= AVX512F; }
565 bool hasMMX()
const {
return X863DNowLevel >= MMX; }
567 bool has3DNowA()
const {
return X863DNowLevel >= ThreeDNowA; }
583 bool hasAnyFMA()
const {
return hasFMA() || hasFMA4(); }
600 bool hasPRFCHW()
const {
return HasPRFCHW || HasPREFETCHWT1; }
606 return hasSSE1() || (hasPRFCHW() && !has3DNow()) || hasPREFETCHWT1();
629 return HasFastVariableShuffle;
632 return HasFastPartialYMMorZMMWrite;
674 return UseRetpolineIndirectBranches;
686 return hasAVX512() && (!hasVLX() || getPreferVectorWidth() >= 512);
689 return hasBWI() && canExtendTo512DQ();
695 return hasAVX512() && (canExtendTo512DQ() || RequiredVectorWidth > 256);
699 return hasBWI() && useAVX512Regs();
707 bool isAtom()
const {
return X86ProcFamily == IntelAtom; }
708 bool isSLM()
const {
return X86ProcFamily == IntelSLM; }
710 return X86ProcFamily == IntelGLM ||
711 X86ProcFamily == IntelGLP ||
712 X86ProcFamily == IntelTRM;
795 return isTargetWin64();
810 unsigned char classifyLocalReference(
const GlobalValue *GV)
const;
812 unsigned char classifyGlobalReference(
const GlobalValue *GV,
814 unsigned char classifyGlobalReference(
const GlobalValue *GV)
const;
817 unsigned char classifyGlobalFunctionReference(
const GlobalValue *GV,
819 unsigned char classifyGlobalFunctionReference(
const GlobalValue *GV)
const;
823 unsigned char classifyBlockAddressReference()
const;
826 bool isLegalToCallImmediateAddr()
const;
831 return useRetpolineIndirectBranches();
840 bool enableEarlyIfConversion()
const override;
843 return TargetSubtargetInfo::ANTIDEP_CRITICAL;
851 #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.
This class represents lattice values for constants.
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 hasFastBEXTR() const
The C convention as implemented on Windows/x86-64 and AArch64.
bool isPMADDWDSlow() const
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)?
ThreeDNow - This indicates that the instruction uses the wacky 0x0F 0x0F prefix for 3DNow! instructio...
bool isKnownWindowsMSVCEnvironment() const
Checks if the environment is MSVC.
bool canExtendTo512DQ() const
bool hasCmpxchg16b() const
bool hasFastLZCNT() const
bool useRetpolineExternalThunk() const
Fast - This calling convention attempts to make calls as fast as possible (e.g.
std::unique_ptr< CallLowering > CallLoweringInfo
GlobalISel related APIs.
bool hasFastSHLDRotate() const
bool isTargetNaCl() const
bool isTargetCygMing() const
bool hasFastHorizontalOps() 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
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...
bool isTargetNaCl32() const
MSVC calling convention that passes vectors and vector aggregates in SSE registers.
static bool is64Bit(const char *name)
bool isXRaySupported() const override
bool hasSSEUnalignedMem() const
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
The C convention as specified in the x86-64 supplement to the System V ABI, used on most non-Windows ...
bool isTargetGlibc() const
X86ProcFamilyEnum getProcFamily() const
const Triple & getTargetTriple() const
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
bool isTargetDarwin() const
bool isPMULLDSlow() const
bool useRetpolineIndirectCalls() const
bool isTargetWin64() const
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 threewayBranchProfitable() const
bool hasFastPartialYMMorZMMWrite() const
X86_ThisCall - Similar to X86_StdCall.
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
X86_FastCall - 'fast' analog of X86_StdCall.
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
bool useRetpolineIndirectBranches() const
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.
Intel_OCL_BI - Calling conventions for Intel OpenCL built-ins.
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
X86_StdCall - stdcall is the calling conventions mostly used by the Win32 API.
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
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.
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