13 #ifndef LLVM_LIB_TARGET_X86_X86SUBTARGET_H 14 #define LLVM_LIB_TARGET_X86_X86SUBTARGET_H 32 #define GET_SUBTARGETINFO_HEADER 33 #include "X86GenSubtargetInfo.inc" 89 bool HasCmpxchg8b =
false;
100 bool HasX86_64 =
false;
103 bool HasPOPCNT =
false;
106 bool HasSSE4A =
false;
110 bool HasVAES =
false;
113 bool HasFXSR =
false;
116 bool HasXSAVE =
false;
119 bool HasXSAVEOPT =
false;
122 bool HasXSAVEC =
false;
125 bool HasXSAVES =
false;
128 bool HasPCLMUL =
false;
129 bool HasVPCLMULQDQ =
false;
132 bool HasGFNI =
false;
138 bool HasFMA4 =
false;
150 bool HasMOVBE =
false;
153 bool HasRDRAND =
false;
156 bool HasF16C =
false;
159 bool HasFSGSBase =
false;
162 bool HasLZCNT =
false;
168 bool HasBMI2 =
false;
171 bool HasVBMI =
false;
174 bool HasVBMI2 =
false;
177 bool HasIFMA =
false;
189 bool HasPRFCHW =
false;
192 bool HasRDSEED =
false;
195 bool HasLAHFSAHF =
false;
198 bool HasMWAITX =
false;
201 bool HasCLZERO =
false;
204 bool HasCLDEMOTE =
false;
207 bool HasMOVDIRI =
false;
210 bool HasMOVDIR64B =
false;
213 bool HasPTWRITE =
false;
216 bool HasPREFETCHWT1 =
false;
219 bool IsSHLDSlow =
false;
223 bool IsPMULLDSlow =
false;
226 bool IsPMADDWDSlow =
false;
229 bool IsUAMem16Slow =
false;
232 bool IsUAMem32Slow =
false;
236 bool HasSSEUnalignedMem =
false;
240 bool HasCmpxchg16b =
false;
244 bool UseLeaForSP =
false;
247 bool HasPOPCNTFalseDeps =
false;
250 bool HasLZCNTFalseDeps =
false;
254 bool HasFastVariableShuffle =
false;
258 bool InsertVZEROUPPER =
false;
262 bool HasFast11ByteNOP =
false;
266 bool HasFast15ByteNOP =
false;
270 bool HasFastGather =
false;
274 bool HasFastScalarFSQRT =
false;
278 bool HasFastVectorFSQRT =
false;
282 bool HasSlowDivide32 =
false;
286 bool HasSlowDivide64 =
false;
289 bool HasFastLZCNT =
false;
292 bool HasFastSHLDRotate =
false;
295 bool HasMacroFusion =
false;
298 bool HasBranchFusion =
false;
301 bool HasERMSB =
false;
305 bool PadShortFunctions =
false;
309 bool SlowTwoMemOps =
false;
313 bool LEAUsesAG =
false;
316 bool SlowLEA =
false;
321 bool Slow3OpsLEA =
false;
324 bool SlowIncDec =
false;
336 bool HasVPOPCNTDQ =
false;
351 bool HasVNNI =
false;
354 bool HasBF16 =
false;
357 bool HasENQCMD =
false;
360 bool HasBITALG =
false;
363 bool HasVP2INTERSECT =
false;
366 bool DeprecatedHasMPX =
false;
370 bool HasSHSTK =
false;
373 bool HasINVPCID =
false;
379 bool HasCLFLUSHOPT =
false;
382 bool HasCLWB =
false;
385 bool HasWBNOINVD =
false;
388 bool HasRDPID =
false;
391 bool HasWAITPKG =
false;
394 bool HasPCONFIG =
false;
397 bool HasFastBEXTR =
false;
400 bool HasFastHorizontalOps =
false;
403 bool HasFastScalarShiftMasks =
false;
406 bool HasFastVectorShiftMasks =
false;
410 bool UseRetpolineIndirectCalls =
false;
414 bool UseRetpolineIndirectBranches =
false;
418 bool DeprecatedUseRetpoline =
false;
422 bool UseRetpolineExternalThunk =
false;
425 bool UseSoftFloat =
false;
437 unsigned MaxInlineSizeThreshold = 128;
440 bool Prefer128Bit =
false;
443 bool Prefer256Bit =
false;
446 bool PreferMaskRegisters =
false;
449 bool ThreewayBranchProfitable =
false;
452 bool UseGLMDivSqrtCosts =
false;
468 unsigned PreferVectorWidthOverride;
472 unsigned PreferVectorWidth = UINT32_MAX;
475 unsigned RequiredVectorWidth;
487 int GatherOverhead = 1024;
488 int ScatterOverhead = 1024;
503 unsigned PreferVectorWidthOverride,
504 unsigned RequiredVectorWidth);
513 return &FrameLowering;
521 return &getInstrInfo()->getRegisterInfo();
584 bool hasSSE1()
const {
return X86SSELevel >= SSE1; }
585 bool hasSSE2()
const {
return X86SSELevel >= SSE2; }
586 bool hasSSE3()
const {
return X86SSELevel >= SSE3; }
587 bool hasSSSE3()
const {
return X86SSELevel >= SSSE3; }
588 bool hasSSE41()
const {
return X86SSELevel >= SSE41; }
589 bool hasSSE42()
const {
return X86SSELevel >= SSE42; }
592 bool hasAVX512()
const {
return X86SSELevel >= AVX512F; }
595 bool hasMMX()
const {
return X863DNowLevel >= MMX; }
597 bool has3DNowA()
const {
return X863DNowLevel >= ThreeDNowA; }
613 bool hasAnyFMA()
const {
return hasFMA() || hasFMA4(); }
630 bool hasPRFCHW()
const {
return HasPRFCHW || HasPREFETCHWT1; }
636 return hasSSE1() || (hasPRFCHW() && !has3DNow()) || hasPREFETCHWT1();
659 return HasFastVariableShuffle;
707 return UseRetpolineIndirectBranches;
721 return hasAVX512() && (!hasVLX() || getPreferVectorWidth() >= 512);
724 return hasBWI() && canExtendTo512DQ();
730 return hasAVX512() && (canExtendTo512DQ() || RequiredVectorWidth > 256);
734 return hasBWI() && useAVX512Regs();
742 bool isAtom()
const {
return X86ProcFamily == IntelAtom; }
743 bool isSLM()
const {
return X86ProcFamily == IntelSLM; }
745 bool useAA()
const override {
return UseAA; }
823 return isTargetWin64();
838 unsigned char classifyLocalReference(
const GlobalValue *GV)
const;
840 unsigned char classifyGlobalReference(
const GlobalValue *GV,
842 unsigned char classifyGlobalReference(
const GlobalValue *GV)
const;
845 unsigned char classifyGlobalFunctionReference(
const GlobalValue *GV,
847 unsigned char classifyGlobalFunctionReference(
const GlobalValue *GV)
const;
851 unsigned char classifyBlockAddressReference()
const;
854 bool isLegalToCallImmediateAddr()
const;
859 return useRetpolineIndirectBranches();
865 bool enableEarlyIfConversion()
const override;
867 void getPostRAMutations(std::vector<std::unique_ptr<ScheduleDAGMutation>>
868 &Mutations)
const override;
871 return TargetSubtargetInfo::ANTIDEP_CRITICAL;
879 #endif // LLVM_LIB_TARGET_X86_X86SUBTARGET_H
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (macOS, iOS, tvOS or watchOS).
MSVC calling convention that passes vectors and vector aggregates in SSE registers.
bool is64Bit() const
Is this x86_64? (disregarding specific ABI / programming model)
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
The C convention as specified in the x86-64 supplement to the System V ABI, used on most non-Windows ...
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 hasFastVectorShiftMasks() const
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
bool isPMADDWDSlow() const
C - The default llvm calling convention, compatible with C.
bool useAVX512Regs() const
bool isTargetNaCl64() const
bool hasVP2INTERSECT() const
bool isWindowsCygwinEnvironment() 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
ThreeDNow - This indicates that the instruction uses the wacky 0x0F 0x0F prefix for 3DNow! instructio...
bool isTarget64BitLP64() const
Is this x86_64 with the LP64 programming model (standard AMD64, no x32)?
bool canExtendTo512DQ() const
bool hasCmpxchg16b() const
bool hasFastLZCNT() const
bool useRetpolineExternalThunk() const
std::unique_ptr< CallLowering > CallLoweringInfo
GlobalISel related APIs.
bool hasFastSHLDRotate() const
bool isTargetNaCl() const
bool isTargetCygMing() const
bool preferMaskRegisters() const
bool hasFastHorizontalOps() const
Align getStackAlignment() const
Returns the minimum alignment known to hold of the stack frame on entry to the function and which mus...
bool isWindowsItaniumEnvironment() const
bool isWindowsGNUEnvironment() const
bool hasFastVariableShuffle() const
bool isWindowsCoreCLREnvironment() const
bool isOSDragonFly() const
The C convention as implemented on Windows/x86-64 and AArch64.
bool isOSWindows() const
Tests whether the OS is Windows.
const X86TargetLowering * getTargetLowering() const override
Intel_OCL_BI - Calling conventions for Intel OpenCL built-ins.
bool isTargetKFreeBSD() const
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
bool insertVZEROUPPER() const
bool isTargetNaCl32() const
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
bool isTargetGlibc() const
X86ProcFamilyEnum getProcFamily() const
const Triple & getTargetTriple() const
bool useGLMDivSqrtCosts() const
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
bool isTargetDarwin() const
bool isPMULLDSlow() const
bool useRetpolineIndirectCalls() const
bool isTargetWin64() const
This struct is a compact representation of a valid (non-zero power of two) alignment.
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
This struct is a compact representation of a valid (power of two) or undefined (0) alignment...
unsigned getPreferVectorWidth() const
X86_StdCall - stdcall is the calling conventions mostly used by the Win32 API.
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
X86_FastCall - 'fast' analog of X86_StdCall.
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.
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
Tail - This calling convention attemps to make calls as fast as possible while guaranteeing that tail...
bool hasBranchFusion() const
bool useAA() const override
Fast - This calling convention attempts to make calls as fast as possible (e.g.
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 hasCmpxchg8b() const
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 hasFastScalarShiftMasks() const
static bool is64Bit(const char *name)
X86_ThisCall - Similar to X86_StdCall.
bool hasLZCNTFalseDeps() const
bool hasFastVectorFSQRT() const
bool isTargetWindowsCoreCLR() const