llvm.org GIT mirror llvm / 4492b0e
TableGen/CodeGenSchedule: Move some getAllDerivedDefinitions() calls out of inner loops This cuts the runtime of the two slowest tblgen invocations in aarch64 in half for me... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273235 91177308-0d34-0410-b5e6-96231b3b80d8 Matthias Braun 4 years ago
2 changed file(s) with 11 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
14281428
14291429 // Collect and sort WriteRes, ReadAdvance, and ProcResources.
14301430 void CodeGenSchedModels::collectProcResources() {
1431 ProcResourceDefs = Records.getAllDerivedDefinitions("ProcResourceUnits");
1432 ProcResGroups = Records.getAllDerivedDefinitions("ProcResGroup");
1433
14311434 // Add any subtarget-specific SchedReadWrites that are directly associated
14321435 // with processor resources. Refer to the parent SchedClass's ProcIndices to
14331436 // determine which processors they apply to.
15221525 dbgs() << '\n');
15231526 verifyProcResourceGroups(PM);
15241527 }
1528
1529 ProcResourceDefs.clear();
1530 ProcResGroups.clear();
15251531 }
15261532
15271533 void CodeGenSchedModels::checkCompleteness() {
16511657 return ProcResKind;
16521658
16531659 Record *ProcUnitDef = nullptr;
1654 RecVec ProcResourceDefs =
1655 Records.getAllDerivedDefinitions("ProcResourceUnits");
1660 assert(!ProcResourceDefs.empty());
1661 assert(!ProcResGroups.empty());
16561662
16571663 for (RecIter RI = ProcResourceDefs.begin(), RE = ProcResourceDefs.end();
16581664 RI != RE; ++RI) {
16671673 ProcUnitDef = *RI;
16681674 }
16691675 }
1670 RecVec ProcResGroups = Records.getAllDerivedDefinitions("ProcResGroup");
16711676 for (RecIter RI = ProcResGroups.begin(), RE = ProcResGroups.end();
16721677 RI != RE; ++RI) {
16731678
240240 // Any inferred SchedClass has an index greater than NumInstrSchedClassses.
241241 unsigned NumInstrSchedClasses;
242242
243 RecVec ProcResourceDefs;
244 RecVec ProcResGroups;
245
243246 // Map each instruction to its unique SchedClass index considering the
244247 // combination of it's itinerary class, SchedRW list, and InstRW records.
245248 typedef DenseMap InstClassMapTy;