LLVM  5.0.0
X86Subtarget.cpp
Go to the documentation of this file.
1 //===-- X86Subtarget.cpp - X86 Subtarget Information ----------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the X86 specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "X86.h"
15 
16 #ifdef LLVM_BUILD_GLOBAL_ISEL
17 #include "X86CallLowering.h"
18 #include "X86LegalizerInfo.h"
19 #include "X86RegisterBankInfo.h"
20 #endif
21 #include "X86Subtarget.h"
23 #include "X86TargetMachine.h"
24 #include "llvm/ADT/Triple.h"
25 #ifdef LLVM_BUILD_GLOBAL_ISEL
30 #endif
31 #include "llvm/IR/Attributes.h"
32 #include "llvm/IR/ConstantRange.h"
33 #include "llvm/IR/Function.h"
34 #include "llvm/IR/GlobalValue.h"
35 #include "llvm/Support/Casting.h"
36 #include "llvm/Support/CodeGen.h"
38 #include "llvm/Support/Debug.h"
42 #include <cassert>
43 #include <string>
44 
45 #if defined(_MSC_VER)
46 #include <intrin.h>
47 #endif
48 
49 using namespace llvm;
50 
51 #define DEBUG_TYPE "subtarget"
52 
53 #define GET_SUBTARGETINFO_TARGET_DESC
54 #define GET_SUBTARGETINFO_CTOR
55 #include "X86GenSubtargetInfo.inc"
56 
57 // Temporary option to control early if-conversion for x86 while adding machine
58 // models.
59 static cl::opt<bool>
60 X86EarlyIfConv("x86-early-ifcvt", cl::Hidden,
61  cl::desc("Enable early if-conversion on X86"));
62 
63 
64 /// Classify a blockaddress reference for the current subtarget according to how
65 /// we should reference it in a non-pcrel context.
67  return classifyLocalReference(nullptr);
68 }
69 
70 /// Classify a global variable reference for the current subtarget according to
71 /// how we should reference it in a non-pcrel context.
72 unsigned char
74  return classifyGlobalReference(GV, *GV->getParent());
75 }
76 
77 unsigned char
79  // 64 bits can use %rip addressing for anything local.
80  if (is64Bit())
81  return X86II::MO_NO_FLAG;
82 
83  // If this is for a position dependent executable, the static linker can
84  // figure it out.
85  if (!isPositionIndependent())
86  return X86II::MO_NO_FLAG;
87 
88  // The COFF dynamic linker just patches the executable sections.
89  if (isTargetCOFF())
90  return X86II::MO_NO_FLAG;
91 
92  if (isTargetDarwin()) {
93  // 32 bit macho has no relocation for a-b if a is undefined, even if
94  // b is in the section that is being relocated.
95  // This means we have to use o load even for GVs that are known to be
96  // local to the dso.
97  if (GV && (GV->isDeclarationForLinker() || GV->hasCommonLinkage()))
99 
101  }
102 
103  return X86II::MO_GOTOFF;
104 }
105 
107  const Module &M) const {
108  // Large model never uses stubs.
110  return X86II::MO_NO_FLAG;
111 
112  // Absolute symbols can be referenced directly.
113  if (GV) {
115  // See if we can use the 8-bit immediate form. Note that some instructions
116  // will sign extend the immediate operand, so to be conservative we only
117  // accept the range [0,128).
118  if (CR->getUnsignedMax().ult(128))
119  return X86II::MO_ABS8;
120  else
121  return X86II::MO_NO_FLAG;
122  }
123  }
124 
125  if (TM.shouldAssumeDSOLocal(M, GV))
126  return classifyLocalReference(GV);
127 
128  if (isTargetCOFF())
129  return X86II::MO_DLLIMPORT;
130 
131  if (is64Bit())
132  return X86II::MO_GOTPCREL;
133 
134  if (isTargetDarwin()) {
135  if (!isPositionIndependent())
138  }
139 
140  return X86II::MO_GOT;
141 }
142 
143 unsigned char
145  return classifyGlobalFunctionReference(GV, *GV->getParent());
146 }
147 
148 unsigned char
150  const Module &M) const {
151  if (TM.shouldAssumeDSOLocal(M, GV))
152  return X86II::MO_NO_FLAG;
153 
154  assert(!isTargetCOFF());
155  const Function *F = dyn_cast_or_null<Function>(GV);
156 
157  if (isTargetELF()) {
158  if (is64Bit() && F && (CallingConv::X86_RegCall == F->getCallingConv()))
159  // According to psABI, PLT stub clobbers XMM8-XMM15.
160  // In Regcall calling convention those registers are used for passing
161  // parameters. Thus we need to prevent lazy binding in Regcall.
162  return X86II::MO_GOTPCREL;
163  return X86II::MO_PLT;
164  }
165 
166  if (is64Bit()) {
167  if (F && F->hasFnAttribute(Attribute::NonLazyBind))
168  // If the function is marked as non-lazy, generate an indirect call
169  // which loads from the GOT directly. This avoids runtime overhead
170  // at the cost of eager binding (and one extra byte of encoding).
171  return X86II::MO_GOTPCREL;
172  return X86II::MO_NO_FLAG;
173  }
174 
175  return X86II::MO_NO_FLAG;
176 }
177 
178 /// This function returns the name of a function which has an interface like
179 /// the non-standard bzero function, if such a function exists on the
180 /// current subtarget and it is considered preferable over memset with zero
181 /// passed as the second argument. Otherwise it returns null.
182 const char *X86Subtarget::getBZeroEntry() const {
183  // Darwin 10 has a __bzero entry point for this purpose.
184  if (getTargetTriple().isMacOSX() &&
185  !getTargetTriple().isMacOSXVersionLT(10, 6))
186  return "__bzero";
187 
188  return nullptr;
189 }
190 
192  return getTargetTriple().isMacOSX() &&
194  is64Bit();
195 }
196 
197 /// Return true if the subtarget allows calls to immediate address.
199  // FIXME: I386 PE/COFF supports PC relative calls using IMAGE_REL_I386_REL32
200  // but WinCOFFObjectWriter::RecordRelocation cannot emit them. Once it does,
201  // the following check for Win32 should be removed.
202  if (In64BitMode || isTargetWin32())
203  return false;
205 }
206 
207 void X86Subtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
208  std::string CPUName = CPU;
209  if (CPUName.empty())
210  CPUName = "generic";
211 
212  // Make sure 64-bit features are available in 64-bit mode. (But make sure
213  // SSE2 can be turned off explicitly.)
214  std::string FullFS = FS;
215  if (In64BitMode) {
216  if (!FullFS.empty())
217  FullFS = "+64bit,+sse2," + FullFS;
218  else
219  FullFS = "+64bit,+sse2";
220  }
221 
222  // LAHF/SAHF are always supported in non-64-bit mode.
223  if (!In64BitMode) {
224  if (!FullFS.empty())
225  FullFS = "+sahf," + FullFS;
226  else
227  FullFS = "+sahf";
228  }
229 
230  // Parse features string and set the CPU.
231  ParseSubtargetFeatures(CPUName, FullFS);
232 
233  // All CPUs that implement SSE4.2 or SSE4A support unaligned accesses of
234  // 16-bytes and under that are reasonably fast. These features were
235  // introduced with Intel's Nehalem/Silvermont and AMD's Family10h
236  // micro-architectures respectively.
237  if (hasSSE42() || hasSSE4A())
238  IsUAMem16Slow = false;
239 
240  InstrItins = getInstrItineraryForCPU(CPUName);
241 
242  // It's important to keep the MCSubtargetInfo feature bits in sync with
243  // target data structure which is shared with MC code emitter, etc.
244  if (In64BitMode)
245  ToggleFeature(X86::Mode64Bit);
246  else if (In32BitMode)
247  ToggleFeature(X86::Mode32Bit);
248  else if (In16BitMode)
249  ToggleFeature(X86::Mode16Bit);
250  else
251  llvm_unreachable("Not 16-bit, 32-bit or 64-bit mode!");
252 
253  DEBUG(dbgs() << "Subtarget features: SSELevel " << X86SSELevel
254  << ", 3DNowLevel " << X863DNowLevel
255  << ", 64bit " << HasX86_64 << "\n");
256  assert((!In64BitMode || HasX86_64) &&
257  "64-bit code requested on a subtarget that doesn't support it!");
258 
259  // Stack alignment is 16 bytes on Darwin, Linux, kFreeBSD and Solaris (both
260  // 32 and 64 bit) and for all 64-bit targets.
261  if (StackAlignOverride)
262  stackAlignment = StackAlignOverride;
263  else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() ||
264  isTargetKFreeBSD() || In64BitMode)
265  stackAlignment = 16;
266 }
267 
268 void X86Subtarget::initializeEnvironment() {
269  X86SSELevel = NoSSE;
271  HasX87 = false;
272  HasCMov = false;
273  HasX86_64 = false;
274  HasPOPCNT = false;
275  HasSSE4A = false;
276  HasAES = false;
277  HasFXSR = false;
278  HasXSAVE = false;
279  HasXSAVEOPT = false;
280  HasXSAVEC = false;
281  HasXSAVES = false;
282  HasPCLMUL = false;
283  HasFMA = false;
284  HasFMA4 = false;
285  HasXOP = false;
286  HasTBM = false;
287  HasLWP = false;
288  HasMOVBE = false;
289  HasRDRAND = false;
290  HasF16C = false;
291  HasFSGSBase = false;
292  HasLZCNT = false;
293  HasBMI = false;
294  HasBMI2 = false;
295  HasVBMI = false;
296  HasIFMA = false;
297  HasRTM = false;
298  HasERI = false;
299  HasCDI = false;
300  HasPFI = false;
301  HasDQI = false;
302  HasVPOPCNTDQ = false;
303  HasBWI = false;
304  HasVLX = false;
305  HasADX = false;
306  HasPKU = false;
307  HasSHA = false;
308  HasPRFCHW = false;
309  HasRDSEED = false;
310  HasLAHFSAHF = false;
311  HasMWAITX = false;
312  HasCLZERO = false;
313  HasMPX = false;
314  HasSGX = false;
315  HasCLFLUSHOPT = false;
316  HasCLWB = false;
317  IsBTMemSlow = false;
318  IsPMULLDSlow = false;
319  IsSHLDSlow = false;
320  IsUAMem16Slow = false;
321  IsUAMem32Slow = false;
322  HasSSEUnalignedMem = false;
323  HasCmpxchg16b = false;
324  UseLeaForSP = false;
326  HasFastScalarFSQRT = false;
327  HasFastVectorFSQRT = false;
328  HasFastLZCNT = false;
329  HasFastSHLDRotate = false;
330  HasERMSB = false;
331  HasSlowDivide32 = false;
332  HasSlowDivide64 = false;
333  PadShortFunctions = false;
334  CallRegIndirect = false;
335  LEAUsesAG = false;
336  SlowLEA = false;
337  Slow3OpsLEA = false;
338  SlowIncDec = false;
339  stackAlignment = 4;
340  // FIXME: this is a known good value for Yonah. How about others?
342  UseSoftFloat = false;
343 }
344 
345 X86Subtarget &X86Subtarget::initializeSubtargetDependencies(StringRef CPU,
346  StringRef FS) {
347  initializeEnvironment();
348  initSubtargetFeatures(CPU, FS);
349  return *this;
350 }
351 
352 #ifdef LLVM_BUILD_GLOBAL_ISEL
353 namespace {
354 
355 struct X86GISelActualAccessor : public GISelAccessor {
356  std::unique_ptr<CallLowering> CallLoweringInfo;
357  std::unique_ptr<LegalizerInfo> Legalizer;
358  std::unique_ptr<RegisterBankInfo> RegBankInfo;
359  std::unique_ptr<InstructionSelector> InstSelector;
360 
361  const CallLowering *getCallLowering() const override {
362  return CallLoweringInfo.get();
363  }
364 
365  const InstructionSelector *getInstructionSelector() const override {
366  return InstSelector.get();
367  }
368 
369  const LegalizerInfo *getLegalizerInfo() const override {
370  return Legalizer.get();
371  }
372 
373  const RegisterBankInfo *getRegBankInfo() const override {
374  return RegBankInfo.get();
375  }
376 };
377 
378 } // end anonymous namespace
379 #endif
380 
382  const X86TargetMachine &TM,
383  unsigned StackAlignOverride)
384  : X86GenSubtargetInfo(TT, CPU, FS), X86ProcFamily(Others),
385  PICStyle(PICStyles::None), TM(TM), TargetTriple(TT),
386  StackAlignOverride(StackAlignOverride),
387  In64BitMode(TargetTriple.getArch() == Triple::x86_64),
388  In32BitMode(TargetTriple.getArch() == Triple::x86 &&
389  TargetTriple.getEnvironment() != Triple::CODE16),
390  In16BitMode(TargetTriple.getArch() == Triple::x86 &&
391  TargetTriple.getEnvironment() == Triple::CODE16),
392  InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),
393  FrameLowering(*this, getStackAlignment()) {
394  // Determine the PICStyle based on the target selected.
395  if (!isPositionIndependent())
397  else if (is64Bit())
399  else if (isTargetCOFF())
401  else if (isTargetDarwin())
403  else if (isTargetELF())
405 #ifndef LLVM_BUILD_GLOBAL_ISEL
407 #else
408  X86GISelActualAccessor *GISel = new X86GISelActualAccessor();
409 
410  GISel->CallLoweringInfo.reset(new X86CallLowering(*getTargetLowering()));
411  GISel->Legalizer.reset(new X86LegalizerInfo(*this, TM));
412 
413  auto *RBI = new X86RegisterBankInfo(*getRegisterInfo());
414  GISel->RegBankInfo.reset(RBI);
415  GISel->InstSelector.reset(createX86InstructionSelector(TM, *this, *RBI));
416 #endif
417  setGISelAccessor(*GISel);
418 }
419 
421  assert(GISel && "Access to GlobalISel APIs not set");
422  return GISel->getCallLowering();
423 }
424 
426  assert(GISel && "Access to GlobalISel APIs not set");
427  return GISel->getInstructionSelector();
428 }
429 
431  assert(GISel && "Access to GlobalISel APIs not set");
432  return GISel->getLegalizerInfo();
433 }
434 
436  assert(GISel && "Access to GlobalISel APIs not set");
437  return GISel->getRegBankInfo();
438 }
439 
441  return hasCMov() && X86EarlyIfConv;
442 }
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
bool HasPRFCHW
Processor has PRFCHW instructions.
Definition: X86Subtarget.h:167
const NoneType None
Definition: None.h:24
bool HasFXSR
Target has FXSAVE/FXRESTOR instructions.
Definition: X86Subtarget.h:98
bool HasTBM
Target has TBM instructions.
Definition: X86Subtarget.h:125
bool HasBMI2
Processor has BMI2 instructions.
Definition: X86Subtarget.h:149
The goal of this helper class is to gather the accessor to all the APIs related to GlobalISel...
Definition: GISelAccessor.h:29
bool HasSGX
Processor has Software Guard Extensions.
Definition: X86Subtarget.h:292
const CallLowering * getCallLowering() const override
Methods used by Global ISel.
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:63
bool HasLAHFSAHF
Processor has LAHF/SAHF instructions.
Definition: X86Subtarget.h:173
bool HasCDI
Processor has AVX-512 Conflict Detection Instructions.
Definition: X86Subtarget.h:271
bool HasAES
Target has AES instructions.
Definition: X86Subtarget.h:95
void setPICStyle(PICStyles::Style Style)
Definition: X86Subtarget.h:423
bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isMacOSXVersionLT - Comparison function for checking OS X version compatibility, which handles suppor...
Definition: Triple.h:423
const TargetMachine & TM
Definition: X86Subtarget.h:70
bool HasERI
Processor has AVX-512 Exponential and Reciprocal Instructions.
Definition: X86Subtarget.h:268
unsigned MaxInlineSizeThreshold
Max.
Definition: X86Subtarget.h:309
bool HasERMSB
True if the processor has enhanced REP MOVSB/STOSB.
Definition: X86Subtarget.h:239
bool LEAUsesAG
True if the LEA instruction inputs have to be ready at address generation (AG) time.
Definition: X86Subtarget.h:251
bool HasVPOPCNTDQ
Processor has AVX-512 population count Instructions.
Definition: X86Subtarget.h:274
const LegalizerInfo * getLegalizerInfo() const override
bool HasFastScalarFSQRT
True if hardware SQRTSS instruction is at least as fast (latency) as RSQRTSS followed by a Newton-Rap...
Definition: X86Subtarget.h:218
static cl::opt< bool > X86EarlyIfConv("x86-early-ifcvt", cl::Hidden, cl::desc("Enable early if-conversion on X86"))
bool IsUAMem32Slow
True if unaligned memory accesses of 32-bytes are slow.
Definition: X86Subtarget.h:198
bool HasLWP
Target has LWP instructions.
Definition: X86Subtarget.h:128
MO_GOTPCREL - On a symbol operand this indicates that the immediate is offset to the GOT entry for th...
Definition: X86BaseInfo.h:97
bool IsPMULLDSlow
True if the PMULLD instruction is slow compared to PMULLW/PMULHW and.
Definition: X86Subtarget.h:192
bool HasRDRAND
True if the processor has the RDRAND instruction.
Definition: X86Subtarget.h:134
bool HasFastPartialYMMorZMMWrite
True if there is no performance penalty to writing only the lower parts of a YMM or ZMM register with...
Definition: X86Subtarget.h:214
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
Definition: Function.h:186
bool HasCLWB
Processor supports Cache Line Write Back instruction.
Definition: X86Subtarget.h:298
bool HasFMA
Target has 3-operand fused multiply-add.
Definition: X86Subtarget.h:116
bool isMacOSX() const
isMacOSX - Is this a Mac OS X triple.
Definition: Triple.h:438
bool HasFastVectorFSQRT
True if hardware SQRTPS/VSQRTPS instructions are at least as fast (throughput) as RSQRTPS/VRSQRTPS fo...
Definition: X86Subtarget.h:222
Holds all the information related to register banks.
void setGISelAccessor(GISelAccessor &GISel)
This object will take onwership of GISelAccessor.
Definition: X86Subtarget.h:350
MO_DARWIN_NONLAZY_PIC_BASE - On a symbol operand "FOO", this indicates that the reference is actually...
Definition: X86BaseInfo.h:197
bool isTargetSolaris() const
Definition: X86Subtarget.h:526
bool hasCommonLinkage() const
Definition: GlobalValue.h:420
bool isTargetDarwin() const
Definition: X86Subtarget.h:523
bool HasCLFLUSHOPT
Processor supports Flush Cache Line instruction.
Definition: X86Subtarget.h:295
bool HasPOPCNT
True if the processor supports POPCNT.
Definition: X86Subtarget.h:89
bool HasPKU
Processor has PKU extenstions.
Definition: X86Subtarget.h:286
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...
const Triple & getTargetTriple() const
Definition: X86Subtarget.h:521
bool HasSlowDivide32
True if 8-bit divisions are significantly faster than 32-bit divisions and should be used when possib...
Definition: X86Subtarget.h:226
bool HasPFI
Processor has AVX-512 PreFetch Instructions.
Definition: X86Subtarget.h:265
#define F(x, y, z)
Definition: MD5.cpp:55
MO_GOT - On a symbol operand this indicates that the immediate is the offset to the GOT entry for the...
Definition: X86BaseInfo.h:82
bool HasIFMA
Processor has Integer Fused Multiply Add.
Definition: X86Subtarget.h:155
bool is64Bit() const
Is this x86_64? (disregarding specific ABI / programming model)
Definition: X86Subtarget.h:398
bool HasCmpxchg16b
True if this processor has the CMPXCHG16B instruction; this is true for most x86-64 chips...
Definition: X86Subtarget.h:206
MO_ABS8 - On a symbol operand this indicates that the symbol is known to be an absolute symbol in ran...
Definition: X86BaseInfo.h:220
bool HasX87
True if the processor supports X87 instructions.
Definition: X86Subtarget.h:79
bool UseLeaForSP
True if the LEA instruction should be used for adjusting the stack pointer.
Definition: X86Subtarget.h:210
X863DNowEnum X863DNowLevel
MMX, 3DNow, 3DNow Athlon, or none supported.
Definition: X86Subtarget.h:76
MO_DARWIN_NONLAZY - On a symbol operand "FOO", this indicates that the reference is actually to the "...
Definition: X86BaseInfo.h:192
bool HasSSE4A
True if the processor supports SSE4A instructions.
Definition: X86Subtarget.h:92
bool CallRegIndirect
True if the Calls with memory reference should be converted to a register-based indirect call...
Definition: X86Subtarget.h:247
bool HasLZCNT
Processor has LZCNT instruction.
Definition: X86Subtarget.h:143
bool HasF16C
Processor has 16-bit floating point conversion instructions.
Definition: X86Subtarget.h:137
bool SlowIncDec
True if INC and DEC instructions are slow when writing to flags.
Definition: X86Subtarget.h:262
const X86TargetLowering * getTargetLowering() const override
Definition: X86Subtarget.h:352
X86Subtarget(const Triple &TT, StringRef CPU, StringRef FS, const X86TargetMachine &TM, unsigned StackAlignOverride)
This constructor initializes the data members to match that of the specified triple.
CodeModel::Model getCodeModel() const
Returns the code model.
bool isTargetCOFF() const
Definition: X86Subtarget.h:530
bool HasMWAITX
Processor has MONITORX/MWAITX instructions.
Definition: X86Subtarget.h:176
bool hasSinCos() const
This function returns true if the target has sincos() routine in its compiler runtime or math librari...
bool IsBTMemSlow
True if BT (bit test) of memory instructions are slow.
Definition: X86Subtarget.h:185
bool HasADX
Processor has ADX instructions.
Definition: X86Subtarget.h:161
bool HasBWI
Processor has AVX-512 Byte and Word instructions.
Definition: X86Subtarget.h:280
bool isPositionIndependent() const
Definition: X86Subtarget.h:586
bool isTargetWin32() const
Definition: X86Subtarget.h:575
bool HasFastSHLDRotate
True if SHLD based rotate is fast.
Definition: X86Subtarget.h:236
std::unique_ptr< GISelAccessor > GISel
Gather the accessor points to GlobalISel-related APIs.
Definition: X86Subtarget.h:320
bool HasXOP
Target has XOP instructions.
Definition: X86Subtarget.h:122
bool SlowLEA
True if the LEA instruction with certain arguments is slow.
Definition: X86Subtarget.h:254
bool HasDQI
Processor has AVX-512 Doubleword and Quadword instructions.
Definition: X86Subtarget.h:277
bool enableEarlyIfConversion() const override
unsigned char classifyLocalReference(const GlobalValue *GV) const
Classify a global variable reference for the current subtarget according to how we should reference i...
bool IsSHLDSlow
True if SHLD instructions are slow.
Definition: X86Subtarget.h:188
InstrItineraryData InstrItins
Instruction itineraries for scheduling.
Definition: X86Subtarget.h:315
bool HasFSGSBase
Processor has FS/GS base insturctions.
Definition: X86Subtarget.h:140
bool shouldAssumeDSOLocal(const Module &M, const GlobalValue *GV) const
unsigned char classifyBlockAddressReference() const
Classify a blockaddress reference for the current subtarget according to how we should reference it i...
bool IsUAMem16Slow
True if unaligned memory accesses of 16-bytes are slow.
Definition: X86Subtarget.h:195
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
This file declares the targeting of the RegisterBankInfo class for X86.
const X86RegisterInfo * getRegisterInfo() const override
Definition: X86Subtarget.h:366
bool hasSSE4A() const
Definition: X86Subtarget.h:438
bool HasMPX
Processor supports MPX - Memory Protection Extensions.
Definition: X86Subtarget.h:289
bool HasX86_64
True if the processor supports X86-64 instructions.
Definition: X86Subtarget.h:86
bool HasSSEUnalignedMem
True if SSE operations can have unaligned memory operands.
Definition: X86Subtarget.h:202
unsigned char classifyGlobalFunctionReference(const GlobalValue *GV, const Module &M) const
Classify a global function reference for the current subtarget.
bool HasXSAVES
Target has XSAVES instructions.
Definition: X86Subtarget.h:110
Optional< ConstantRange > getAbsoluteSymbolRange() const
If this is an absolute symbol reference, returns the range of the symbol, otherwise returns None...
Definition: Globals.cpp:271
bool isTargetELF() const
Definition: X86Subtarget.h:529
bool HasSHA
Processor has SHA instructions.
Definition: X86Subtarget.h:164
bool HasBMI
Processor has BMI1 instructions.
Definition: X86Subtarget.h:146
bool isTargetLinux() const
Definition: X86Subtarget.h:533
bool HasVBMI
Processor has VBMI instructions.
Definition: X86Subtarget.h:152
InstructionSelector * createX86InstructionSelector(const X86TargetMachine &TM, X86Subtarget &, X86RegisterBankInfo &)
bool Slow3OpsLEA
True if the LEA instruction has all three source operands: base, index, and offset or if the LEA inst...
Definition: X86Subtarget.h:259
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:132
bool UseSoftFloat
Use software floating point for code generation.
Definition: X86Subtarget.h:301
This file describes how to lower LLVM calls to machine code calls.
bool hasCMov() const
Definition: X86Subtarget.h:426
llvm_unreachable("Unknown RegBank!")
bool HasPCLMUL
Target has carry-less multiplication.
Definition: X86Subtarget.h:113
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...
Definition: X86BaseInfo.h:89
This class provides the information for the target register banks.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Definition: Function.h:254
bool HasXSAVEOPT
Target has XSAVEOPT instructions.
Definition: X86Subtarget.h:104
bool hasSSE42() const
Definition: X86Subtarget.h:432
X86SSEEnum X86SSELevel
SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, or none supported.
Definition: X86Subtarget.h:73
unsigned char classifyGlobalReference(const GlobalValue *GV, const Module &M) const
bool HasXSAVE
Target has XSAVE instructions.
Definition: X86Subtarget.h:101
MO_PLT - On a symbol operand this indicates that the immediate is offset to the PLT entry of symbol n...
Definition: X86BaseInfo.h:104
bool HasCMov
True if this processor has conditional move instructions (generally pentium pro+).
Definition: X86Subtarget.h:83
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Module * getParent()
Get the module that this global value is contained inside of...
Definition: GlobalValue.h:545
bool HasFMA4
Target has 4-operand fused multiply-add.
Definition: X86Subtarget.h:119
This file describes how to lower LLVM calls to machine code calls.
bool HasRTM
Processor has RTM instructions.
Definition: X86Subtarget.h:158
This file declares the targeting of the Machinelegalizer class for X86.
const RegisterBankInfo * getRegBankInfo() const override
#define DEBUG(X)
Definition: Debug.h:118
bool HasXSAVEC
Target has XSAVEC instructions.
Definition: X86Subtarget.h:107
bool HasVLX
Processor has AVX-512 Vector Length eXtenstions.
Definition: X86Subtarget.h:283
bool HasFastLZCNT
True if LZCNT instruction is fast.
Definition: X86Subtarget.h:233
const char * getBZeroEntry() const
This function returns the name of a function which has an interface like the non-standard bzero funct...
MO_PIC_BASE_OFFSET - On a symbol operand this indicates that the immediate should get the value of th...
Definition: X86BaseInfo.h:75
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
bool HasRDSEED
Processor has RDSEED instructions.
Definition: X86Subtarget.h:170
Register calling convention used for parameters transfer optimization.
Definition: CallingConv.h:202
unsigned stackAlignment
The minimum alignment known to hold of the stack frame on entry to the function and which must be mai...
Definition: X86Subtarget.h:305
bool isTargetKFreeBSD() const
Definition: X86Subtarget.h:534
bool isLegalToCallImmediateAddr() const
Return true if the subtarget allows calls to immediate address.
bool isDeclarationForLinker() const
Definition: GlobalValue.h:503
bool HasMOVBE
True if the processor has the MOVBE instruction.
Definition: X86Subtarget.h:131
bool PadShortFunctions
True if the short functions should be padded to prevent a stall when returning too early...
Definition: X86Subtarget.h:243
bool HasCLZERO
Processor has Cache Line Zero instruction.
Definition: X86Subtarget.h:179
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...
Definition: X86BaseInfo.h:187
bool HasSlowDivide64
True if 32-bit divides are significantly faster than 64-bit divisions and should be used when possibl...
Definition: X86Subtarget.h:230