207d0baa50a2082645314a0a246352cb2e84f6a5
[oota-llvm.git] / lib / Target / X86 / X86Subtarget.cpp
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 #define DEBUG_TYPE "subtarget"
15 #include "X86Subtarget.h"
16 #include "X86InstrInfo.h"
17 #include "llvm/IR/Attributes.h"
18 #include "llvm/IR/Function.h"
19 #include "llvm/IR/GlobalValue.h"
20 #include "llvm/Support/Debug.h"
21 #include "llvm/Support/ErrorHandling.h"
22 #include "llvm/Support/Host.h"
23 #include "llvm/Support/raw_ostream.h"
24 #include "llvm/Target/TargetMachine.h"
25 #include "llvm/Target/TargetOptions.h"
26
27 #define GET_SUBTARGETINFO_TARGET_DESC
28 #define GET_SUBTARGETINFO_CTOR
29 #include "X86GenSubtargetInfo.inc"
30
31 using namespace llvm;
32
33 #if defined(_MSC_VER)
34 #include <intrin.h>
35 #endif
36
37 /// ClassifyBlockAddressReference - Classify a blockaddress reference for the
38 /// current subtarget according to how we should reference it in a non-pcrel
39 /// context.
40 unsigned char X86Subtarget::ClassifyBlockAddressReference() const {
41   if (isPICStyleGOT())    // 32-bit ELF targets.
42     return X86II::MO_GOTOFF;
43
44   if (isPICStyleStubPIC())   // Darwin/32 in PIC mode.
45     return X86II::MO_PIC_BASE_OFFSET;
46
47   // Direct static reference to label.
48   return X86II::MO_NO_FLAG;
49 }
50
51 /// ClassifyGlobalReference - Classify a global variable reference for the
52 /// current subtarget according to how we should reference it in a non-pcrel
53 /// context.
54 unsigned char X86Subtarget::
55 ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const {
56   // DLLImport only exists on windows, it is implemented as a load from a
57   // DLLIMPORT stub.
58   if (GV->hasDLLImportStorageClass())
59     return X86II::MO_DLLIMPORT;
60
61   // Determine whether this is a reference to a definition or a declaration.
62   // Materializable GVs (in JIT lazy compilation mode) do not require an extra
63   // load from stub.
64   bool isDecl = GV->hasAvailableExternallyLinkage();
65   if (GV->isDeclaration() && !GV->isMaterializable())
66     isDecl = true;
67
68   // X86-64 in PIC mode.
69   if (isPICStyleRIPRel()) {
70     // Large model never uses stubs.
71     if (TM.getCodeModel() == CodeModel::Large)
72       return X86II::MO_NO_FLAG;
73
74     if (isTargetDarwin()) {
75       // If symbol visibility is hidden, the extra load is not needed if
76       // target is x86-64 or the symbol is definitely defined in the current
77       // translation unit.
78       if (GV->hasDefaultVisibility() &&
79           (isDecl || GV->isWeakForLinker()))
80         return X86II::MO_GOTPCREL;
81     } else if (!isTargetWin64()) {
82       assert(isTargetELF() && "Unknown rip-relative target");
83
84       // Extra load is needed for all externally visible.
85       if (!GV->hasLocalLinkage() && GV->hasDefaultVisibility())
86         return X86II::MO_GOTPCREL;
87     }
88
89     return X86II::MO_NO_FLAG;
90   }
91
92   if (isPICStyleGOT()) {   // 32-bit ELF targets.
93     // Extra load is needed for all externally visible.
94     if (GV->hasLocalLinkage() || GV->hasHiddenVisibility())
95       return X86II::MO_GOTOFF;
96     return X86II::MO_GOT;
97   }
98
99   if (isPICStyleStubPIC()) {  // Darwin/32 in PIC mode.
100     // Determine whether we have a stub reference and/or whether the reference
101     // is relative to the PIC base or not.
102
103     // If this is a strong reference to a definition, it is definitely not
104     // through a stub.
105     if (!isDecl && !GV->isWeakForLinker())
106       return X86II::MO_PIC_BASE_OFFSET;
107
108     // Unless we have a symbol with hidden visibility, we have to go through a
109     // normal $non_lazy_ptr stub because this symbol might be resolved late.
110     if (!GV->hasHiddenVisibility())  // Non-hidden $non_lazy_ptr reference.
111       return X86II::MO_DARWIN_NONLAZY_PIC_BASE;
112
113     // If symbol visibility is hidden, we have a stub for common symbol
114     // references and external declarations.
115     if (isDecl || GV->hasCommonLinkage()) {
116       // Hidden $non_lazy_ptr reference.
117       return X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE;
118     }
119
120     // Otherwise, no stub.
121     return X86II::MO_PIC_BASE_OFFSET;
122   }
123
124   if (isPICStyleStubNoDynamic()) {  // Darwin/32 in -mdynamic-no-pic mode.
125     // Determine whether we have a stub reference.
126
127     // If this is a strong reference to a definition, it is definitely not
128     // through a stub.
129     if (!isDecl && !GV->isWeakForLinker())
130       return X86II::MO_NO_FLAG;
131
132     // Unless we have a symbol with hidden visibility, we have to go through a
133     // normal $non_lazy_ptr stub because this symbol might be resolved late.
134     if (!GV->hasHiddenVisibility())  // Non-hidden $non_lazy_ptr reference.
135       return X86II::MO_DARWIN_NONLAZY;
136
137     // Otherwise, no stub.
138     return X86II::MO_NO_FLAG;
139   }
140
141   // Direct static reference to global.
142   return X86II::MO_NO_FLAG;
143 }
144
145
146 /// getBZeroEntry - This function returns the name of a function which has an
147 /// interface like the non-standard bzero function, if such a function exists on
148 /// the current subtarget and it is considered prefereable over memset with zero
149 /// passed as the second argument. Otherwise it returns null.
150 const char *X86Subtarget::getBZeroEntry() const {
151   // Darwin 10 has a __bzero entry point for this purpose.
152   if (getTargetTriple().isMacOSX() &&
153       !getTargetTriple().isMacOSXVersionLT(10, 6))
154     return "__bzero";
155
156   return 0;
157 }
158
159 bool X86Subtarget::hasSinCos() const {
160   return getTargetTriple().isMacOSX() &&
161     !getTargetTriple().isMacOSXVersionLT(10, 9) &&
162     is64Bit();
163 }
164
165 /// IsLegalToCallImmediateAddr - Return true if the subtarget allows calls
166 /// to immediate address.
167 bool X86Subtarget::IsLegalToCallImmediateAddr(const TargetMachine &TM) const {
168   // FIXME: I386 PE/COFF supports PC relative calls using IMAGE_REL_I386_REL32
169   // but WinCOFFObjectWriter::RecordRelocation cannot emit them.  Once it does,
170   // the following check for Win32 should be removed.
171   if (In64BitMode || isTargetWin32())
172     return false;
173   return isTargetELF() || TM.getRelocationModel() == Reloc::Static;
174 }
175
176 static bool OSHasAVXSupport() {
177 #if defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86)\
178     || defined(__x86_64__) || defined(_M_AMD64) || defined (_M_X64)
179 #if defined(__GNUC__)
180   // Check xgetbv; this uses a .byte sequence instead of the instruction
181   // directly because older assemblers do not include support for xgetbv and
182   // there is no easy way to conditionally compile based on the assembler used.
183   int rEAX, rEDX;
184   __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (rEAX), "=d" (rEDX) : "c" (0));
185 #elif defined(_MSC_FULL_VER) && defined(_XCR_XFEATURE_ENABLED_MASK)
186   unsigned long long rEAX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
187 #else
188   int rEAX = 0; // Ensures we return false
189 #endif
190   return (rEAX & 6) == 6;
191 #else
192   return false;
193 #endif
194 }
195
196 void X86Subtarget::AutoDetectSubtargetFeatures() {
197   unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
198   unsigned MaxLevel;
199   union {
200     unsigned u[3];
201     char     c[12];
202   } text;
203
204   if (X86_MC::GetCpuIDAndInfo(0, &MaxLevel, text.u+0, text.u+2, text.u+1) ||
205       MaxLevel < 1)
206     return;
207
208   X86_MC::GetCpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX);
209
210   if ((EDX >> 15) & 1) { HasCMov = true;      ToggleFeature(X86::FeatureCMOV); }
211   if ((EDX >> 23) & 1) { X86SSELevel = MMX;   ToggleFeature(X86::FeatureMMX);  }
212   if ((EDX >> 25) & 1) { X86SSELevel = SSE1;  ToggleFeature(X86::FeatureSSE1); }
213   if ((EDX >> 26) & 1) { X86SSELevel = SSE2;  ToggleFeature(X86::FeatureSSE2); }
214   if (ECX & 0x1)       { X86SSELevel = SSE3;  ToggleFeature(X86::FeatureSSE3); }
215   if ((ECX >> 9)  & 1) { X86SSELevel = SSSE3; ToggleFeature(X86::FeatureSSSE3);}
216   if ((ECX >> 19) & 1) { X86SSELevel = SSE41; ToggleFeature(X86::FeatureSSE41);}
217   if ((ECX >> 20) & 1) { X86SSELevel = SSE42; ToggleFeature(X86::FeatureSSE42);}
218   if (((ECX >> 27) & 1) && ((ECX >> 28) & 1) && OSHasAVXSupport()) {
219     X86SSELevel = AVX;   ToggleFeature(X86::FeatureAVX);
220   }
221
222   bool IsIntel = memcmp(text.c, "GenuineIntel", 12) == 0;
223   bool IsAMD   = !IsIntel && memcmp(text.c, "AuthenticAMD", 12) == 0;
224
225   if ((ECX >> 1) & 0x1) {
226     HasPCLMUL = true;
227     ToggleFeature(X86::FeaturePCLMUL);
228   }
229   if ((ECX >> 12) & 0x1) {
230     HasFMA = true;
231     ToggleFeature(X86::FeatureFMA);
232   }
233   if (IsIntel && ((ECX >> 22) & 0x1)) {
234     HasMOVBE = true;
235     ToggleFeature(X86::FeatureMOVBE);
236   }
237   if ((ECX >> 23) & 0x1) {
238     HasPOPCNT = true;
239     ToggleFeature(X86::FeaturePOPCNT);
240   }
241   if ((ECX >> 25) & 0x1) {
242     HasAES = true;
243     ToggleFeature(X86::FeatureAES);
244   }
245   if ((ECX >> 29) & 0x1) {
246     HasF16C = true;
247     ToggleFeature(X86::FeatureF16C);
248   }
249   if (IsIntel && ((ECX >> 30) & 0x1)) {
250     HasRDRAND = true;
251     ToggleFeature(X86::FeatureRDRAND);
252   }
253
254   if ((ECX >> 13) & 0x1) {
255     HasCmpxchg16b = true;
256     ToggleFeature(X86::FeatureCMPXCHG16B);
257   }
258
259   if (IsIntel || IsAMD) {
260     // Determine if bit test memory instructions are slow.
261     unsigned Family = 0;
262     unsigned Model  = 0;
263     X86_MC::DetectFamilyModel(EAX, Family, Model);
264     if (IsAMD || (Family == 6 && Model >= 13)) {
265       IsBTMemSlow = true;
266       ToggleFeature(X86::FeatureSlowBTMem);
267     }
268
269     // Determine if SHLD/SHRD instructions have higher latency then the
270     // equivalent series of shifts/or instructions. 
271     // FIXME: Add Intel's processors that have SHLD instructions with very
272     // poor latency. 
273     if (IsAMD) {
274       IsSHLDSlow = true;
275       ToggleFeature(X86::FeatureSlowSHLD);
276     }
277
278     // If it's an Intel chip since Nehalem and not an Atom chip, unaligned
279     // memory access is fast. We hard code model numbers here because they
280     // aren't strictly increasing for Intel chips it seems.
281     if (IsIntel &&
282         ((Family == 6 && Model == 0x1E) || // Nehalem: Clarksfield, Lynnfield,
283                                            //          Jasper Froest
284          (Family == 6 && Model == 0x1A) || // Nehalem: Bloomfield, Nehalem-EP
285          (Family == 6 && Model == 0x2E) || // Nehalem: Nehalem-EX
286          (Family == 6 && Model == 0x25) || // Westmere: Arrandale, Clarksdale
287          (Family == 6 && Model == 0x2C) || // Westmere: Gulftown, Westmere-EP
288          (Family == 6 && Model == 0x2F) || // Westmere: Westmere-EX
289          (Family == 6 && Model == 0x2A) || // SandyBridge
290          (Family == 6 && Model == 0x2D) || // SandyBridge: SandyBridge-E*
291          (Family == 6 && Model == 0x3A) || // IvyBridge
292          (Family == 6 && Model == 0x3E) || // IvyBridge EP
293          (Family == 6 && Model == 0x3C) || // Haswell
294          (Family == 6 && Model == 0x3F) || // ...
295          (Family == 6 && Model == 0x45) || // ...
296          (Family == 6 && Model == 0x46))) { // ...
297       IsUAMemFast = true;
298       ToggleFeature(X86::FeatureFastUAMem);
299     }
300
301     // Set processor type. Currently only Atom or Silvermont (SLM) is detected.
302     if (Family == 6 &&
303         (Model == 28 || Model == 38 || Model == 39 ||
304          Model == 53 || Model == 54)) {
305       X86ProcFamily = IntelAtom;
306
307       UseLeaForSP = true;
308       ToggleFeature(X86::FeatureLeaForSP);
309     }
310     else if (Family == 6 &&
311         (Model == 55 || Model == 74 || Model == 77)) {
312       X86ProcFamily = IntelSLM;
313     }
314
315     unsigned MaxExtLevel;
316     X86_MC::GetCpuIDAndInfo(0x80000000, &MaxExtLevel, &EBX, &ECX, &EDX);
317
318     if (MaxExtLevel >= 0x80000001) {
319       X86_MC::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
320       if ((EDX >> 29) & 0x1) {
321         HasX86_64 = true;
322         ToggleFeature(X86::Feature64Bit);
323       }
324       if ((ECX >> 5) & 0x1) {
325         HasLZCNT = true;
326         ToggleFeature(X86::FeatureLZCNT);
327       }
328       if (IsIntel && ((ECX >> 8) & 0x1)) {
329         HasPRFCHW = true;
330         ToggleFeature(X86::FeaturePRFCHW);
331       }
332       if (IsAMD) {
333         if ((ECX >> 6) & 0x1) {
334           HasSSE4A = true;
335           ToggleFeature(X86::FeatureSSE4A);
336         }
337         if ((ECX >> 11) & 0x1) {
338           HasXOP = true;
339           ToggleFeature(X86::FeatureXOP);
340         }
341         if ((ECX >> 16) & 0x1) {
342           HasFMA4 = true;
343           ToggleFeature(X86::FeatureFMA4);
344         }
345       }
346     }
347   }
348
349   if (MaxLevel >= 7) {
350     if (!X86_MC::GetCpuIDAndInfoEx(0x7, 0x0, &EAX, &EBX, &ECX, &EDX)) {
351       if (IsIntel && (EBX & 0x1)) {
352         HasFSGSBase = true;
353         ToggleFeature(X86::FeatureFSGSBase);
354       }
355       if ((EBX >> 3) & 0x1) {
356         HasBMI = true;
357         ToggleFeature(X86::FeatureBMI);
358       }
359       if ((EBX >> 4) & 0x1) {
360         HasHLE = true;
361         ToggleFeature(X86::FeatureHLE);
362       }
363       if (IsIntel && ((EBX >> 5) & 0x1)) {
364         X86SSELevel = AVX2;
365         ToggleFeature(X86::FeatureAVX2);
366       }
367       if (IsIntel && ((EBX >> 8) & 0x1)) {
368         HasBMI2 = true;
369         ToggleFeature(X86::FeatureBMI2);
370       }
371       if (IsIntel && ((EBX >> 11) & 0x1)) {
372         HasRTM = true;
373         ToggleFeature(X86::FeatureRTM);
374       }
375       if (IsIntel && ((EBX >> 16) & 0x1)) {
376         X86SSELevel = AVX512F;
377         ToggleFeature(X86::FeatureAVX512);
378       }
379       if (IsIntel && ((EBX >> 18) & 0x1)) {
380         HasRDSEED = true;
381         ToggleFeature(X86::FeatureRDSEED);
382       }
383       if (IsIntel && ((EBX >> 19) & 0x1)) {
384         HasADX = true;
385         ToggleFeature(X86::FeatureADX);
386       }
387       if (IsIntel && ((EBX >> 26) & 0x1)) {
388         HasPFI = true;
389         ToggleFeature(X86::FeaturePFI);
390       }
391       if (IsIntel && ((EBX >> 27) & 0x1)) {
392         HasERI = true;
393         ToggleFeature(X86::FeatureERI);
394       }
395       if (IsIntel && ((EBX >> 28) & 0x1)) {
396         HasCDI = true;
397         ToggleFeature(X86::FeatureCDI);
398       }
399       if (IsIntel && ((EBX >> 29) & 0x1)) {
400         HasSHA = true;
401         ToggleFeature(X86::FeatureSHA);
402       }
403     }
404     if (IsAMD && ((ECX >> 21) & 0x1)) {
405       HasTBM = true;
406       ToggleFeature(X86::FeatureTBM);
407     }
408   }
409 }
410
411 void X86Subtarget::resetSubtargetFeatures(const MachineFunction *MF) {
412   AttributeSet FnAttrs = MF->getFunction()->getAttributes();
413   Attribute CPUAttr = FnAttrs.getAttribute(AttributeSet::FunctionIndex,
414                                            "target-cpu");
415   Attribute FSAttr = FnAttrs.getAttribute(AttributeSet::FunctionIndex,
416                                           "target-features");
417   std::string CPU =
418     !CPUAttr.hasAttribute(Attribute::None) ?CPUAttr.getValueAsString() : "";
419   std::string FS =
420     !FSAttr.hasAttribute(Attribute::None) ? FSAttr.getValueAsString() : "";
421   if (!FS.empty()) {
422     initializeEnvironment();
423     resetSubtargetFeatures(CPU, FS);
424   }
425 }
426
427 void X86Subtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) {
428   std::string CPUName = CPU;
429   if (!FS.empty() || !CPU.empty()) {
430     if (CPUName.empty()) {
431 #if defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86)\
432     || defined(__x86_64__) || defined(_M_AMD64) || defined (_M_X64)
433       CPUName = sys::getHostCPUName();
434 #else
435       CPUName = "generic";
436 #endif
437     }
438
439     // Make sure 64-bit features are available in 64-bit mode. (But make sure
440     // SSE2 can be turned off explicitly.)
441     std::string FullFS = FS;
442     if (In64BitMode) {
443       if (!FullFS.empty())
444         FullFS = "+64bit,+sse2," + FullFS;
445       else
446         FullFS = "+64bit,+sse2";
447     }
448
449     // If feature string is not empty, parse features string.
450     ParseSubtargetFeatures(CPUName, FullFS);
451   } else {
452     if (CPUName.empty()) {
453 #if defined (__x86_64__) || defined(__i386__)
454       CPUName = sys::getHostCPUName();
455 #else
456       CPUName = "generic";
457 #endif
458     }
459     // Otherwise, use CPUID to auto-detect feature set.
460     AutoDetectSubtargetFeatures();
461
462     // Make sure 64-bit features are available in 64-bit mode.
463     if (In64BitMode) {
464       if (!HasX86_64) { HasX86_64 = true; ToggleFeature(X86::Feature64Bit); }
465       if (!HasCMov)   { HasCMov   = true; ToggleFeature(X86::FeatureCMOV); }
466
467       if (X86SSELevel < SSE2) {
468         X86SSELevel = SSE2;
469         ToggleFeature(X86::FeatureSSE1);
470         ToggleFeature(X86::FeatureSSE2);
471       }
472     }
473   }
474
475   // CPUName may have been set by the CPU detection code. Make sure the
476   // new MCSchedModel is used.
477   InitCPUSchedModel(CPUName);
478
479   if (X86ProcFamily == IntelAtom || X86ProcFamily == IntelSLM)
480     PostRAScheduler = true;
481
482   InstrItins = getInstrItineraryForCPU(CPUName);
483
484   // It's important to keep the MCSubtargetInfo feature bits in sync with
485   // target data structure which is shared with MC code emitter, etc.
486   if (In64BitMode)
487     ToggleFeature(X86::Mode64Bit);
488   else if (In32BitMode)
489     ToggleFeature(X86::Mode32Bit);
490   else if (In16BitMode)
491     ToggleFeature(X86::Mode16Bit);
492   else
493     llvm_unreachable("Not 16-bit, 32-bit or 64-bit mode!");
494
495   DEBUG(dbgs() << "Subtarget features: SSELevel " << X86SSELevel
496                << ", 3DNowLevel " << X863DNowLevel
497                << ", 64bit " << HasX86_64 << "\n");
498   assert((!In64BitMode || HasX86_64) &&
499          "64-bit code requested on a subtarget that doesn't support it!");
500
501   // Stack alignment is 16 bytes on Darwin, Linux and Solaris (both
502   // 32 and 64 bit) and for all 64-bit targets.
503   if (StackAlignOverride)
504     stackAlignment = StackAlignOverride;
505   else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() ||
506            In64BitMode)
507     stackAlignment = 16;
508 }
509
510 void X86Subtarget::initializeEnvironment() {
511   X86SSELevel = NoMMXSSE;
512   X863DNowLevel = NoThreeDNow;
513   HasCMov = false;
514   HasX86_64 = false;
515   HasPOPCNT = false;
516   HasSSE4A = false;
517   HasAES = false;
518   HasPCLMUL = false;
519   HasFMA = false;
520   HasFMA4 = false;
521   HasXOP = false;
522   HasTBM = false;
523   HasMOVBE = false;
524   HasRDRAND = false;
525   HasF16C = false;
526   HasFSGSBase = false;
527   HasLZCNT = false;
528   HasBMI = false;
529   HasBMI2 = false;
530   HasRTM = false;
531   HasHLE = false;
532   HasERI = false;
533   HasCDI = false;
534   HasPFI = false;
535   HasADX = false;
536   HasSHA = false;
537   HasPRFCHW = false;
538   HasRDSEED = false;
539   IsBTMemSlow = false;
540   IsSHLDSlow = false;
541   IsUAMemFast = false;
542   HasVectorUAMem = false;
543   HasCmpxchg16b = false;
544   UseLeaForSP = false;
545   HasSlowDivide = false;
546   PostRAScheduler = false;
547   PadShortFunctions = false;
548   CallRegIndirect = false;
549   LEAUsesAG = false;
550   stackAlignment = 4;
551   // FIXME: this is a known good value for Yonah. How about others?
552   MaxInlineSizeThreshold = 128;
553 }
554
555 X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU,
556                            const std::string &FS,
557                            unsigned StackAlignOverride)
558   : X86GenSubtargetInfo(TT, CPU, FS)
559   , X86ProcFamily(Others)
560   , PICStyle(PICStyles::None)
561   , TargetTriple(TT)
562   , StackAlignOverride(StackAlignOverride)
563   , In64BitMode(TargetTriple.getArch() == Triple::x86_64)
564   , In32BitMode(TargetTriple.getArch() == Triple::x86 &&
565                 TargetTriple.getEnvironment() != Triple::CODE16)
566   , In16BitMode(TargetTriple.getArch() == Triple::x86 &&
567                 TargetTriple.getEnvironment() == Triple::CODE16) {
568   initializeEnvironment();
569   resetSubtargetFeatures(CPU, FS);
570 }
571
572 bool X86Subtarget::enablePostRAScheduler(
573            CodeGenOpt::Level OptLevel,
574            TargetSubtargetInfo::AntiDepBreakMode& Mode,
575            RegClassVector& CriticalPathRCs) const {
576   Mode = TargetSubtargetInfo::ANTIDEP_CRITICAL;
577   CriticalPathRCs.clear();
578   return PostRAScheduler && OptLevel >= CodeGenOpt::Default;
579 }