diff options
author | Simon Dardis <simon.dardis@imgtec.com> | 2016-06-24 08:43:27 +0000 |
---|---|---|
committer | Simon Dardis <simon.dardis@imgtec.com> | 2016-06-24 08:43:27 +0000 |
commit | 5f95c9af8d284c04476b03d1f77490e3cdd19e1a (patch) | |
tree | 5bc233036c40b58f579483b9a62d21dafb849aca /llvm/utils/TableGen/CodeGenSchedule.cpp | |
parent | 86de486d3129f8d3bc05e3241c06f374252ac776 (diff) | |
download | bcm5719-llvm-5f95c9af8d284c04476b03d1f77490e3cdd19e1a.tar.gz bcm5719-llvm-5f95c9af8d284c04476b03d1f77490e3cdd19e1a.zip |
Revert "Revert "[misched] Extend scheduler to handle unsupported features""
This reverts commit r273565.
This was an over-eager revert.
llvm-svn: 273658
Diffstat (limited to 'llvm/utils/TableGen/CodeGenSchedule.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenSchedule.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeGenSchedule.cpp b/llvm/utils/TableGen/CodeGenSchedule.cpp index 57a426bffb3..d1b141e3160 100644 --- a/llvm/utils/TableGen/CodeGenSchedule.cpp +++ b/llvm/utils/TableGen/CodeGenSchedule.cpp @@ -120,6 +120,10 @@ CodeGenSchedModels::CodeGenSchedModels(RecordKeeper &RK, // (For per-operand resources mapped to itinerary classes). collectProcItinRW(); + // Find UnsupportedFeatures records for each processor. + // (For per-operand resources mapped to itinerary classes). + collectProcUnsupportedFeatures(); + // Infer new SchedClasses from SchedVariant. inferSchedClasses(); @@ -829,6 +833,15 @@ void CodeGenSchedModels::collectProcItinRW() { } } +// Gather the unsupported features for processor models. +void CodeGenSchedModels::collectProcUnsupportedFeatures() { + for (CodeGenProcModel &ProcModel : ProcModels) { + for (Record *Pred : ProcModel.ModelDef->getValueAsListOfDefs("UnsupportedFeatures")) { + ProcModel.UnsupportedFeaturesDefs.push_back(Pred); + } + } +} + /// Infer new classes from existing classes. In the process, this may create new /// SchedWrites from sequences of existing SchedWrites. void CodeGenSchedModels::inferSchedClasses() { @@ -1540,6 +1553,8 @@ void CodeGenSchedModels::checkCompleteness() { for (const CodeGenInstruction *Inst : Target.getInstructionsByEnumValue()) { if (Inst->hasNoSchedulingInfo) continue; + if (ProcModel.isUnsupported(*Inst)) + continue; unsigned SCIdx = getSchedClassIdx(*Inst); if (!SCIdx) { if (Inst->TheDef->isValueUnset("SchedRW") && !HadCompleteModel) { @@ -1575,7 +1590,10 @@ void CodeGenSchedModels::checkCompleteness() { << "- Consider setting 'CompleteModel = 0' while developing new models.\n" << "- Pseudo instructions can be marked with 'hasNoSchedulingInfo = 1'.\n" << "- Instructions should usually have Sched<[...]> as a superclass, " - "you may temporarily use an empty list.\n\n"; + "you may temporarily use an empty list.\n" + << "- Instructions related to unsupported features can be excluded with " + "list<Predicate> UnsupportedFeatures = [HasA,..,HasY]; in the " + "processor model.\n\n"; PrintFatalError("Incomplete schedule model"); } } @@ -1756,6 +1774,16 @@ unsigned CodeGenProcModel::getProcResourceIdx(Record *PRDef) const { return 1 + (PRPos - ProcResourceDefs.begin()); } +bool CodeGenProcModel::isUnsupported(const CodeGenInstruction &Inst) const { + for (const Record *TheDef : UnsupportedFeaturesDefs) { + for (const Record *PredDef : Inst.TheDef->getValueAsListOfDefs("Predicates")) { + if (TheDef->getName() == PredDef->getName()) + return true; + } + } + return false; +} + #ifndef NDEBUG void CodeGenProcModel::dump() const { dbgs() << Index << ": " << ModelName << " " |