llvm.org GIT mirror llvm / 5733fd1
MC: Remove MCSubtargetInfo::InitCPUSched() 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 Duncan P. N. Exon Smith 5 years ago
4 changed file(s) with 1 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
7676 /// InitMCProcessorInfo - Set or change the CPU (optionally supplemented with
7777 /// feature string). Recompute feature bits and scheduling model.
7878 void InitMCProcessorInfo(StringRef CPU, StringRef FS);
79
80 /// InitCPUSchedModel - Recompute scheduling model based on CPU.
81 void InitCPUSchedModel(StringRef CPU);
8279
8380 /// ToggleFeature - Toggle a feature and returns the re-computed feature
8481 /// bits. This version does not change the implied bits.
2222 MCSubtargetInfo::InitMCProcessorInfo(StringRef CPU, StringRef FS) {
2323 SubtargetFeatures Features(FS);
2424 FeatureBits = Features.getFeatureBits(CPU, ProcDesc, ProcFeatures);
25 InitCPUSchedModel(CPU);
26 }
27
28 void
29 MCSubtargetInfo::InitCPUSchedModel(StringRef CPU) {
3025 if (!CPU.empty())
3126 CPUSchedModel = &getSchedModelForCPU(CPU);
3227 else
92129212 }
92139213
92149214 STI.InitMCProcessorInfo(CPU, "");
9215 STI.InitCPUSchedModel(CPU);
92169215 setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits()));
92179216
92189217 return false;
191191 FullFS = "+64bit,+sse2";
192192 }
193193
194 // If feature string is not empty, parse features string.
194 // Parse features string and set the CPU.
195195 ParseSubtargetFeatures(CPUName, FullFS);
196
197 // Make sure the right MCSchedModel is used.
198 InitCPUSchedModel(CPUName);
199196
200197 InstrItins = getInstrItineraryForCPU(CPUName);
201198