forked from OSchip/llvm-project
Replaced ReInitMCSubtargetInfo with InitMCProcessor.
Now where we used to call ReInitMCSubtargetInfo, we actually recompute the same information as InitMCSubtargetInfo instead of only setting the feature bits. llvm-svn: 164105
This commit is contained in:
parent
8760caf1f3
commit
ba7b921fcb
|
@ -68,9 +68,9 @@ public:
|
|||
return FeatureBits;
|
||||
}
|
||||
|
||||
/// ReInitMCSubtargetInfo - Change CPU (and optionally supplemented with
|
||||
/// feature string), recompute and return feature bits.
|
||||
uint64_t ReInitMCSubtargetInfo(StringRef CPU, StringRef FS);
|
||||
/// InitMCProcessorInfo - Set or change the CPU (optionally supplemented with
|
||||
/// feature string). Recompute feature bits and scheduling model.
|
||||
void InitMCProcessorInfo(StringRef CPU, StringRef FS);
|
||||
|
||||
/// ToggleFeature - Toggle a feature and returns the re-computed feature
|
||||
/// bits. This version does not change the implied bits.
|
||||
|
|
|
@ -19,6 +19,20 @@ using namespace llvm;
|
|||
|
||||
MCSchedModel MCSchedModel::DefaultSchedModel; // For unknown processors.
|
||||
|
||||
/// ReInitMCSubtargetInfo - Set or change the CPU (optionally supplemented
|
||||
/// with feature string). Recompute feature bits and scheduling model.
|
||||
void
|
||||
MCSubtargetInfo::InitMCProcessorInfo(StringRef CPU, StringRef FS) {
|
||||
SubtargetFeatures Features(FS);
|
||||
FeatureBits = Features.getFeatureBits(CPU, ProcDesc, NumProcs,
|
||||
ProcFeatures, NumFeatures);
|
||||
|
||||
if (!CPU.empty())
|
||||
CPUSchedModel = getSchedModelForCPU(CPU);
|
||||
else
|
||||
CPUSchedModel = &MCSchedModel::DefaultSchedModel;
|
||||
}
|
||||
|
||||
void
|
||||
MCSubtargetInfo::InitMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS,
|
||||
const SubtargetFeatureKV *PF,
|
||||
|
@ -45,20 +59,7 @@ MCSubtargetInfo::InitMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS,
|
|||
NumFeatures = NF;
|
||||
NumProcs = NP;
|
||||
|
||||
SubtargetFeatures Features(FS);
|
||||
FeatureBits = Features.getFeatureBits(CPU, ProcDesc, NumProcs,
|
||||
ProcFeatures, NumFeatures);
|
||||
|
||||
CPUSchedModel = getSchedModelForCPU(CPU);
|
||||
}
|
||||
|
||||
/// ReInitMCSubtargetInfo - Change CPU (and optionally supplemented with
|
||||
/// feature string) and recompute feature bits.
|
||||
uint64_t MCSubtargetInfo::ReInitMCSubtargetInfo(StringRef CPU, StringRef FS) {
|
||||
SubtargetFeatures Features(FS);
|
||||
FeatureBits = Features.getFeatureBits(CPU, ProcDesc, NumProcs,
|
||||
ProcFeatures, NumFeatures);
|
||||
return FeatureBits;
|
||||
InitMCProcessorInfo(CPU, FS);
|
||||
}
|
||||
|
||||
/// ToggleFeature - Toggle a feature and returns the re-computed feature
|
||||
|
|
|
@ -1213,7 +1213,8 @@ void SubtargetEmitter::ParseFeaturesFunction(raw_ostream &OS,
|
|||
return;
|
||||
}
|
||||
|
||||
OS << " uint64_t Bits = ReInitMCSubtargetInfo(CPU, FS);\n";
|
||||
OS << " InitMCProcessorInfo(CPU, FS);\n"
|
||||
<< " uint64_t Bits = getFeatureBits();\n";
|
||||
|
||||
for (unsigned i = 0; i < Features.size(); i++) {
|
||||
// Next record
|
||||
|
|
Loading…
Reference in New Issue