diff --git a/passes/opt/opt_prienc.cc b/passes/opt/opt_prienc.cc index e7c4a966c..7231db45e 100644 --- a/passes/opt/opt_prienc.cc +++ b/passes/opt/opt_prienc.cc @@ -782,7 +782,6 @@ struct OptPriEncWorker { std::sort(req_cands.begin(), req_cands.end(), [](Wire* a, Wire* b) { return a->width > b->width; }); - int pairs = 0; bool matched = false; for (Wire* req_wire : req_cands) { if (matched) break; @@ -791,6 +790,10 @@ struct OptPriEncWorker { pool req_bits; for (auto bit : req_sig) if (bit.wire) req_bits.insert(bit); + // Per-req_wire fingerprint budget: a start-candidate-heavy + // first req size must not exhaust a shared budget and starve + // later (narrower) req sizes. + int pairs = 0; for (Wire* start_wire : start_cands) { if (start_wire == req_wire) continue; if (++pairs > max_pairs) break;