From 7539c7372dd2bee48941da75f82355c15d0a262f Mon Sep 17 00:00:00 2001 From: James Cherry Date: Thu, 23 Oct 2025 08:56:22 -0700 Subject: [PATCH] Sta::vertexSlack(endpoint) speedup Signed-off-by: James Cherry --- search/Search.cc | 3 ++- search/Sta.cc | 40 +++++++++++++++++++++++----------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/search/Search.cc b/search/Search.cc index 812c98d9..6cbb5a74 100644 --- a/search/Search.cc +++ b/search/Search.cc @@ -1074,7 +1074,8 @@ Search::findArrivals1(Level level) Stats stats(debug_, report_); int arrival_count = arrival_iter_->visitParallel(level, arrival_visitor_); deleteTagsPrev(); - deleteUnusedTagGroups(); + if (arrival_count > 0) + deleteUnusedTagGroups(); stats.report("Find arrivals"); if (arrival_iter_->empty() && invalid_arrivals_->empty()) { diff --git a/search/Sta.cc b/search/Sta.cc index 8a1d962a..8468d19e 100644 --- a/search/Sta.cc +++ b/search/Sta.cc @@ -3196,24 +3196,30 @@ Sta::findRequired(Vertex *vertex) { searchPreamble(); search_->findAllArrivals(); - search_->findRequireds(vertex->level()); - if (variables_->crprEnabled() - && search_->crprPathPruningEnabled() - && !search_->crprApproxMissingRequireds() - // Clocks invariably have requireds that are pruned but it isn't - // worth finding arrivals and requireds all over again for - // the entire fanout of the clock. - && !search_->isClock(vertex)) { - // Invalidate arrivals and requireds and disable - // path pruning on fanout vertices with DFS. - int fanout = 0; - disableFanoutCrprPruning(vertex, fanout); - debugPrint(debug_, "search", 1, "resurrect pruned required %s fanout %d", - vertex->to_string(this).c_str(), - fanout); - // Find fanout arrivals and requireds with pruning disabled. - search_->findArrivals(); + if (search_->isEndpoint(vertex) + // Need to include downstream required times if there is fanout. + && !hasFanout(vertex, search_->searchAdj(), graph_)) + search_->seedRequired(vertex); + else { search_->findRequireds(vertex->level()); + if (variables_->crprEnabled() + && search_->crprPathPruningEnabled() + && !search_->crprApproxMissingRequireds() + // Clocks invariably have requireds that are pruned but it isn't + // worth finding arrivals and requireds all over again for + // the entire fanout of the clock. + && !search_->isClock(vertex)) { + // Invalidate arrivals and requireds and disable + // path pruning on fanout vertices with DFS. + int fanout = 0; + disableFanoutCrprPruning(vertex, fanout); + debugPrint(debug_, "search", 1, "resurrect pruned required %s fanout %d", + vertex->to_string(this).c_str(), + fanout); + // Find fanout arrivals and requireds with pruning disabled. + search_->findArrivals(); + search_->findRequireds(vertex->level()); + } } }