-/* Connect the superblocks into linear sequence. At the moment we attempt to keep
- the original order as much as possible, but the algorithm may be made smarter
- later if needed. BB reordering pass should void most of the benefits of such
- change though. */
-
-static void
-layout_superblocks (void)
-{
- basic_block end = single_succ (ENTRY_BLOCK_PTR);
- basic_block bb = end->next_bb;
-
- while (bb != EXIT_BLOCK_PTR)
- {
- edge_iterator ei;
- edge e, best = NULL;
- while (end->aux)
- end = end->aux;
-
- FOR_EACH_EDGE (e, ei, end->succs)
- if (e->dest != EXIT_BLOCK_PTR
- && e->dest != single_succ (ENTRY_BLOCK_PTR)
- && !e->dest->il.rtl->visited
- && (!best || EDGE_FREQUENCY (e) > EDGE_FREQUENCY (best)))
- best = e;
-
- if (best)
- {
- end->aux = best->dest;
- best->dest->il.rtl->visited = 1;
- }
- else
- for (; bb != EXIT_BLOCK_PTR; bb = bb->next_bb)
- {
- if (!bb->il.rtl->visited)
- {
- end->aux = bb;
- bb->il.rtl->visited = 1;
- break;
- }
- }
- }
-}
-