Do not use stepCost when gathering sibling merge candidates

siblingPairFromRelatives gathers neighbours of a vertex, and sorts them.
It then takes the N best nodes, and creates sibling merge candidates
from them. We now use the unadjusted cost instead of the step cost of
the vertices when sorting. This is both faster as we need not do the
log-space rounding to compute stepCost, and will also make similar but
yet cheaper nodes appear closer to the front as we don't lose precision
in rounding, hence they are more likely to be entered as merge
candidates. Note that when creating the merge candidate, we still use
the stepCost, so it's purpose of reducing the propagation of critical
path updates is maintained in full. In summary, this should make both
Verilator and the generated model very slightly faster, at least in
theory, and I have observed minor improvement in places.
This commit is contained in:
Geza Lore 2022-08-09 16:08:41 +01:00
parent b436794773
commit f8a0389e73

View File

@ -1540,8 +1540,8 @@ private:
if (shortestPrereqs.size() <= 1) return;
const auto cmp = [way](const LogicMTask* ap, const LogicMTask* bp) {
const uint32_t aCp = ap->critPathCost(way) + ap->stepCost();
const uint32_t bCp = bp->critPathCost(way) + bp->stepCost();
const uint32_t aCp = ap->critPathCost(way) + ap->cost();
const uint32_t bCp = bp->critPathCost(way) + bp->cost();
if (aCp != bCp) return aCp < bCp;
return ap->id() < bp->id();
};