Set up MCSchedModel after detecting the CPU type in X86SubTarget.
authorPreston Gurd <preston.gurd@intel.com>
Wed, 3 Oct 2012 15:55:13 +0000 (15:55 +0000)
committerPreston Gurd <preston.gurd@intel.com>
Wed, 3 Oct 2012 15:55:13 +0000 (15:55 +0000)
Corrects a problem whereby MCSchedModel was not being set up when
the CPU type was auto-detected.

Patch by Andy Zhang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165122 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86Subtarget.cpp

index 0d7b664e8e0997acb8b0cdce5242b3546a624d54..24b551d21ce7bc4afc9efbf5fe28d999170adda2 100644 (file)
@@ -401,6 +401,10 @@ X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU,
     }
   }
 
+  // CPUName may have been set by the CPU detection code. Make sure the
+  // new MCSchedModel is used.
+  InitMCProcessorInfo(CPUName, FS);
+
   if (X86ProcFamily == IntelAtom)
     PostRAScheduler = true;