aboutsummaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r--gcc/bb-reorder.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 143bdd0..dd41dee 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -1384,6 +1384,41 @@ find_rarely_executed_basic_blocks_and_crossing_edges (void)
return crossing_edges;
}
+/* Set the flag EDGE_CAN_FALLTHRU for edges that can be fallthru. */
+
+static void
+set_edge_can_fallthru_flag (void)
+{
+ basic_block bb;
+
+ FOR_EACH_BB (bb)
+ {
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ e->flags &= ~EDGE_CAN_FALLTHRU;
+
+ /* The FALLTHRU edge is also CAN_FALLTHRU edge. */
+ if (e->flags & EDGE_FALLTHRU)
+ e->flags |= EDGE_CAN_FALLTHRU;
+ }
+
+ /* If the BB ends with an invertible condjump all (2) edges are
+ CAN_FALLTHRU edges. */
+ if (EDGE_COUNT (bb->succs) != 2)
+ continue;
+ if (!any_condjump_p (BB_END (bb)))
+ continue;
+ if (!invert_jump (BB_END (bb), JUMP_LABEL (BB_END (bb)), 0))
+ continue;
+ invert_jump (BB_END (bb), JUMP_LABEL (BB_END (bb)), 0);
+ EDGE_SUCC (bb, 0)->flags |= EDGE_CAN_FALLTHRU;
+ EDGE_SUCC (bb, 1)->flags |= EDGE_CAN_FALLTHRU;
+ }
+}
+
/* If any destination of a crossing edge does not have a label, add label;
Convert any easy fall-through crossing edges to unconditional jumps. */
@@ -1959,7 +1994,11 @@ reorder_basic_blocks (void)
relink_block_chain (/*stay_in_cfglayout_mode=*/true);
if (dump_file)
- dump_flow_info (dump_file, dump_flags);
+ {
+ if (dump_flags & TDF_DETAILS)
+ dump_reg_info (dump_file);
+ dump_flow_info (dump_file, dump_flags);
+ }
if (flag_reorder_blocks_and_partition)
verify_hot_cold_block_grouping ();