]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/X86/X86Subtarget.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303197, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / X86 / X86Subtarget.h
1 //===-- X86Subtarget.h - Define Subtarget for the X86 ----------*- C++ -*--===//
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 declares the X86 specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_LIB_TARGET_X86_X86SUBTARGET_H
15 #define LLVM_LIB_TARGET_X86_X86SUBTARGET_H
16
17 #include "X86FrameLowering.h"
18 #include "X86ISelLowering.h"
19 #include "X86InstrInfo.h"
20 #include "X86SelectionDAGInfo.h"
21 #include "llvm/ADT/StringRef.h"
22 #include "llvm/ADT/Triple.h"
23 #include "llvm/CodeGen/GlobalISel/GISelAccessor.h"
24 #include "llvm/IR/CallingConv.h"
25 #include "llvm/MC/MCInstrItineraries.h"
26 #include "llvm/Target/TargetMachine.h"
27 #include "llvm/Target/TargetSubtargetInfo.h"
28 #include <memory>
29
30 #define GET_SUBTARGETINFO_HEADER
31 #include "X86GenSubtargetInfo.inc"
32
33 namespace llvm {
34
35 class GlobalValue;
36
37 /// The X86 backend supports a number of different styles of PIC.
38 ///
39 namespace PICStyles {
40
41 enum Style {
42   StubPIC,          // Used on i386-darwin in pic mode.
43   GOT,              // Used on 32 bit elf on when in pic mode.
44   RIPRel,           // Used on X86-64 when in pic mode.
45   None              // Set when not in pic mode.
46 };
47
48 } // end namespace PICStyles
49
50 class X86Subtarget final : public X86GenSubtargetInfo {
51 protected:
52   enum X86SSEEnum {
53     NoSSE, SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, AVX, AVX2, AVX512F
54   };
55
56   enum X863DNowEnum {
57     NoThreeDNow, MMX, ThreeDNow, ThreeDNowA
58   };
59
60   enum X86ProcFamilyEnum {
61     Others, IntelAtom, IntelSLM
62   };
63
64   /// X86 processor family: Intel Atom, and others
65   X86ProcFamilyEnum X86ProcFamily;
66
67   /// Which PIC style to use
68   PICStyles::Style PICStyle;
69
70   const TargetMachine &TM;
71
72   /// SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, or none supported.
73   X86SSEEnum X86SSELevel;
74
75   /// MMX, 3DNow, 3DNow Athlon, or none supported.
76   X863DNowEnum X863DNowLevel;
77
78   /// True if the processor supports X87 instructions.
79   bool HasX87;
80
81   /// True if this processor has conditional move instructions
82   /// (generally pentium pro+).
83   bool HasCMov;
84
85   /// True if the processor supports X86-64 instructions.
86   bool HasX86_64;
87
88   /// True if the processor supports POPCNT.
89   bool HasPOPCNT;
90
91   /// True if the processor supports SSE4A instructions.
92   bool HasSSE4A;
93
94   /// Target has AES instructions
95   bool HasAES;
96
97   /// Target has FXSAVE/FXRESTOR instructions
98   bool HasFXSR;
99
100   /// Target has XSAVE instructions
101   bool HasXSAVE;
102
103   /// Target has XSAVEOPT instructions
104   bool HasXSAVEOPT;
105
106   /// Target has XSAVEC instructions
107   bool HasXSAVEC;
108
109   /// Target has XSAVES instructions
110   bool HasXSAVES;
111
112   /// Target has carry-less multiplication
113   bool HasPCLMUL;
114
115   /// Target has 3-operand fused multiply-add
116   bool HasFMA;
117
118   /// Target has 4-operand fused multiply-add
119   bool HasFMA4;
120
121   /// Target has XOP instructions
122   bool HasXOP;
123
124   /// Target has TBM instructions.
125   bool HasTBM;
126
127   /// Target has LWP instructions
128   bool HasLWP;
129
130   /// True if the processor has the MOVBE instruction.
131   bool HasMOVBE;
132
133   /// True if the processor has the RDRAND instruction.
134   bool HasRDRAND;
135
136   /// Processor has 16-bit floating point conversion instructions.
137   bool HasF16C;
138
139   /// Processor has FS/GS base insturctions.
140   bool HasFSGSBase;
141
142   /// Processor has LZCNT instruction.
143   bool HasLZCNT;
144
145   /// Processor has BMI1 instructions.
146   bool HasBMI;
147
148   /// Processor has BMI2 instructions.
149   bool HasBMI2;
150
151   /// Processor has VBMI instructions.
152   bool HasVBMI;
153
154   /// Processor has Integer Fused Multiply Add
155   bool HasIFMA;
156
157   /// Processor has RTM instructions.
158   bool HasRTM;
159
160   /// Processor has ADX instructions.
161   bool HasADX;
162
163   /// Processor has SHA instructions.
164   bool HasSHA;
165
166   /// Processor has PRFCHW instructions.
167   bool HasPRFCHW;
168
169   /// Processor has RDSEED instructions.
170   bool HasRDSEED;
171
172   /// Processor has LAHF/SAHF instructions.
173   bool HasLAHFSAHF;
174
175   /// Processor has MONITORX/MWAITX instructions.
176   bool HasMWAITX;
177
178   /// Processor has Cache Line Zero instruction
179   bool HasCLZERO;
180
181   /// Processor has Prefetch with intent to Write instruction
182   bool HasPFPREFETCHWT1;
183
184   /// True if BT (bit test) of memory instructions are slow.
185   bool IsBTMemSlow;
186
187   /// True if SHLD instructions are slow.
188   bool IsSHLDSlow;
189
190   /// True if the PMULLD instruction is slow compared to PMULLW/PMULHW and
191   //  PMULUDQ.
192   bool IsPMULLDSlow;
193
194   /// True if unaligned memory accesses of 16-bytes are slow.
195   bool IsUAMem16Slow;
196
197   /// True if unaligned memory accesses of 32-bytes are slow.
198   bool IsUAMem32Slow;
199
200   /// True if SSE operations can have unaligned memory operands.
201   /// This may require setting a configuration bit in the processor.
202   bool HasSSEUnalignedMem;
203
204   /// True if this processor has the CMPXCHG16B instruction;
205   /// this is true for most x86-64 chips, but not the first AMD chips.
206   bool HasCmpxchg16b;
207
208   /// True if the LEA instruction should be used for adjusting
209   /// the stack pointer. This is an optimization for Intel Atom processors.
210   bool UseLeaForSP;
211
212   /// True if there is no performance penalty to writing only the lower parts
213   /// of a YMM or ZMM register without clearing the upper part.
214   bool HasFastPartialYMMorZMMWrite;
215
216   /// True if hardware SQRTSS instruction is at least as fast (latency) as
217   /// RSQRTSS followed by a Newton-Raphson iteration.
218   bool HasFastScalarFSQRT;
219
220   /// True if hardware SQRTPS/VSQRTPS instructions are at least as fast
221   /// (throughput) as RSQRTPS/VRSQRTPS followed by a Newton-Raphson iteration.
222   bool HasFastVectorFSQRT;
223
224   /// True if 8-bit divisions are significantly faster than
225   /// 32-bit divisions and should be used when possible.
226   bool HasSlowDivide32;
227
228   /// True if 32-bit divides are significantly faster than
229   /// 64-bit divisions and should be used when possible.
230   bool HasSlowDivide64;
231
232   /// True if LZCNT instruction is fast.
233   bool HasFastLZCNT;
234
235   /// True if SHLD based rotate is fast.
236   bool HasFastSHLDRotate;
237
238   /// True if the processor has enhanced REP MOVSB/STOSB.
239   bool HasERMSB;
240
241   /// True if the short functions should be padded to prevent
242   /// a stall when returning too early.
243   bool PadShortFunctions;
244
245   /// True if the Calls with memory reference should be converted
246   /// to a register-based indirect call.
247   bool CallRegIndirect;
248
249   /// True if the LEA instruction inputs have to be ready at address generation
250   /// (AG) time.
251   bool LEAUsesAG;
252
253   /// True if the LEA instruction with certain arguments is slow
254   bool SlowLEA;
255
256   /// True if the LEA instruction has all three source operands: base, index,
257   /// and offset or if the LEA instruction uses base and index registers where
258   /// the base is EBP, RBP,or R13
259   bool Slow3OpsLEA;
260
261   /// True if INC and DEC instructions are slow when writing to flags
262   bool SlowIncDec;
263
264   /// Processor has AVX-512 PreFetch Instructions
265   bool HasPFI;
266
267   /// Processor has AVX-512 Exponential and Reciprocal Instructions
268   bool HasERI;
269
270   /// Processor has AVX-512 Conflict Detection Instructions
271   bool HasCDI;
272
273   /// Processor has AVX-512 Doubleword and Quadword instructions
274   bool HasDQI;
275
276   /// Processor has AVX-512 Byte and Word instructions
277   bool HasBWI;
278
279   /// Processor has AVX-512 Vector Length eXtenstions
280   bool HasVLX;
281
282   /// Processor has PKU extenstions
283   bool HasPKU;
284
285   /// Processor supports MPX - Memory Protection Extensions
286   bool HasMPX;
287
288   /// Processor has Software Guard Extensions
289   bool HasSGX;
290
291   /// Processor supports Flush Cache Line instruction
292   bool HasCLFLUSHOPT;
293
294   /// Processor supports Cache Line Write Back instruction
295   bool HasCLWB;
296
297   /// Use software floating point for code generation.
298   bool UseSoftFloat;
299
300   /// The minimum alignment known to hold of the stack frame on
301   /// entry to the function and which must be maintained by every function.
302   unsigned stackAlignment;
303
304   /// Max. memset / memcpy size that is turned into rep/movs, rep/stos ops.
305   ///
306   unsigned MaxInlineSizeThreshold;
307
308   /// What processor and OS we're targeting.
309   Triple TargetTriple;
310
311   /// Instruction itineraries for scheduling
312   InstrItineraryData InstrItins;
313
314   /// Gather the accessor points to GlobalISel-related APIs.
315   /// This is used to avoid ifndefs spreading around while GISel is
316   /// an optional library.
317   std::unique_ptr<GISelAccessor> GISel;
318
319 private:
320   /// Override the stack alignment.
321   unsigned StackAlignOverride;
322
323   /// True if compiling for 64-bit, false for 16-bit or 32-bit.
324   bool In64BitMode;
325
326   /// True if compiling for 32-bit, false for 16-bit or 64-bit.
327   bool In32BitMode;
328
329   /// True if compiling for 16-bit, false for 32-bit or 64-bit.
330   bool In16BitMode;
331
332   X86SelectionDAGInfo TSInfo;
333   // Ordering here is important. X86InstrInfo initializes X86RegisterInfo which
334   // X86TargetLowering needs.
335   X86InstrInfo InstrInfo;
336   X86TargetLowering TLInfo;
337   X86FrameLowering FrameLowering;
338
339   bool OptForSize;
340   bool OptForMinSize;
341
342 public:
343   /// This constructor initializes the data members to match that
344   /// of the specified triple.
345   ///
346   X86Subtarget(const Triple &TT, StringRef CPU, StringRef FS,
347                const X86TargetMachine &TM, unsigned StackAlignOverride,
348                bool OptForSize, bool OptForMinSize);
349
350   /// This object will take onwership of \p GISelAccessor.
351   void setGISelAccessor(GISelAccessor &GISel) { this->GISel.reset(&GISel); }
352
353   const X86TargetLowering *getTargetLowering() const override {
354     return &TLInfo;
355   }
356
357   const X86InstrInfo *getInstrInfo() const override { return &InstrInfo; }
358
359   const X86FrameLowering *getFrameLowering() const override {
360     return &FrameLowering;
361   }
362
363   const X86SelectionDAGInfo *getSelectionDAGInfo() const override {
364     return &TSInfo;
365   }
366
367   const X86RegisterInfo *getRegisterInfo() const override {
368     return &getInstrInfo()->getRegisterInfo();
369   }
370
371   /// Returns the minimum alignment known to hold of the
372   /// stack frame on entry to the function and which must be maintained by every
373   /// function for this subtarget.
374   unsigned getStackAlignment() const { return stackAlignment; }
375
376   /// Returns the maximum memset / memcpy size
377   /// that still makes it profitable to inline the call.
378   unsigned getMaxInlineSizeThreshold() const { return MaxInlineSizeThreshold; }
379
380   /// ParseSubtargetFeatures - Parses features string setting specified
381   /// subtarget options.  Definition of function is auto generated by tblgen.
382   void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
383
384   /// Methods used by Global ISel
385   const CallLowering *getCallLowering() const override;
386   const InstructionSelector *getInstructionSelector() const override;
387   const LegalizerInfo *getLegalizerInfo() const override;
388   const RegisterBankInfo *getRegBankInfo() const override;
389
390 private:
391   /// Initialize the full set of dependencies so we can use an initializer
392   /// list for X86Subtarget.
393   X86Subtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
394   void initializeEnvironment();
395   void initSubtargetFeatures(StringRef CPU, StringRef FS);
396
397 public:
398   /// Is this x86_64? (disregarding specific ABI / programming model)
399   bool is64Bit() const {
400     return In64BitMode;
401   }
402
403   bool is32Bit() const {
404     return In32BitMode;
405   }
406
407   bool is16Bit() const {
408     return In16BitMode;
409   }
410
411   /// Is this x86_64 with the ILP32 programming model (x32 ABI)?
412   bool isTarget64BitILP32() const {
413     return In64BitMode && (TargetTriple.getEnvironment() == Triple::GNUX32 ||
414                            TargetTriple.isOSNaCl());
415   }
416
417   /// Is this x86_64 with the LP64 programming model (standard AMD64, no x32)?
418   bool isTarget64BitLP64() const {
419     return In64BitMode && (TargetTriple.getEnvironment() != Triple::GNUX32 &&
420                            !TargetTriple.isOSNaCl());
421   }
422
423   PICStyles::Style getPICStyle() const { return PICStyle; }
424   void setPICStyle(PICStyles::Style Style)  { PICStyle = Style; }
425
426   bool hasX87() const { return HasX87; }
427   bool hasCMov() const { return HasCMov; }
428   bool hasSSE1() const { return X86SSELevel >= SSE1; }
429   bool hasSSE2() const { return X86SSELevel >= SSE2; }
430   bool hasSSE3() const { return X86SSELevel >= SSE3; }
431   bool hasSSSE3() const { return X86SSELevel >= SSSE3; }
432   bool hasSSE41() const { return X86SSELevel >= SSE41; }
433   bool hasSSE42() const { return X86SSELevel >= SSE42; }
434   bool hasAVX() const { return X86SSELevel >= AVX; }
435   bool hasAVX2() const { return X86SSELevel >= AVX2; }
436   bool hasAVX512() const { return X86SSELevel >= AVX512F; }
437   bool hasFp256() const { return hasAVX(); }
438   bool hasInt256() const { return hasAVX2(); }
439   bool hasSSE4A() const { return HasSSE4A; }
440   bool hasMMX() const { return X863DNowLevel >= MMX; }
441   bool has3DNow() const { return X863DNowLevel >= ThreeDNow; }
442   bool has3DNowA() const { return X863DNowLevel >= ThreeDNowA; }
443   bool hasPOPCNT() const { return HasPOPCNT; }
444   bool hasAES() const { return HasAES; }
445   bool hasFXSR() const { return HasFXSR; }
446   bool hasXSAVE() const { return HasXSAVE; }
447   bool hasXSAVEOPT() const { return HasXSAVEOPT; }
448   bool hasXSAVEC() const { return HasXSAVEC; }
449   bool hasXSAVES() const { return HasXSAVES; }
450   bool hasPCLMUL() const { return HasPCLMUL; }
451   // Prefer FMA4 to FMA - its better for commutation/memory folding and
452   // has equal or better performance on all supported targets.
453   bool hasFMA() const { return (HasFMA || hasAVX512()) && !HasFMA4; }
454   bool hasFMA4() const { return HasFMA4; }
455   bool hasAnyFMA() const { return hasFMA() || hasFMA4(); }
456   bool hasXOP() const { return HasXOP; }
457   bool hasTBM() const { return HasTBM; }
458   bool hasLWP() const { return HasLWP; }
459   bool hasMOVBE() const { return HasMOVBE; }
460   bool hasRDRAND() const { return HasRDRAND; }
461   bool hasF16C() const { return HasF16C; }
462   bool hasFSGSBase() const { return HasFSGSBase; }
463   bool hasLZCNT() const { return HasLZCNT; }
464   bool hasBMI() const { return HasBMI; }
465   bool hasBMI2() const { return HasBMI2; }
466   bool hasVBMI() const { return HasVBMI; }
467   bool hasIFMA() const { return HasIFMA; }
468   bool hasRTM() const { return HasRTM; }
469   bool hasADX() const { return HasADX; }
470   bool hasSHA() const { return HasSHA; }
471   bool hasPRFCHW() const { return HasPRFCHW; }
472   bool hasRDSEED() const { return HasRDSEED; }
473   bool hasLAHFSAHF() const { return HasLAHFSAHF; }
474   bool hasMWAITX() const { return HasMWAITX; }
475   bool hasCLZERO() const { return HasCLZERO; }
476   bool isBTMemSlow() const { return IsBTMemSlow; }
477   bool isSHLDSlow() const { return IsSHLDSlow; }
478   bool isPMULLDSlow() const { return IsPMULLDSlow; }
479   bool isUnalignedMem16Slow() const { return IsUAMem16Slow; }
480   bool isUnalignedMem32Slow() const { return IsUAMem32Slow; }
481   bool hasSSEUnalignedMem() const { return HasSSEUnalignedMem; }
482   bool hasCmpxchg16b() const { return HasCmpxchg16b; }
483   bool useLeaForSP() const { return UseLeaForSP; }
484   bool hasFastPartialYMMorZMMWrite() const {
485     return HasFastPartialYMMorZMMWrite;
486   }
487   bool hasFastScalarFSQRT() const { return HasFastScalarFSQRT; }
488   bool hasFastVectorFSQRT() const { return HasFastVectorFSQRT; }
489   bool hasFastLZCNT() const { return HasFastLZCNT; }
490   bool hasFastSHLDRotate() const { return HasFastSHLDRotate; }
491   bool hasERMSB() const { return HasERMSB; }
492   bool hasSlowDivide32() const { return HasSlowDivide32; }
493   bool hasSlowDivide64() const { return HasSlowDivide64; }
494   bool padShortFunctions() const { return PadShortFunctions; }
495   bool callRegIndirect() const { return CallRegIndirect; }
496   bool LEAusesAG() const { return LEAUsesAG; }
497   bool slowLEA() const { return SlowLEA; }
498   bool slow3OpsLEA() const { return Slow3OpsLEA; }
499   bool slowIncDec() const { return SlowIncDec; }
500   bool hasCDI() const { return HasCDI; }
501   bool hasPFI() const { return HasPFI; }
502   bool hasERI() const { return HasERI; }
503   bool hasDQI() const { return HasDQI; }
504   bool hasBWI() const { return HasBWI; }
505   bool hasVLX() const { return HasVLX; }
506   bool hasPKU() const { return HasPKU; }
507   bool hasMPX() const { return HasMPX; }
508   bool hasCLFLUSHOPT() const { return HasCLFLUSHOPT; }
509
510   bool isXRaySupported() const override { return is64Bit(); }
511
512   bool isAtom() const { return X86ProcFamily == IntelAtom; }
513   bool isSLM() const { return X86ProcFamily == IntelSLM; }
514   bool useSoftFloat() const { return UseSoftFloat; }
515
516   bool getOptForSize() const { return OptForSize; }
517   bool getOptForMinSize() const { return OptForMinSize; }
518
519   /// Use mfence if we have SSE2 or we're on x86-64 (even if we asked for
520   /// no-sse2). There isn't any reason to disable it if the target processor
521   /// supports it.
522   bool hasMFence() const { return hasSSE2() || is64Bit(); }
523
524   const Triple &getTargetTriple() const { return TargetTriple; }
525
526   bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
527   bool isTargetFreeBSD() const { return TargetTriple.isOSFreeBSD(); }
528   bool isTargetDragonFly() const { return TargetTriple.isOSDragonFly(); }
529   bool isTargetSolaris() const { return TargetTriple.isOSSolaris(); }
530   bool isTargetPS4() const { return TargetTriple.isPS4CPU(); }
531
532   bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
533   bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
534   bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
535
536   bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
537   bool isTargetKFreeBSD() const { return TargetTriple.isOSKFreeBSD(); }
538   bool isTargetGlibc() const { return TargetTriple.isOSGlibc(); }
539   bool isTargetAndroid() const { return TargetTriple.isAndroid(); }
540   bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
541   bool isTargetNaCl32() const { return isTargetNaCl() && !is64Bit(); }
542   bool isTargetNaCl64() const { return isTargetNaCl() && is64Bit(); }
543   bool isTargetMCU() const { return TargetTriple.isOSIAMCU(); }
544   bool isTargetFuchsia() const { return TargetTriple.isOSFuchsia(); }
545
546   bool isTargetWindowsMSVC() const {
547     return TargetTriple.isWindowsMSVCEnvironment();
548   }
549
550   bool isTargetKnownWindowsMSVC() const {
551     return TargetTriple.isKnownWindowsMSVCEnvironment();
552   }
553
554   bool isTargetWindowsCoreCLR() const {
555     return TargetTriple.isWindowsCoreCLREnvironment();
556   }
557
558   bool isTargetWindowsCygwin() const {
559     return TargetTriple.isWindowsCygwinEnvironment();
560   }
561
562   bool isTargetWindowsGNU() const {
563     return TargetTriple.isWindowsGNUEnvironment();
564   }
565
566   bool isTargetWindowsItanium() const {
567     return TargetTriple.isWindowsItaniumEnvironment();
568   }
569
570   bool isTargetCygMing() const { return TargetTriple.isOSCygMing(); }
571
572   bool isOSWindows() const { return TargetTriple.isOSWindows(); }
573
574   bool isTargetWin64() const {
575     return In64BitMode && TargetTriple.isOSWindows();
576   }
577
578   bool isTargetWin32() const {
579     return !In64BitMode && (isTargetCygMing() || isTargetKnownWindowsMSVC());
580   }
581
582   bool isPICStyleGOT() const { return PICStyle == PICStyles::GOT; }
583   bool isPICStyleRIPRel() const { return PICStyle == PICStyles::RIPRel; }
584
585   bool isPICStyleStubPIC() const {
586     return PICStyle == PICStyles::StubPIC;
587   }
588
589   bool isPositionIndependent() const { return TM.isPositionIndependent(); }
590
591   bool isCallingConvWin64(CallingConv::ID CC) const {
592     switch (CC) {
593     // On Win64, all these conventions just use the default convention.
594     case CallingConv::C:
595     case CallingConv::Fast:
596     case CallingConv::X86_FastCall:
597     case CallingConv::X86_StdCall:
598     case CallingConv::X86_ThisCall:
599     case CallingConv::X86_VectorCall:
600     case CallingConv::Intel_OCL_BI:
601       return isTargetWin64();
602     // This convention allows using the Win64 convention on other targets.
603     case CallingConv::X86_64_Win64:
604       return true;
605     // This convention allows using the SysV convention on Windows targets.
606     case CallingConv::X86_64_SysV:
607       return false;
608     // Otherwise, who knows what this is.
609     default:
610       return false;
611     }
612   }
613
614   /// Classify a global variable reference for the current subtarget according
615   /// to how we should reference it in a non-pcrel context.
616   unsigned char classifyLocalReference(const GlobalValue *GV) const;
617
618   unsigned char classifyGlobalReference(const GlobalValue *GV,
619                                         const Module &M) const;
620   unsigned char classifyGlobalReference(const GlobalValue *GV) const;
621
622   /// Classify a global function reference for the current subtarget.
623   unsigned char classifyGlobalFunctionReference(const GlobalValue *GV,
624                                                 const Module &M) const;
625   unsigned char classifyGlobalFunctionReference(const GlobalValue *GV) const;
626
627   /// Classify a blockaddress reference for the current subtarget according to
628   /// how we should reference it in a non-pcrel context.
629   unsigned char classifyBlockAddressReference() const;
630
631   /// Return true if the subtarget allows calls to immediate address.
632   bool isLegalToCallImmediateAddr() const;
633
634   /// This function returns the name of a function which has an interface
635   /// like the non-standard bzero function, if such a function exists on
636   /// the current subtarget and it is considered prefereable over
637   /// memset with zero passed as the second argument. Otherwise it
638   /// returns null.
639   const char *getBZeroEntry() const;
640
641   /// This function returns true if the target has sincos() routine in its
642   /// compiler runtime or math libraries.
643   bool hasSinCos() const;
644
645   /// Enable the MachineScheduler pass for all X86 subtargets.
646   bool enableMachineScheduler() const override { return true; }
647
648   // TODO: Update the regression tests and return true.
649   bool supportPrintSchedInfo() const override { return false; }
650
651   bool enableEarlyIfConversion() const override;
652
653   /// Return the instruction itineraries based on the subtarget selection.
654   const InstrItineraryData *getInstrItineraryData() const override {
655     return &InstrItins;
656   }
657
658   AntiDepBreakMode getAntiDepBreakMode() const override {
659     return TargetSubtargetInfo::ANTIDEP_CRITICAL;
660   }
661 };
662
663 } // end namespace llvm
664
665 #endif // LLVM_LIB_TARGET_X86_X86SUBTARGET_H