LLVM  16.0.0git
X86Subtarget.h
Go to the documentation of this file.
1 //===-- X86Subtarget.h - Define Subtarget for the X86 ----------*- C++ -*--===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares the X86 specific subclass of TargetSubtargetInfo.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_X86_X86SUBTARGET_H
14 #define LLVM_LIB_TARGET_X86_X86SUBTARGET_H
15 
16 #include "X86FrameLowering.h"
17 #include "X86ISelLowering.h"
18 #include "X86InstrInfo.h"
19 #include "X86SelectionDAGInfo.h"
20 #include "llvm/ADT/Triple.h"
22 #include "llvm/IR/CallingConv.h"
23 #include <climits>
24 #include <memory>
25 
26 #define GET_SUBTARGETINFO_HEADER
27 #include "X86GenSubtargetInfo.inc"
28 
29 namespace llvm {
30 
31 class CallLowering;
32 class GlobalValue;
33 class InstructionSelector;
34 class LegalizerInfo;
35 class RegisterBankInfo;
36 class StringRef;
37 class TargetMachine;
38 
39 /// The X86 backend supports a number of different styles of PIC.
40 ///
41 namespace PICStyles {
42 
43 enum class Style {
44  StubPIC, // Used on i386-darwin in pic mode.
45  GOT, // Used on 32 bit elf on when in pic mode.
46  RIPRel, // Used on X86-64 when in pic mode.
47  None // Set when not in pic mode.
48 };
49 
50 } // end namespace PICStyles
51 
52 class X86Subtarget final : public X86GenSubtargetInfo {
53  enum X86SSEEnum {
54  NoSSE, SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, AVX, AVX2, AVX512
55  };
56 
57  enum X863DNowEnum {
58  NoThreeDNow, MMX, ThreeDNow, ThreeDNowA
59  };
60 
61  /// Which PIC style to use
62  PICStyles::Style PICStyle;
63 
64  const TargetMachine &TM;
65 
66  /// SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, or none supported.
67  X86SSEEnum X86SSELevel = NoSSE;
68 
69  /// MMX, 3DNow, 3DNow Athlon, or none supported.
70  X863DNowEnum X863DNowLevel = NoThreeDNow;
71 
72 #define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
73  bool ATTRIBUTE = DEFAULT;
74 #include "X86GenSubtargetInfo.inc"
75  /// The minimum alignment known to hold of the stack frame on
76  /// entry to the function and which must be maintained by every function.
77  Align stackAlignment = Align(4);
78 
79  Align TileConfigAlignment = Align(4);
80 
81  /// Max. memset / memcpy size that is turned into rep/movs, rep/stos ops.
82  ///
83  // FIXME: this is a known good value for Yonah. How about others?
84  unsigned MaxInlineSizeThreshold = 128;
85 
86  /// What processor and OS we're targeting.
87  Triple TargetTriple;
88 
89  /// GlobalISel related APIs.
90  std::unique_ptr<CallLowering> CallLoweringInfo;
91  std::unique_ptr<LegalizerInfo> Legalizer;
92  std::unique_ptr<RegisterBankInfo> RegBankInfo;
93  std::unique_ptr<InstructionSelector> InstSelector;
94 
95  /// Override the stack alignment.
96  MaybeAlign StackAlignOverride;
97 
98  /// Preferred vector width from function attribute.
99  unsigned PreferVectorWidthOverride;
100 
101  /// Resolved preferred vector width from function attribute and subtarget
102  /// features.
103  unsigned PreferVectorWidth = UINT32_MAX;
104 
105  /// Required vector width from function attribute.
106  unsigned RequiredVectorWidth;
107 
108  X86SelectionDAGInfo TSInfo;
109  // Ordering here is important. X86InstrInfo initializes X86RegisterInfo which
110  // X86TargetLowering needs.
111  X86InstrInfo InstrInfo;
112  X86TargetLowering TLInfo;
113  X86FrameLowering FrameLowering;
114 
115 public:
116  /// This constructor initializes the data members to match that
117  /// of the specified triple.
118  ///
119  X86Subtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS,
120  const X86TargetMachine &TM, MaybeAlign StackAlignOverride,
121  unsigned PreferVectorWidthOverride,
122  unsigned RequiredVectorWidth);
123 
124  const X86TargetLowering *getTargetLowering() const override {
125  return &TLInfo;
126  }
127 
128  const X86InstrInfo *getInstrInfo() const override { return &InstrInfo; }
129 
130  const X86FrameLowering *getFrameLowering() const override {
131  return &FrameLowering;
132  }
133 
134  const X86SelectionDAGInfo *getSelectionDAGInfo() const override {
135  return &TSInfo;
136  }
137 
138  const X86RegisterInfo *getRegisterInfo() const override {
139  return &getInstrInfo()->getRegisterInfo();
140  }
141 
142  unsigned getTileConfigSize() const { return 64; }
143  Align getTileConfigAlignment() const { return TileConfigAlignment; }
144 
145  /// Returns the minimum alignment known to hold of the
146  /// stack frame on entry to the function and which must be maintained by every
147  /// function for this subtarget.
148  Align getStackAlignment() const { return stackAlignment; }
149 
150  /// Returns the maximum memset / memcpy size
151  /// that still makes it profitable to inline the call.
152  unsigned getMaxInlineSizeThreshold() const { return MaxInlineSizeThreshold; }
153 
154  /// ParseSubtargetFeatures - Parses features string setting specified
155  /// subtarget options. Definition of function is auto generated by tblgen.
157 
158  /// Methods used by Global ISel
159  const CallLowering *getCallLowering() const override;
161  const LegalizerInfo *getLegalizerInfo() const override;
162  const RegisterBankInfo *getRegBankInfo() const override;
163 
164 private:
165  /// Initialize the full set of dependencies so we can use an initializer
166  /// list for X86Subtarget.
167  X86Subtarget &initializeSubtargetDependencies(StringRef CPU,
168  StringRef TuneCPU,
169  StringRef FS);
170  void initSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);
171 
172 public:
173 
174 #define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
175  bool GETTER() const { return ATTRIBUTE; }
176 #include "X86GenSubtargetInfo.inc"
177 
178  /// Is this x86_64 with the ILP32 programming model (x32 ABI)?
179  bool isTarget64BitILP32() const {
180  return Is64Bit && (TargetTriple.isX32() || TargetTriple.isOSNaCl());
181  }
182 
183  /// Is this x86_64 with the LP64 programming model (standard AMD64, no x32)?
184  bool isTarget64BitLP64() const {
185  return Is64Bit && (!TargetTriple.isX32() && !TargetTriple.isOSNaCl());
186  }
187 
188  PICStyles::Style getPICStyle() const { return PICStyle; }
189  void setPICStyle(PICStyles::Style Style) { PICStyle = Style; }
190 
191  bool canUseCMPXCHG8B() const { return hasCX8(); }
192  bool canUseCMPXCHG16B() const {
193  // CX16 is just the CPUID bit, instruction requires 64-bit mode too.
194  return hasCX16() && is64Bit();
195  }
196  // SSE codegen depends on cmovs, and all SSE1+ processors support them.
197  // All 64-bit processors support cmov.
198  bool canUseCMOV() const { return hasCMOV() || hasSSE1() || is64Bit(); }
199  bool hasSSE1() const { return X86SSELevel >= SSE1; }
200  bool hasSSE2() const { return X86SSELevel >= SSE2; }
201  bool hasSSE3() const { return X86SSELevel >= SSE3; }
202  bool hasSSSE3() const { return X86SSELevel >= SSSE3; }
203  bool hasSSE41() const { return X86SSELevel >= SSE41; }
204  bool hasSSE42() const { return X86SSELevel >= SSE42; }
205  bool hasAVX() const { return X86SSELevel >= AVX; }
206  bool hasAVX2() const { return X86SSELevel >= AVX2; }
207  bool hasAVX512() const { return X86SSELevel >= AVX512; }
208  bool hasInt256() const { return hasAVX2(); }
209  bool hasMMX() const { return X863DNowLevel >= MMX; }
210  bool hasThreeDNow() const { return X863DNowLevel >= ThreeDNow; }
211  bool hasThreeDNowA() const { return X863DNowLevel >= ThreeDNowA; }
212  bool hasAnyFMA() const { return hasFMA() || hasFMA4(); }
213  bool hasPrefetchW() const {
214  // The PREFETCHW instruction was added with 3DNow but later CPUs gave it
215  // its own CPUID bit as part of deprecating 3DNow. Intel eventually added
216  // it and KNL has another that prefetches to L2 cache. We assume the
217  // L1 version exists if the L2 version does.
218  return hasThreeDNow() || hasPRFCHW() || hasPREFETCHWT1();
219  }
220  bool hasSSEPrefetch() const {
221  // We implicitly enable these when we have a write prefix supporting cache
222  // level OR if we have prfchw, but don't already have a read prefetch from
223  // 3dnow.
224  return hasSSE1() || (hasPRFCHW() && !hasThreeDNow()) || hasPREFETCHWT1() ||
225  hasPREFETCHI();
226  }
227  bool canUseLAHFSAHF() const { return hasLAHFSAHF64() || !is64Bit(); }
228  // These are generic getters that OR together all of the thunk types
229  // supported by the subtarget. Therefore useIndirectThunk*() will return true
230  // if any respective thunk feature is enabled.
231  bool useIndirectThunkCalls() const {
232  return useRetpolineIndirectCalls() || useLVIControlFlowIntegrity();
233  }
235  return useRetpolineIndirectBranches() || useLVIControlFlowIntegrity();
236  }
237 
238  unsigned getPreferVectorWidth() const { return PreferVectorWidth; }
239  unsigned getRequiredVectorWidth() const { return RequiredVectorWidth; }
240 
241  // Helper functions to determine when we should allow widening to 512-bit
242  // during codegen.
243  // TODO: Currently we're always allowing widening on CPUs without VLX,
244  // because for many cases we don't have a better option.
245  bool canExtendTo512DQ() const {
246  return hasAVX512() && (!hasVLX() || getPreferVectorWidth() >= 512);
247  }
248  bool canExtendTo512BW() const {
249  return hasBWI() && canExtendTo512DQ();
250  }
251 
252  // If there are no 512-bit vectors and we prefer not to use 512-bit registers,
253  // disable them in the legalizer.
254  bool useAVX512Regs() const {
255  return hasAVX512() && (canExtendTo512DQ() || RequiredVectorWidth > 256);
256  }
257 
258  bool useBWIRegs() const {
259  return hasBWI() && useAVX512Regs();
260  }
261 
262  bool isXRaySupported() const override { return is64Bit(); }
263 
264  /// Use mfence if we have SSE2 or we're on x86-64 (even if we asked for
265  /// no-sse2). There isn't any reason to disable it if the target processor
266  /// supports it.
267  bool hasMFence() const { return hasSSE2() || is64Bit(); }
268 
269  const Triple &getTargetTriple() const { return TargetTriple; }
270 
271  bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
272  bool isTargetFreeBSD() const { return TargetTriple.isOSFreeBSD(); }
273  bool isTargetDragonFly() const { return TargetTriple.isOSDragonFly(); }
274  bool isTargetSolaris() const { return TargetTriple.isOSSolaris(); }
275  bool isTargetPS() const { return TargetTriple.isPS(); }
276 
277  bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
278  bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
279  bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
280 
281  bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
282  bool isTargetKFreeBSD() const { return TargetTriple.isOSKFreeBSD(); }
283  bool isTargetGlibc() const { return TargetTriple.isOSGlibc(); }
284  bool isTargetAndroid() const { return TargetTriple.isAndroid(); }
285  bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
286  bool isTargetNaCl32() const { return isTargetNaCl() && !is64Bit(); }
287  bool isTargetNaCl64() const { return isTargetNaCl() && is64Bit(); }
288  bool isTargetMCU() const { return TargetTriple.isOSIAMCU(); }
289  bool isTargetFuchsia() const { return TargetTriple.isOSFuchsia(); }
290 
291  bool isTargetWindowsMSVC() const {
292  return TargetTriple.isWindowsMSVCEnvironment();
293  }
294 
295  bool isTargetWindowsCoreCLR() const {
296  return TargetTriple.isWindowsCoreCLREnvironment();
297  }
298 
299  bool isTargetWindowsCygwin() const {
300  return TargetTriple.isWindowsCygwinEnvironment();
301  }
302 
303  bool isTargetWindowsGNU() const {
304  return TargetTriple.isWindowsGNUEnvironment();
305  }
306 
307  bool isTargetWindowsItanium() const {
308  return TargetTriple.isWindowsItaniumEnvironment();
309  }
310 
311  bool isTargetCygMing() const { return TargetTriple.isOSCygMing(); }
312 
313  bool isOSWindows() const { return TargetTriple.isOSWindows(); }
314 
315  bool isTargetWin64() const { return Is64Bit && isOSWindows(); }
316 
317  bool isTargetWin32() const { return !Is64Bit && isOSWindows(); }
318 
319  bool isPICStyleGOT() const { return PICStyle == PICStyles::Style::GOT; }
320  bool isPICStyleRIPRel() const { return PICStyle == PICStyles::Style::RIPRel; }
321 
322  bool isPICStyleStubPIC() const {
323  return PICStyle == PICStyles::Style::StubPIC;
324  }
325 
326  bool isPositionIndependent() const;
327 
329  switch (CC) {
330  // On Win64, all these conventions just use the default convention.
331  case CallingConv::C:
332  case CallingConv::Fast:
333  case CallingConv::Tail:
334  case CallingConv::Swift:
341  return isTargetWin64();
342  // This convention allows using the Win64 convention on other targets.
343  case CallingConv::Win64:
344  return true;
345  // This convention allows using the SysV convention on Windows targets.
347  return false;
348  // Otherwise, who knows what this is.
349  default:
350  return false;
351  }
352  }
353 
354  /// Classify a global variable reference for the current subtarget according
355  /// to how we should reference it in a non-pcrel context.
356  unsigned char classifyLocalReference(const GlobalValue *GV) const;
357 
358  unsigned char classifyGlobalReference(const GlobalValue *GV,
359  const Module &M) const;
360  unsigned char classifyGlobalReference(const GlobalValue *GV) const;
361 
362  /// Classify a global function reference for the current subtarget.
363  unsigned char classifyGlobalFunctionReference(const GlobalValue *GV,
364  const Module &M) const;
365  unsigned char
366  classifyGlobalFunctionReference(const GlobalValue *GV) const override;
367 
368  /// Classify a blockaddress reference for the current subtarget according to
369  /// how we should reference it in a non-pcrel context.
370  unsigned char classifyBlockAddressReference() const;
371 
372  /// Return true if the subtarget allows calls to immediate address.
373  bool isLegalToCallImmediateAddr() const;
374 
375  /// Return whether FrameLowering should always set the "extended frame
376  /// present" bit in FP, or set it based on a symbol in the runtime.
378  // Older OS versions (particularly system unwinders) are confused by the
379  // Swift extended frame, so when building code that might be run on them we
380  // must dynamically query the concurrency library to determine whether
381  // extended frames should be flagged as present.
382  const Triple &TT = getTargetTriple();
383 
384  unsigned Major = TT.getOSVersion().getMajor();
385  switch(TT.getOS()) {
386  default:
387  return false;
388  case Triple::IOS:
389  case Triple::TvOS:
390  return Major < 15;
391  case Triple::WatchOS:
392  return Major < 8;
393  case Triple::MacOSX:
394  case Triple::Darwin:
395  return Major < 12;
396  }
397  }
398 
399  /// If we are using indirect thunks, we need to expand indirectbr to avoid it
400  /// lowering to an actual indirect jump.
401  bool enableIndirectBrExpand() const override {
402  return useIndirectThunkBranches();
403  }
404 
405  /// Enable the MachineScheduler pass for all X86 subtargets.
406  bool enableMachineScheduler() const override { return true; }
407 
408  bool enableEarlyIfConversion() const override;
409 
410  void getPostRAMutations(std::vector<std::unique_ptr<ScheduleDAGMutation>>
411  &Mutations) const override;
412 
413  AntiDepBreakMode getAntiDepBreakMode() const override {
414  return TargetSubtargetInfo::ANTIDEP_CRITICAL;
415  }
416 };
417 
418 } // end namespace llvm
419 
420 #endif // LLVM_LIB_TARGET_X86_X86SUBTARGET_H
llvm::X86Subtarget::getRequiredVectorWidth
unsigned getRequiredVectorWidth() const
Definition: X86Subtarget.h:239
llvm::X86Subtarget::hasSSEPrefetch
bool hasSSEPrefetch() const
Definition: X86Subtarget.h:220
llvm::X86Subtarget::getFrameLowering
const X86FrameLowering * getFrameLowering() const override
Definition: X86Subtarget.h:130
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::X86Subtarget::getTileConfigSize
unsigned getTileConfigSize() const
Definition: X86Subtarget.h:142
llvm::X86Subtarget::hasSSE2
bool hasSSE2() const
Definition: X86Subtarget.h:200
llvm::X86Subtarget::hasAVX2
bool hasAVX2() const
Definition: X86Subtarget.h:206
llvm::Triple::isOSBinFormatCOFF
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
Definition: Triple.h:678
llvm::X86Subtarget::isTargetLinux
bool isTargetLinux() const
Definition: X86Subtarget.h:281
llvm::Triple::Darwin
@ Darwin
Definition: Triple.h:189
llvm::X86Subtarget::getInstrInfo
const X86InstrInfo * getInstrInfo() const override
Definition: X86Subtarget.h:128
is64Bit
static bool is64Bit(const char *name)
Definition: X86Disassembler.cpp:1018
X86SelectionDAGInfo.h
llvm::Triple::isPS
bool isPS() const
Tests whether the target is the PS4 or PS5 platform.
Definition: Triple.h:720
llvm::X86Subtarget
Definition: X86Subtarget.h:52
llvm::PICStyles::Style::StubPIC
@ StubPIC
llvm::X86Subtarget::isTarget64BitILP32
bool isTarget64BitILP32() const
Is this x86_64 with the ILP32 programming model (x32 ABI)?
Definition: X86Subtarget.h:179
llvm::Triple::IOS
@ IOS
Definition: Triple.h:193
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::X86Subtarget::isLegalToCallImmediateAddr
bool isLegalToCallImmediateAddr() const
Return true if the subtarget allows calls to immediate address.
Definition: X86Subtarget.cpp:248
llvm::X86Subtarget::isTargetMCU
bool isTargetMCU() const
Definition: X86Subtarget.h:288
llvm::X86Subtarget::isTargetNaCl
bool isTargetNaCl() const
Definition: X86Subtarget.h:285
llvm::X86Subtarget::isXRaySupported
bool isXRaySupported() const override
Definition: X86Subtarget.h:262
llvm::Triple::isWindowsItaniumEnvironment
bool isWindowsItaniumEnvironment() const
Definition: Triple.h:607
llvm::X86Subtarget::getPreferVectorWidth
unsigned getPreferVectorWidth() const
Definition: X86Subtarget.h:238
llvm::X86AS::FS
@ FS
Definition: X86.h:200
llvm::X86Subtarget::hasMMX
bool hasMMX() const
Definition: X86Subtarget.h:209
llvm::X86Subtarget::isPICStyleRIPRel
bool isPICStyleRIPRel() const
Definition: X86Subtarget.h:320
llvm::Triple::isOSLinux
bool isOSLinux() const
Tests whether the OS is Linux.
Definition: Triple.h:636
llvm::X86Subtarget::isTargetWin64
bool isTargetWin64() const
Definition: X86Subtarget.h:315
llvm::X86Subtarget::isTargetPS
bool isTargetPS() const
Definition: X86Subtarget.h:275
llvm::Triple::WatchOS
@ WatchOS
Definition: Triple.h:215
llvm::X86Subtarget::X86Subtarget
X86Subtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS, const X86TargetMachine &TM, MaybeAlign StackAlignOverride, unsigned PreferVectorWidthOverride, unsigned RequiredVectorWidth)
This constructor initializes the data members to match that of the specified triple.
Definition: X86Subtarget.cpp:313
llvm::X86Subtarget::canUseLAHFSAHF
bool canUseLAHFSAHF() const
Definition: X86Subtarget.h:227
llvm::Triple::isWindowsMSVCEnvironment
bool isWindowsMSVCEnvironment() const
Checks if the environment could be MSVC.
Definition: Triple.h:592
llvm::X86Subtarget::isTargetSolaris
bool isTargetSolaris() const
Definition: X86Subtarget.h:274
X86FrameLowering.h
llvm::X86Subtarget::getStackAlignment
Align getStackAlignment() const
Returns the minimum alignment known to hold of the stack frame on entry to the function and which mus...
Definition: X86Subtarget.h:148
llvm::X86Subtarget::ParseSubtargetFeatures
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
llvm::X86Subtarget::isPICStyleStubPIC
bool isPICStyleStubPIC() const
Definition: X86Subtarget.h:322
llvm::Triple::isAndroid
bool isAndroid() const
Tests whether the target is Android.
Definition: Triple.h:723
InstrInfo
return InstrInfo
Definition: RISCVInsertVSETVLI.cpp:668
llvm::Triple::isOSBinFormatELF
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition: Triple.h:673
llvm::X86Subtarget::isTargetKFreeBSD
bool isTargetKFreeBSD() const
Definition: X86Subtarget.h:282
llvm::X86Subtarget::isTargetGlibc
bool isTargetGlibc() const
Definition: X86Subtarget.h:283
llvm::Triple::TvOS
@ TvOS
Definition: Triple.h:214
llvm::Triple::isOSDarwin
bool isOSDarwin() const
Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, or DriverKit).
Definition: Triple.h:517
llvm::X86Subtarget::canExtendTo512DQ
bool canExtendTo512DQ() const
Definition: X86Subtarget.h:245
llvm::X86Subtarget::isTargetWin32
bool isTargetWin32() const
Definition: X86Subtarget.h:317
llvm::Legalizer
Definition: Legalizer.h:36
llvm::CallingConv::Swift
@ Swift
Calling convention for Swift.
Definition: CallingConv.h:69
llvm::X86Subtarget::getRegisterInfo
const X86RegisterInfo * getRegisterInfo() const override
Definition: X86Subtarget.h:138
llvm::X86Subtarget::hasAnyFMA
bool hasAnyFMA() const
Definition: X86Subtarget.h:212
llvm::X86Subtarget::isTargetWindowsCoreCLR
bool isTargetWindowsCoreCLR() const
Definition: X86Subtarget.h:295
llvm::MaybeAlign
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Definition: Alignment.h:117
llvm::X86Subtarget::hasSSE1
bool hasSSE1() const
Definition: X86Subtarget.h:199
llvm::CallingConv::C
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
llvm::Triple::isOSBinFormatMachO
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
Definition: Triple.h:686
llvm::X86Subtarget::getPostRAMutations
void getPostRAMutations(std::vector< std::unique_ptr< ScheduleDAGMutation >> &Mutations) const override
Definition: X86Subtarget.cpp:365
llvm::Triple::isOSIAMCU
bool isOSIAMCU() const
Definition: Triple.h:557
llvm::X86Subtarget::getTileConfigAlignment
Align getTileConfigAlignment() const
Definition: X86Subtarget.h:143
llvm::X86Subtarget::hasSSE41
bool hasSSE41() const
Definition: X86Subtarget.h:203
llvm::X86Subtarget::classifyGlobalReference
unsigned char classifyGlobalReference(const GlobalValue *GV, const Module &M) const
Definition: X86Subtarget.cpp:132
llvm::X86Subtarget::isTargetMachO
bool isTargetMachO() const
Definition: X86Subtarget.h:279
llvm::X86TargetLowering
Definition: X86ISelLowering.h:959
llvm::X86Subtarget::getLegalizerInfo
const LegalizerInfo * getLegalizerInfo() const override
Definition: X86Subtarget.cpp:353
Align
uint64_t Align
Definition: ELFObjHandler.cpp:82
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::X86Subtarget::isOSWindows
bool isOSWindows() const
Definition: X86Subtarget.h:313
llvm::PICStyles::Style::RIPRel
@ RIPRel
llvm::X86Subtarget::isTargetELF
bool isTargetELF() const
Definition: X86Subtarget.h:277
llvm::Triple::isOSNaCl
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
Definition: Triple.h:631
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
llvm::X86Subtarget::isTarget64BitLP64
bool isTarget64BitLP64() const
Is this x86_64 with the LP64 programming model (standard AMD64, no x32)?
Definition: X86Subtarget.h:184
llvm::X86Subtarget::classifyLocalReference
unsigned char classifyLocalReference(const GlobalValue *GV) const
Classify a global variable reference for the current subtarget according to how we should reference i...
Definition: X86Subtarget.cpp:71
llvm::X86Subtarget::enableMachineScheduler
bool enableMachineScheduler() const override
Enable the MachineScheduler pass for all X86 subtargets.
Definition: X86Subtarget.h:406
llvm::X86Subtarget::getRegBankInfo
const RegisterBankInfo * getRegBankInfo() const override
Definition: X86Subtarget.cpp:357
llvm::X86Subtarget::isTargetCygMing
bool isTargetCygMing() const
Definition: X86Subtarget.h:311
X86GenSubtargetInfo
llvm::X86Subtarget::hasPrefetchW
bool hasPrefetchW() const
Definition: X86Subtarget.h:213
llvm::Triple::isOSFuchsia
bool isOSFuchsia() const
Definition: Triple.h:547
llvm::CallingConv::Intel_OCL_BI
@ Intel_OCL_BI
Used for Intel OpenCL built-ins.
Definition: CallingConv.h:144
llvm::X86Subtarget::getSelectionDAGInfo
const X86SelectionDAGInfo * getSelectionDAGInfo() const override
Definition: X86Subtarget.h:134
llvm::CallingConv::Win64
@ Win64
The C convention as implemented on Windows/x86-64 and AArch64.
Definition: CallingConv.h:156
llvm::Triple::MacOSX
@ MacOSX
Definition: Triple.h:197
llvm::Triple::isOSSolaris
bool isOSSolaris() const
Definition: Triple.h:553
llvm::X86Subtarget::enableEarlyIfConversion
bool enableEarlyIfConversion() const override
Definition: X86Subtarget.cpp:361
llvm::Triple::isOSDragonFly
bool isOSDragonFly() const
Definition: Triple.h:551
llvm::RegisterBankInfo
Holds all the information related to register banks.
Definition: RegisterBankInfo.h:39
llvm::GlobalValue
Definition: GlobalValue.h:44
llvm::InstructionSelector
Provides the logic to select generic machine instructions.
Definition: InstructionSelector.h:428
llvm::X86Subtarget::getInstructionSelector
InstructionSelector * getInstructionSelector() const override
Definition: X86Subtarget.cpp:349
llvm::Triple::isOSCygMing
bool isOSCygMing() const
Tests for either Cygwin or MinGW OS.
Definition: Triple.h:620
llvm::X86FrameLowering
Definition: X86FrameLowering.h:28
llvm::Triple::isOSFreeBSD
bool isOSFreeBSD() const
Definition: Triple.h:543
llvm::X86Subtarget::hasThreeDNow
bool hasThreeDNow() const
Definition: X86Subtarget.h:210
llvm::X86Subtarget::isTargetCOFF
bool isTargetCOFF() const
Definition: X86Subtarget.h:278
llvm::CallingConv::X86_64_SysV
@ X86_64_SysV
The C convention as specified in the x86-64 supplement to the System V ABI, used on most non-Windows ...
Definition: CallingConv.h:148
llvm::Triple::isOSGlibc
bool isOSGlibc() const
Tests whether the OS uses glibc.
Definition: Triple.h:661
llvm::CallingConv::X86_VectorCall
@ X86_VectorCall
MSVC calling convention that passes vectors and vector aggregates in SSE registers.
Definition: CallingConv.h:160
llvm::Triple::isWindowsCoreCLREnvironment
bool isWindowsCoreCLREnvironment() const
Definition: Triple.h:603
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
llvm::X86Subtarget::getTargetLowering
const X86TargetLowering * getTargetLowering() const override
Definition: X86Subtarget.h:124
llvm::X86Subtarget::useIndirectThunkBranches
bool useIndirectThunkBranches() const
Definition: X86Subtarget.h:234
llvm::X86Subtarget::hasThreeDNowA
bool hasThreeDNowA() const
Definition: X86Subtarget.h:211
llvm::X86TargetMachine
Definition: X86TargetMachine.h:28
llvm::X86Subtarget::canUseCMOV
bool canUseCMOV() const
Definition: X86Subtarget.h:198
llvm::X86Subtarget::isTargetDragonFly
bool isTargetDragonFly() const
Definition: X86Subtarget.h:273
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::X86Subtarget::classifyBlockAddressReference
unsigned char classifyBlockAddressReference() const
Classify a blockaddress reference for the current subtarget according to how we should reference it i...
Definition: X86Subtarget.cpp:59
llvm::X86Subtarget::hasInt256
bool hasInt256() const
Definition: X86Subtarget.h:208
llvm::CallingConv::SwiftTail
@ SwiftTail
This follows the Swift calling convention in how arguments are passed but guarantees tail calls will ...
Definition: CallingConv.h:87
Triple.h
llvm::X86InstrInfo
Definition: X86InstrInfo.h:138
llvm::X86Subtarget::isTargetDarwin
bool isTargetDarwin() const
Definition: X86Subtarget.h:271
llvm::X86Subtarget::isTargetFuchsia
bool isTargetFuchsia() const
Definition: X86Subtarget.h:289
llvm::X86Subtarget::canUseCMPXCHG16B
bool canUseCMPXCHG16B() const
Definition: X86Subtarget.h:192
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
TargetSubtargetInfo.h
llvm::X86Subtarget::setPICStyle
void setPICStyle(PICStyles::Style Style)
Definition: X86Subtarget.h:189
llvm::X86InstrInfo::getRegisterInfo
const X86RegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
Definition: X86InstrInfo.h:157
CC
auto CC
Definition: RISCVRedundantCopyElimination.cpp:79
llvm::X86Subtarget::useBWIRegs
bool useBWIRegs() const
Definition: X86Subtarget.h:258
llvm::X86Subtarget::isTargetWindowsGNU
bool isTargetWindowsGNU() const
Definition: X86Subtarget.h:303
llvm::X86Subtarget::hasSSE3
bool hasSSE3() const
Definition: X86Subtarget.h:201
llvm::Triple::isOSWindows
bool isOSWindows() const
Tests whether the OS is Windows.
Definition: Triple.h:582
CallingConv.h
llvm::X86Subtarget::hasAVX512
bool hasAVX512() const
Definition: X86Subtarget.h:207
llvm::X86Subtarget::isTargetFreeBSD
bool isTargetFreeBSD() const
Definition: X86Subtarget.h:272
llvm::X86Subtarget::hasMFence
bool hasMFence() const
Use mfence if we have SSE2 or we're on x86-64 (even if we asked for no-sse2).
Definition: X86Subtarget.h:267
llvm::X86Subtarget::isTargetWindowsMSVC
bool isTargetWindowsMSVC() const
Definition: X86Subtarget.h:291
llvm::CallingConv::X86_StdCall
@ X86_StdCall
stdcall is mostly used by the Win32 API.
Definition: CallingConv.h:96
llvm::X86Subtarget::isCallingConvWin64
bool isCallingConvWin64(CallingConv::ID CC) const
Definition: X86Subtarget.h:328
llvm::X86Subtarget::canUseCMPXCHG8B
bool canUseCMPXCHG8B() const
Definition: X86Subtarget.h:191
llvm::Triple::isWindowsGNUEnvironment
bool isWindowsGNUEnvironment() const
Definition: Triple.h:615
llvm::X86Subtarget::isTargetAndroid
bool isTargetAndroid() const
Definition: X86Subtarget.h:284
llvm::X86Subtarget::classifyGlobalFunctionReference
unsigned char classifyGlobalFunctionReference(const GlobalValue *GV, const Module &M) const
Classify a global function reference for the current subtarget.
Definition: X86Subtarget.cpp:199
llvm::PICStyles::Style::None
@ None
llvm::X86Subtarget::canExtendTo512BW
bool canExtendTo512BW() const
Definition: X86Subtarget.h:248
X86ISelLowering.h
llvm::X86Subtarget::hasAVX
bool hasAVX() const
Definition: X86Subtarget.h:205
llvm::CallingConv::X86_FastCall
@ X86_FastCall
'fast' analog of X86_StdCall.
Definition: CallingConv.h:100
llvm::X86Subtarget::isTargetWindowsItanium
bool isTargetWindowsItanium() const
Definition: X86Subtarget.h:307
llvm::X86Subtarget::getTargetTriple
const Triple & getTargetTriple() const
Definition: X86Subtarget.h:269
llvm::X86Subtarget::getAntiDepBreakMode
AntiDepBreakMode getAntiDepBreakMode() const override
Definition: X86Subtarget.h:413
llvm::X86Subtarget::isTargetNaCl32
bool isTargetNaCl32() const
Definition: X86Subtarget.h:286
llvm::PICStyles::Style
Style
Definition: X86Subtarget.h:43
llvm::X86Subtarget::hasSSSE3
bool hasSSSE3() const
Definition: X86Subtarget.h:202
llvm::CallingConv::Fast
@ Fast
Attempts to make calls as fast as possible (e.g.
Definition: CallingConv.h:41
llvm::CallingConv::Tail
@ Tail
Attemps to make calls as fast as possible while guaranteeing that tail call optimization can always b...
Definition: CallingConv.h:76
llvm::Triple::isX32
bool isX32() const
Tests whether the target is X32.
Definition: Triple.h:936
llvm::X86Subtarget::getPICStyle
PICStyles::Style getPICStyle() const
Definition: X86Subtarget.h:188
llvm::X86SelectionDAGInfo
Definition: X86SelectionDAGInfo.h:20
llvm::PICStyles::Style::GOT
@ GOT
llvm::X86Subtarget::hasSSE42
bool hasSSE42() const
Definition: X86Subtarget.h:204
llvm::LegalizerInfo
Definition: LegalizerInfo.h:1182
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::X86Subtarget::useAVX512Regs
bool useAVX512Regs() const
Definition: X86Subtarget.h:254
llvm::CallingConv::X86_ThisCall
@ X86_ThisCall
Similar to X86_StdCall.
Definition: CallingConv.h:119
llvm::X86Subtarget::getCallLowering
const CallLowering * getCallLowering() const override
Methods used by Global ISel.
Definition: X86Subtarget.cpp:345
llvm::X86Subtarget::enableIndirectBrExpand
bool enableIndirectBrExpand() const override
If we are using indirect thunks, we need to expand indirectbr to avoid it lowering to an actual indir...
Definition: X86Subtarget.h:401
llvm::X86Subtarget::isTargetWindowsCygwin
bool isTargetWindowsCygwin() const
Definition: X86Subtarget.h:299
llvm::X86Subtarget::getMaxInlineSizeThreshold
unsigned getMaxInlineSizeThreshold() const
Returns the maximum memset / memcpy size that still makes it profitable to inline the call.
Definition: X86Subtarget.h:152
llvm::X86Subtarget::isPositionIndependent
bool isPositionIndependent() const
Definition: X86Subtarget.cpp:370
X86InstrInfo.h
llvm::CallLowering
Definition: CallLowering.h:44
llvm::X86Subtarget::isPICStyleGOT
bool isPICStyleGOT() const
Definition: X86Subtarget.h:319
llvm::X86Subtarget::useIndirectThunkCalls
bool useIndirectThunkCalls() const
Definition: X86Subtarget.h:231
llvm::Triple::isOSKFreeBSD
bool isOSKFreeBSD() const
Tests whether the OS is kFreeBSD.
Definition: Triple.h:641
llvm::X86Subtarget::swiftAsyncContextIsDynamicallySet
bool swiftAsyncContextIsDynamicallySet() const
Return whether FrameLowering should always set the "extended frame present" bit in FP,...
Definition: X86Subtarget.h:377
llvm::X86Subtarget::isTargetNaCl64
bool isTargetNaCl64() const
Definition: X86Subtarget.h:287
llvm::Triple::isWindowsCygwinEnvironment
bool isWindowsCygwinEnvironment() const
Definition: Triple.h:611
llvm::X86RegisterInfo
Definition: X86RegisterInfo.h:24