diff options
author | Andrew Trick <atrick@apple.com> | 2012-07-09 20:43:03 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-07-09 20:43:03 +0000 |
commit | cb94192ff01fabdd492e9b229683e5d98aa2099f (patch) | |
tree | 5b90fd66a3683bf7f84d1b59b11320f7bf03d6b1 /utils/TableGen | |
parent | 70cb1778b90bb21ff8d86cd094797b9e8d3613fd (diff) | |
download | external_llvm-cb94192ff01fabdd492e9b229683e5d98aa2099f.zip external_llvm-cb94192ff01fabdd492e9b229683e5d98aa2099f.tar.gz external_llvm-cb94192ff01fabdd492e9b229683e5d98aa2099f.tar.bz2 |
Machine model: allow itineraries to be shared by different processor models.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159959 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/SubtargetEmitter.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/TableGen/SubtargetEmitter.cpp b/utils/TableGen/SubtargetEmitter.cpp index 48dbdc2..39055c0 100644 --- a/utils/TableGen/SubtargetEmitter.cpp +++ b/utils/TableGen/SubtargetEmitter.cpp @@ -336,10 +336,16 @@ EmitStageAndOperandCycleData(raw_ostream &OS, std::vector<std::vector<InstrItinerary> > &ProcItinLists) { + // Multiple processor models may share an itinerary record. Emit it once. + SmallPtrSet<Record*, 8> ItinsDefSet; + // Emit functional units for all the itineraries. for (CodeGenSchedModels::ProcIter PI = SchedModels.procModelBegin(), PE = SchedModels.procModelEnd(); PI != PE; ++PI) { + if (!ItinsDefSet.insert(PI->ItinsDef)) + continue; + std::vector<Record*> FUs = PI->ItinsDef->getValueAsListOfDefs("FU"); if (FUs.empty()) continue; @@ -508,12 +514,18 @@ void SubtargetEmitter:: EmitItineraries(raw_ostream &OS, std::vector<std::vector<InstrItinerary> > &ProcItinLists) { + // Multiple processor models may share an itinerary record. Emit it once. + SmallPtrSet<Record*, 8> ItinsDefSet; + // For each processor's machine model std::vector<std::vector<InstrItinerary> >::iterator ProcItinListsIter = ProcItinLists.begin(); for (CodeGenSchedModels::ProcIter PI = SchedModels.procModelBegin(), PE = SchedModels.procModelEnd(); PI != PE; ++PI) { + Record *ItinsDef = PI->ItinsDef; + if (!ItinsDefSet.insert(ItinsDef)) + continue; // Get processor itinerary name const std::string &Name = ItinsDef->getName(); |