- // Compute active nodes, links and biases.
- prepareNodes(LiveBlocks);
-
- // Update all active nodes, and find the ones that are actually linked to
- // something so their value may change when iterating.
- DEBUG(dbgs() << "Network has " << RegBundles.count() << " active nodes:\n");
- SmallVector<unsigned, 8> Linked;
- for (int n = RegBundles.find_first(); n>=0; n = RegBundles.find_next(n)) {
- nodes[n].update(nodes);
- // A node that must spill, or a node without any links is not going to
- // change its value ever again, so exclude it from iterations.
- if (!nodes[n].Links.empty() && !nodes[n].mustSpill())
- Linked.push_back(n);
-
- DEBUG({
- dbgs() << " EB#" << n << format(" = %+2.0f", nodes[n].Value)
- << format(", Bias %+.2f", nodes[n].Bias)
- << format(", Freq %.1f/%.1f", nodes[n].Frequency[0],
- nodes[n].Frequency[1]);
- for (unsigned i = 0, e = nodes[n].Links.size(); i != e; ++i)
- dbgs() << format(", %.2f -> EB#%u", nodes[n].Links[i].first,
- nodes[n].Links[i].second);
- dbgs() << '\n';
- });
- }
-
- // Iterate the network to convergence.
- iterate(Linked);