1 //===-- X86TargetMachine.cpp - Define TargetMachine for the X86 -----------===//
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 defines the X86 specific subclass of TargetMachine.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "X86TargetMachine.h"
14 #include "MCTargetDesc/X86MCTargetDesc.h"
15 #include "TargetInfo/X86TargetInfo.h"
16 #include "X86.h"
17 #include "X86CallLowering.h"
18 #include "X86LegalizerInfo.h"
19 #include "X86MacroFusion.h"
20 #include "X86Subtarget.h"
21 #include "X86TargetObjectFile.h"
22 #include "X86TargetTransformInfo.h"
23 #include "llvm/ADT/Optional.h"
24 #include "llvm/ADT/STLExtras.h"
25 #include "llvm/ADT/SmallString.h"
26 #include "llvm/ADT/StringRef.h"
27 #include "llvm/ADT/Triple.h"
28 #include "llvm/Analysis/TargetTransformInfo.h"
29 #include "llvm/CodeGen/ExecutionDomainFix.h"
30 #include "llvm/CodeGen/GlobalISel/CallLowering.h"
31 #include "llvm/CodeGen/GlobalISel/IRTranslator.h"
32 #include "llvm/CodeGen/GlobalISel/InstructionSelect.h"
33 #include "llvm/CodeGen/GlobalISel/Legalizer.h"
34 #include "llvm/CodeGen/GlobalISel/RegBankSelect.h"
35 #include "llvm/CodeGen/MachineScheduler.h"
36 #include "llvm/CodeGen/Passes.h"
37 #include "llvm/CodeGen/TargetPassConfig.h"
38 #include "llvm/IR/Attributes.h"
39 #include "llvm/IR/DataLayout.h"
40 #include "llvm/IR/Function.h"
41 #include "llvm/MC/MCAsmInfo.h"
42 #include "llvm/Pass.h"
43 #include "llvm/Support/CodeGen.h"
44 #include "llvm/Support/CommandLine.h"
45 #include "llvm/Support/ErrorHandling.h"
46 #include "llvm/Support/TargetRegistry.h"
47 #include "llvm/Target/TargetLoweringObjectFile.h"
48 #include "llvm/Target/TargetOptions.h"
49 #include "llvm/Transforms/CFGuard.h"
50 #include <memory>
51 #include <string>
52 
53 using namespace llvm;
54 
55 static cl::opt<bool> EnableMachineCombinerPass("x86-machine-combiner",
56                                cl::desc("Enable the machine combiner pass"),
57                                cl::init(true), cl::Hidden);
58 
59 extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeX86Target() {
60   // Register the target.
61   RegisterTargetMachine<X86TargetMachine> X(getTheX86_32Target());
62   RegisterTargetMachine<X86TargetMachine> Y(getTheX86_64Target());
63 
64   PassRegistry &PR = *PassRegistry::getPassRegistry();
65   initializeX86LowerAMXIntrinsicsLegacyPassPass(PR);
66   initializeX86LowerAMXTypeLegacyPassPass(PR);
67   initializeGlobalISel(PR);
68   initializeWinEHStatePassPass(PR);
69   initializeFixupBWInstPassPass(PR);
70   initializeEvexToVexInstPassPass(PR);
71   initializeFixupLEAPassPass(PR);
72   initializeFPSPass(PR);
73   initializeX86FixupSetCCPassPass(PR);
74   initializeX86CallFrameOptimizationPass(PR);
75   initializeX86CmovConverterPassPass(PR);
76   initializeX86TileConfigPass(PR);
77   initializeX86LowerTileCopyPass(PR);
78   initializeX86ExpandPseudoPass(PR);
79   initializeX86ExecutionDomainFixPass(PR);
80   initializeX86DomainReassignmentPass(PR);
81   initializeX86AvoidSFBPassPass(PR);
82   initializeX86AvoidTrailingCallPassPass(PR);
83   initializeX86SpeculativeLoadHardeningPassPass(PR);
84   initializeX86SpeculativeExecutionSideEffectSuppressionPass(PR);
85   initializeX86FlagsCopyLoweringPassPass(PR);
86   initializeX86LoadValueInjectionLoadHardeningPassPass(PR);
87   initializeX86LoadValueInjectionRetHardeningPassPass(PR);
88   initializeX86OptimizeLEAPassPass(PR);
89   initializeX86PartialReductionPass(PR);
90   initializePseudoProbeInserterPass(PR);
91 }
92 
93 static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
94   if (TT.isOSBinFormatMachO()) {
95     if (TT.getArch() == Triple::x86_64)
96       return std::make_unique<X86_64MachoTargetObjectFile>();
97     return std::make_unique<TargetLoweringObjectFileMachO>();
98   }
99 
100   if (TT.isOSBinFormatCOFF())
101     return std::make_unique<TargetLoweringObjectFileCOFF>();
102   return std::make_unique<X86ELFTargetObjectFile>();
103 }
104 
105 static std::string computeDataLayout(const Triple &TT) {
106   // X86 is little endian
107   std::string Ret = "e";
108 
109   Ret += DataLayout::getManglingComponent(TT);
110   // X86 and x32 have 32 bit pointers.
111   if ((TT.isArch64Bit() &&
112        (TT.getEnvironment() == Triple::GNUX32 || TT.isOSNaCl())) ||
113       !TT.isArch64Bit())
114     Ret += "-p:32:32";
115 
116   // Address spaces for 32 bit signed, 32 bit unsigned, and 64 bit pointers.
117   Ret += "-p270:32:32-p271:32:32-p272:64:64";
118 
119   // Some ABIs align 64 bit integers and doubles to 64 bits, others to 32.
120   if (TT.isArch64Bit() || TT.isOSWindows() || TT.isOSNaCl())
121     Ret += "-i64:64";
122   else if (TT.isOSIAMCU())
123     Ret += "-i64:32-f64:32";
124   else
125     Ret += "-f64:32:64";
126 
127   // Some ABIs align long double to 128 bits, others to 32.
128   if (TT.isOSNaCl() || TT.isOSIAMCU())
129     ; // No f80
130   else if (TT.isArch64Bit() || TT.isOSDarwin())
131     Ret += "-f80:128";
132   else
133     Ret += "-f80:32";
134 
135   if (TT.isOSIAMCU())
136     Ret += "-f128:32";
137 
138   // The registers can hold 8, 16, 32 or, in x86-64, 64 bits.
139   if (TT.isArch64Bit())
140     Ret += "-n8:16:32:64";
141   else
142     Ret += "-n8:16:32";
143 
144   // The stack is aligned to 32 bits on some ABIs and 128 bits on others.
145   if ((!TT.isArch64Bit() && TT.isOSWindows()) || TT.isOSIAMCU())
146     Ret += "-a:0:32-S32";
147   else
148     Ret += "-S128";
149 
150   return Ret;
151 }
152 
153 static Reloc::Model getEffectiveRelocModel(const Triple &TT,
154                                            bool JIT,
155                                            Optional<Reloc::Model> RM) {
156   bool is64Bit = TT.getArch() == Triple::x86_64;
157   if (!RM.hasValue()) {
158     // JIT codegen should use static relocations by default, since it's
159     // typically executed in process and not relocatable.
160     if (JIT)
161       return Reloc::Static;
162 
163     // Darwin defaults to PIC in 64 bit mode and dynamic-no-pic in 32 bit mode.
164     // Win64 requires rip-rel addressing, thus we force it to PIC. Otherwise we
165     // use static relocation model by default.
166     if (TT.isOSDarwin()) {
167       if (is64Bit)
168         return Reloc::PIC_;
169       return Reloc::DynamicNoPIC;
170     }
171     if (TT.isOSWindows() && is64Bit)
172       return Reloc::PIC_;
173     return Reloc::Static;
174   }
175 
176   // ELF and X86-64 don't have a distinct DynamicNoPIC model.  DynamicNoPIC
177   // is defined as a model for code which may be used in static or dynamic
178   // executables but not necessarily a shared library. On X86-32 we just
179   // compile in -static mode, in x86-64 we use PIC.
180   if (*RM == Reloc::DynamicNoPIC) {
181     if (is64Bit)
182       return Reloc::PIC_;
183     if (!TT.isOSDarwin())
184       return Reloc::Static;
185   }
186 
187   // If we are on Darwin, disallow static relocation model in X86-64 mode, since
188   // the Mach-O file format doesn't support it.
189   if (*RM == Reloc::Static && TT.isOSDarwin() && is64Bit)
190     return Reloc::PIC_;
191 
192   return *RM;
193 }
194 
195 static CodeModel::Model getEffectiveX86CodeModel(Optional<CodeModel::Model> CM,
196                                                  bool JIT, bool Is64Bit) {
197   if (CM) {
198     if (*CM == CodeModel::Tiny)
199       report_fatal_error("Target does not support the tiny CodeModel", false);
200     return *CM;
201   }
202   if (JIT)
203     return Is64Bit ? CodeModel::Large : CodeModel::Small;
204   return CodeModel::Small;
205 }
206 
207 /// Create an X86 target.
208 ///
209 X86TargetMachine::X86TargetMachine(const Target &T, const Triple &TT,
210                                    StringRef CPU, StringRef FS,
211                                    const TargetOptions &Options,
212                                    Optional<Reloc::Model> RM,
213                                    Optional<CodeModel::Model> CM,
214                                    CodeGenOpt::Level OL, bool JIT)
215     : LLVMTargetMachine(
216           T, computeDataLayout(TT), TT, CPU, FS, Options,
217           getEffectiveRelocModel(TT, JIT, RM),
218           getEffectiveX86CodeModel(CM, JIT, TT.getArch() == Triple::x86_64),
219           OL),
220       TLOF(createTLOF(getTargetTriple())), IsJIT(JIT) {
221   // On PS4, the "return address" of a 'noreturn' call must still be within
222   // the calling function, and TrapUnreachable is an easy way to get that.
223   if (TT.isPS4() || TT.isOSBinFormatMachO()) {
224     this->Options.TrapUnreachable = true;
225     this->Options.NoTrapAfterNoreturn = TT.isOSBinFormatMachO();
226   }
227 
228   setMachineOutliner(true);
229 
230   // x86 supports the debug entry values.
231   setSupportsDebugEntryValues(true);
232 
233   initAsmInfo();
234 }
235 
236 X86TargetMachine::~X86TargetMachine() = default;
237 
238 const X86Subtarget *
239 X86TargetMachine::getSubtargetImpl(const Function &F) const {
240   Attribute CPUAttr = F.getFnAttribute("target-cpu");
241   Attribute TuneAttr = F.getFnAttribute("tune-cpu");
242   Attribute FSAttr = F.getFnAttribute("target-features");
243 
244   StringRef CPU =
245       CPUAttr.isValid() ? CPUAttr.getValueAsString() : (StringRef)TargetCPU;
246   StringRef TuneCPU =
247       TuneAttr.isValid() ? TuneAttr.getValueAsString() : (StringRef)CPU;
248   StringRef FS =
249       FSAttr.isValid() ? FSAttr.getValueAsString() : (StringRef)TargetFS;
250 
251   SmallString<512> Key;
252   // The additions here are ordered so that the definitely short strings are
253   // added first so we won't exceed the small size. We append the
254   // much longer FS string at the end so that we only heap allocate at most
255   // one time.
256 
257   // Extract prefer-vector-width attribute.
258   unsigned PreferVectorWidthOverride = 0;
259   Attribute PreferVecWidthAttr = F.getFnAttribute("prefer-vector-width");
260   if (PreferVecWidthAttr.isValid()) {
261     StringRef Val = PreferVecWidthAttr.getValueAsString();
262     unsigned Width;
263     if (!Val.getAsInteger(0, Width)) {
264       Key += 'p';
265       Key += Val;
266       PreferVectorWidthOverride = Width;
267     }
268   }
269 
270   // Extract min-legal-vector-width attribute.
271   unsigned RequiredVectorWidth = UINT32_MAX;
272   Attribute MinLegalVecWidthAttr = F.getFnAttribute("min-legal-vector-width");
273   if (MinLegalVecWidthAttr.isValid()) {
274     StringRef Val = MinLegalVecWidthAttr.getValueAsString();
275     unsigned Width;
276     if (!Val.getAsInteger(0, Width)) {
277       Key += 'm';
278       Key += Val;
279       RequiredVectorWidth = Width;
280     }
281   }
282 
283   // Add CPU to the Key.
284   Key += CPU;
285 
286   // Add tune CPU to the Key.
287   Key += TuneCPU;
288 
289   // Keep track of the start of the feature portion of the string.
290   unsigned FSStart = Key.size();
291 
292   // FIXME: This is related to the code below to reset the target options,
293   // we need to know whether or not the soft float flag is set on the
294   // function before we can generate a subtarget. We also need to use
295   // it as a key for the subtarget since that can be the only difference
296   // between two functions.
297   bool SoftFloat =
298       F.getFnAttribute("use-soft-float").getValueAsString() == "true";
299   // If the soft float attribute is set on the function turn on the soft float
300   // subtarget feature.
301   if (SoftFloat)
302     Key += FS.empty() ? "+soft-float" : "+soft-float,";
303 
304   Key += FS;
305 
306   // We may have added +soft-float to the features so move the StringRef to
307   // point to the full string in the Key.
308   FS = Key.substr(FSStart);
309 
310   auto &I = SubtargetMap[Key];
311   if (!I) {
312     // This needs to be done before we create a new subtarget since any
313     // creation will depend on the TM and the code generation flags on the
314     // function that reside in TargetOptions.
315     resetTargetOptions(F);
316     I = std::make_unique<X86Subtarget>(
317         TargetTriple, CPU, TuneCPU, FS, *this,
318         MaybeAlign(Options.StackAlignmentOverride), PreferVectorWidthOverride,
319         RequiredVectorWidth);
320   }
321   return I.get();
322 }
323 
324 bool X86TargetMachine::isNoopAddrSpaceCast(unsigned SrcAS,
325                                            unsigned DestAS) const {
326   assert(SrcAS != DestAS && "Expected different address spaces!");
327   if (getPointerSize(SrcAS) != getPointerSize(DestAS))
328     return false;
329   return SrcAS < 256 && DestAS < 256;
330 }
331 
332 //===----------------------------------------------------------------------===//
333 // X86 TTI query.
334 //===----------------------------------------------------------------------===//
335 
336 TargetTransformInfo
337 X86TargetMachine::getTargetTransformInfo(const Function &F) {
338   return TargetTransformInfo(X86TTIImpl(this, F));
339 }
340 
341 //===----------------------------------------------------------------------===//
342 // Pass Pipeline Configuration
343 //===----------------------------------------------------------------------===//
344 
345 namespace {
346 
347 /// X86 Code Generator Pass Configuration Options.
348 class X86PassConfig : public TargetPassConfig {
349 public:
350   X86PassConfig(X86TargetMachine &TM, PassManagerBase &PM)
351     : TargetPassConfig(TM, PM) {}
352 
353   X86TargetMachine &getX86TargetMachine() const {
354     return getTM<X86TargetMachine>();
355   }
356 
357   ScheduleDAGInstrs *
358   createMachineScheduler(MachineSchedContext *C) const override {
359     ScheduleDAGMILive *DAG = createGenericSchedLive(C);
360     DAG->addMutation(createX86MacroFusionDAGMutation());
361     return DAG;
362   }
363 
364   ScheduleDAGInstrs *
365   createPostMachineScheduler(MachineSchedContext *C) const override {
366     ScheduleDAGMI *DAG = createGenericSchedPostRA(C);
367     DAG->addMutation(createX86MacroFusionDAGMutation());
368     return DAG;
369   }
370 
371   void addIRPasses() override;
372   bool addInstSelector() override;
373   bool addIRTranslator() override;
374   bool addLegalizeMachineIR() override;
375   bool addRegBankSelect() override;
376   bool addGlobalInstructionSelect() override;
377   bool addILPOpts() override;
378   bool addPreISel() override;
379   void addMachineSSAOptimization() override;
380   void addPreRegAlloc() override;
381   void addPostRegAlloc() override;
382   void addPreEmitPass() override;
383   void addPreEmitPass2() override;
384   void addPreSched2() override;
385   bool addPreRewrite() override;
386 
387   std::unique_ptr<CSEConfigBase> getCSEConfig() const override;
388 };
389 
390 class X86ExecutionDomainFix : public ExecutionDomainFix {
391 public:
392   static char ID;
393   X86ExecutionDomainFix() : ExecutionDomainFix(ID, X86::VR128XRegClass) {}
394   StringRef getPassName() const override {
395     return "X86 Execution Dependency Fix";
396   }
397 };
398 char X86ExecutionDomainFix::ID;
399 
400 } // end anonymous namespace
401 
402 INITIALIZE_PASS_BEGIN(X86ExecutionDomainFix, "x86-execution-domain-fix",
403   "X86 Execution Domain Fix", false, false)
404 INITIALIZE_PASS_DEPENDENCY(ReachingDefAnalysis)
405 INITIALIZE_PASS_END(X86ExecutionDomainFix, "x86-execution-domain-fix",
406   "X86 Execution Domain Fix", false, false)
407 
408 TargetPassConfig *X86TargetMachine::createPassConfig(PassManagerBase &PM) {
409   return new X86PassConfig(*this, PM);
410 }
411 
412 void X86PassConfig::addIRPasses() {
413   addPass(createAtomicExpandPass());
414 
415   // We add both pass anyway and when these two passes run, we skip the pass
416   // based on the option level and option attribute.
417   addPass(createX86LowerAMXIntrinsicsPass());
418   addPass(createX86LowerAMXTypePass());
419 
420   TargetPassConfig::addIRPasses();
421 
422   if (TM->getOptLevel() != CodeGenOpt::None) {
423     addPass(createInterleavedAccessPass());
424     addPass(createX86PartialReductionPass());
425   }
426 
427   // Add passes that handle indirect branch removal and insertion of a retpoline
428   // thunk. These will be a no-op unless a function subtarget has the retpoline
429   // feature enabled.
430   addPass(createIndirectBrExpandPass());
431 
432   // Add Control Flow Guard checks.
433   const Triple &TT = TM->getTargetTriple();
434   if (TT.isOSWindows()) {
435     if (TT.getArch() == Triple::x86_64) {
436       addPass(createCFGuardDispatchPass());
437     } else {
438       addPass(createCFGuardCheckPass());
439     }
440   }
441 }
442 
443 bool X86PassConfig::addInstSelector() {
444   // Install an instruction selector.
445   addPass(createX86ISelDag(getX86TargetMachine(), getOptLevel()));
446 
447   // For ELF, cleanup any local-dynamic TLS accesses.
448   if (TM->getTargetTriple().isOSBinFormatELF() &&
449       getOptLevel() != CodeGenOpt::None)
450     addPass(createCleanupLocalDynamicTLSPass());
451 
452   addPass(createX86GlobalBaseRegPass());
453   return false;
454 }
455 
456 bool X86PassConfig::addIRTranslator() {
457   addPass(new IRTranslator(getOptLevel()));
458   return false;
459 }
460 
461 bool X86PassConfig::addLegalizeMachineIR() {
462   addPass(new Legalizer());
463   return false;
464 }
465 
466 bool X86PassConfig::addRegBankSelect() {
467   addPass(new RegBankSelect());
468   return false;
469 }
470 
471 bool X86PassConfig::addGlobalInstructionSelect() {
472   addPass(new InstructionSelect(getOptLevel()));
473   return false;
474 }
475 
476 bool X86PassConfig::addILPOpts() {
477   addPass(&EarlyIfConverterID);
478   if (EnableMachineCombinerPass)
479     addPass(&MachineCombinerID);
480   addPass(createX86CmovConverterPass());
481   return true;
482 }
483 
484 bool X86PassConfig::addPreISel() {
485   // Only add this pass for 32-bit x86 Windows.
486   const Triple &TT = TM->getTargetTriple();
487   if (TT.isOSWindows() && TT.getArch() == Triple::x86)
488     addPass(createX86WinEHStatePass());
489   return true;
490 }
491 
492 void X86PassConfig::addPreRegAlloc() {
493   if (getOptLevel() != CodeGenOpt::None) {
494     addPass(&LiveRangeShrinkID);
495     addPass(createX86FixupSetCC());
496     addPass(createX86OptimizeLEAs());
497     addPass(createX86CallFrameOptimization());
498     addPass(createX86AvoidStoreForwardingBlocks());
499   }
500 
501   addPass(createX86SpeculativeLoadHardeningPass());
502   addPass(createX86FlagsCopyLoweringPass());
503   addPass(createX86WinAllocaExpander());
504 
505   if (getOptLevel() != CodeGenOpt::None) {
506     addPass(createX86PreTileConfigPass());
507   }
508 }
509 
510 void X86PassConfig::addMachineSSAOptimization() {
511   addPass(createX86DomainReassignmentPass());
512   TargetPassConfig::addMachineSSAOptimization();
513 }
514 
515 void X86PassConfig::addPostRegAlloc() {
516   addPass(createX86LowerTileCopyPass());
517   addPass(createX86FloatingPointStackifierPass());
518   // When -O0 is enabled, the Load Value Injection Hardening pass will fall back
519   // to using the Speculative Execution Side Effect Suppression pass for
520   // mitigation. This is to prevent slow downs due to
521   // analyses needed by the LVIHardening pass when compiling at -O0.
522   if (getOptLevel() != CodeGenOpt::None)
523     addPass(createX86LoadValueInjectionLoadHardeningPass());
524 }
525 
526 void X86PassConfig::addPreSched2() { addPass(createX86ExpandPseudoPass()); }
527 
528 void X86PassConfig::addPreEmitPass() {
529   if (getOptLevel() != CodeGenOpt::None) {
530     addPass(new X86ExecutionDomainFix());
531     addPass(createBreakFalseDeps());
532   }
533 
534   addPass(createX86IndirectBranchTrackingPass());
535 
536   addPass(createX86IssueVZeroUpperPass());
537 
538   if (getOptLevel() != CodeGenOpt::None) {
539     addPass(createX86FixupBWInsts());
540     addPass(createX86PadShortFunctions());
541     addPass(createX86FixupLEAs());
542   }
543   addPass(createX86EvexToVexInsts());
544   addPass(createX86DiscriminateMemOpsPass());
545   addPass(createX86InsertPrefetchPass());
546   addPass(createX86InsertX87waitPass());
547 }
548 
549 void X86PassConfig::addPreEmitPass2() {
550   const Triple &TT = TM->getTargetTriple();
551   const MCAsmInfo *MAI = TM->getMCAsmInfo();
552 
553   // The X86 Speculative Execution Pass must run after all control
554   // flow graph modifying passes. As a result it was listed to run right before
555   // the X86 Retpoline Thunks pass. The reason it must run after control flow
556   // graph modifications is that the model of LFENCE in LLVM has to be updated
557   // (FIXME: https://bugs.llvm.org/show_bug.cgi?id=45167). Currently the
558   // placement of this pass was hand checked to ensure that the subsequent
559   // passes don't move the code around the LFENCEs in a way that will hurt the
560   // correctness of this pass. This placement has been shown to work based on
561   // hand inspection of the codegen output.
562   addPass(createX86SpeculativeExecutionSideEffectSuppression());
563   addPass(createX86IndirectThunksPass());
564 
565   // Insert extra int3 instructions after trailing call instructions to avoid
566   // issues in the unwinder.
567   if (TT.isOSWindows() && TT.getArch() == Triple::x86_64)
568     addPass(createX86AvoidTrailingCallPass());
569 
570   // Verify basic block incoming and outgoing cfa offset and register values and
571   // correct CFA calculation rule where needed by inserting appropriate CFI
572   // instructions.
573   if (!TT.isOSDarwin() &&
574       (!TT.isOSWindows() ||
575        MAI->getExceptionHandlingType() == ExceptionHandling::DwarfCFI))
576     addPass(createCFIInstrInserter());
577 
578   if (TT.isOSWindows()) {
579     // Identify valid longjmp targets for Windows Control Flow Guard.
580     addPass(createCFGuardLongjmpPass());
581     // Identify valid eh continuation targets for Windows EHCont Guard.
582     addPass(createEHContGuardCatchretPass());
583   }
584   addPass(createX86LoadValueInjectionRetHardeningPass());
585 }
586 
587 bool X86PassConfig::addPreRewrite() {
588   addPass(createX86TileConfigPass());
589   return true;
590 }
591 
592 std::unique_ptr<CSEConfigBase> X86PassConfig::getCSEConfig() const {
593   return getStandardCSEConfigForOpt(TM->getOptLevel());
594 }
595