// Collapse/Unionize nodes in a SCC to a single node
// For every SCC found, create a loop descriptor and link it in.
//
if ((nodePool.size() > 0) || (type[w] == BasicBlockClass.BB_SELF)) {
SimpleLoop loop = lsg.createNewLoop();
loop.setHeader(nodeW);
loop.setIsReducible(type[w] != BasicBlockClass.BB_IRREDUCIBLE);
// At this point, one can set attributes to the loop, such as:
//
// the bottom node:
// iter = backPreds[w].begin();
// loop bottom is: nodes[iter].node);
//
// the number of backedges:
// backPreds[w].size()
//
// whether this loop is reducible:
// type[w] != BasicBlockClass.BB_IRREDUCIBLE
//
nodes[w].setLoop(loop);
for (UnionFindNode node : nodePool) {
// Add nodes to loop descriptor.
header[node.getDfsNumber()] = w;
node.union(nodes[w]);
// Nested loops are not added, but linked together.
if (node.getLoop() != null) {
node.getLoop().setParent(loop);
} else {
loop.addNode(node.getBb());
}
}
lsg.addLoop(loop);
} // nodePool.size