MC: Remove MCSubtargetInfo::InitCPUSched()
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 10 Jul 2015 22:33:01 +0000 (22:33 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 10 Jul 2015 22:33:01 +0000 (22:33 +0000)
Remove all calls to `MCSubtargetInfo::InitCPUSched()` and merge its body
into the only relevant caller, `MCSubtargetInfo::InitMCProcessorInfo()`.
We were only calling the former after explicitly calling the latter with
the same CPU; it's confusing to have both methods exposed.

Besides a minor (surely unmeasurable) speedup in ARM and X86 from
avoiding running the logic twice, no functionality change.

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

include/llvm/MC/MCSubtargetInfo.h
lib/MC/MCSubtargetInfo.cpp
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
lib/Target/X86/X86Subtarget.cpp

index cfc7da4d8fb7a200e7e7dc76c2ae77e636947e10..89110ff44b4ef51dc3303386ecf1dd6c2187c145 100644 (file)
@@ -78,9 +78,6 @@ public:
   /// feature string). Recompute feature bits and scheduling model.
   void InitMCProcessorInfo(StringRef CPU, StringRef FS);
 
-  /// InitCPUSchedModel - Recompute scheduling model based on CPU.
-  void InitCPUSchedModel(StringRef CPU);
-
   /// ToggleFeature - Toggle a feature and returns the re-computed feature
   /// bits. This version does not change the implied bits.
   FeatureBitset ToggleFeature(uint64_t FB);
index 414512a3a2cb7618e6d27198705a8c0f17b249c8..387d5cd05d0ccf806a7a9f1d393dbc247f8d4bc2 100644 (file)
@@ -23,11 +23,6 @@ void
 MCSubtargetInfo::InitMCProcessorInfo(StringRef CPU, StringRef FS) {
   SubtargetFeatures Features(FS);
   FeatureBits = Features.getFeatureBits(CPU, ProcDesc, ProcFeatures);
-  InitCPUSchedModel(CPU);
-}
-
-void
-MCSubtargetInfo::InitCPUSchedModel(StringRef CPU) {
   if (!CPU.empty())
     CPUSchedModel = &getSchedModelForCPU(CPU);
   else
index 88b06f7b9386a4a9a7a69541b29ea788cbb4e651..074c485023a465a695edc1ddacfc4e29f3038b3a 100644 (file)
@@ -9213,7 +9213,6 @@ bool ARMAsmParser::parseDirectiveCPU(SMLoc L) {
   }
 
   STI.InitMCProcessorInfo(CPU, "");
-  STI.InitCPUSchedModel(CPU);
   setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits()));
 
   return false;
index 758d2b02df38e879cf265fad90c010d9b09e8532..dff3624b7efe987b30eb069e06f3dbd4863ce89b 100644 (file)
@@ -192,12 +192,9 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
       FullFS = "+64bit,+sse2";
   }
 
-  // If feature string is not empty, parse features string.
+  // Parse features string and set the CPU.
   ParseSubtargetFeatures(CPUName, FullFS);
 
-  // Make sure the right MCSchedModel is used.
-  InitCPUSchedModel(CPUName);
-
   InstrItins = getInstrItineraryForCPU(CPUName);
 
   // It's important to keep the MCSubtargetInfo feature bits in sync with