[X86][Haswell][SchedModel] Add architecture specific scheduling models.
[oota-llvm.git] / lib / CodeGen / CodeGenPrepare.cpp
index 8b1c3ad8eabe51b52fc2cba9f911edf4c54b07c2..948fddc6ed8d766bd7eeb473d399a22144cd5f9b 100644 (file)
@@ -168,7 +168,8 @@ bool CodeGenPrepare::runOnFunction(Function &F) {
   PromotedInsts.clear();
 
   ModifiedDT = false;
-  if (TM) TLI = TM->getTargetLowering();
+  if (TM)
+    TLI = TM->getSubtargetImpl()->getTargetLowering();
   TLInfo = &getAnalysis<TargetLibraryInfo>();
   DominatorTreeWrapperPass *DTWP =
       getAnalysisIfAvailable<DominatorTreeWrapperPass>();