-/* 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 = ENTRY_BLOCK_PTR->succ->dest;
- basic_block bb = ENTRY_BLOCK_PTR->succ->dest->next_bb;
-
- while (bb != EXIT_BLOCK_PTR)
- {
- edge e, best = NULL;
- while (end->rbi->next)
- end = end->rbi->next;
-
- for (e = end->succ; e; e = e->succ_next)
- if (e->dest != EXIT_BLOCK_PTR
- && e->dest != ENTRY_BLOCK_PTR->succ->dest
- && !e->dest->rbi->visited
- && (!best || EDGE_FREQUENCY (e) > EDGE_FREQUENCY (best)))
- best = e;
-
- if (best)
- {
- end->rbi->next = best->dest;
- best->dest->rbi->visited = 1;
- }
- else
- for (; bb != EXIT_BLOCK_PTR; bb = bb->next_bb)
- {
- if (!bb->rbi->visited)
- {
- end->rbi->next = bb;
- bb->rbi->visited = 1;
- break;
- }
- }
- }
-}
-