From 812ca88eb4a3baf471a15f850fcb7cf124c26fc1 Mon Sep 17 00:00:00 2001 From: tejohnson Date: Wed, 15 May 2013 14:14:15 +0000 Subject: 2013-05-15 Teresa Johnson * function.h (has_bb_partition): New rtl_data flag. (bb_reorder_complete): Ditto. * cfgcleanup.c (try_crossjump_to_edge): Check for has_bb_partition instead of flag_reorder_blocks_and_partition. * cfgrtl.c (verify_hot_cold_block_grouping): Moved from bb-reorder.c, with some enhancements. (rtl_verify_flow_info_1): Call verify_hot_cold_block_grouping. * bb-reorder.c (connect_traces): Check for has_bb_partition instead of flag_reorder_blocks_and_partition. (verify_hot_cold_block_grouping): Moved to cfgrtl.c. (reorder_basic_blocks): Set bb_reorder_complete flag, remove call to verify_hot_cold_block_grouping. (partition_hot_cold_basic_blocks): Set has_bb_partition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198934 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/bb-reorder.c | 48 +++++++----------------------------------------- 1 file changed, 7 insertions(+), 41 deletions(-) (limited to 'gcc/bb-reorder.c') diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index abb2e391983..3167220d972 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -1053,7 +1053,7 @@ connect_traces (int n_traces, struct trace *traces) current_partition = BB_PARTITION (traces[0].first); two_passes = false; - if (flag_reorder_blocks_and_partition) + if (crtl->has_bb_partition) for (i = 0; i < n_traces && !two_passes; i++) if (BB_PARTITION (traces[0].first) != BB_PARTITION (traces[i].first)) @@ -1262,7 +1262,7 @@ connect_traces (int n_traces, struct trace *traces) } } - if (flag_reorder_blocks_and_partition) + if (crtl->has_bb_partition) try_copy = false; /* Copy tiny blocks always; copy larger blocks only when the @@ -2068,43 +2068,6 @@ add_reg_crossing_jump_notes (void) add_reg_note (BB_END (e->src), REG_CROSSING_JUMP, NULL_RTX); } -/* Verify, in the basic block chain, that there is at most one switch - between hot/cold partitions. This is modelled on - rtl_verify_flow_info_1, but it cannot go inside that function - because this condition will not be true until after - reorder_basic_blocks is called. */ - -static void -verify_hot_cold_block_grouping (void) -{ - basic_block bb; - int err = 0; - bool switched_sections = false; - int current_partition = 0; - - FOR_EACH_BB (bb) - { - if (!current_partition) - current_partition = BB_PARTITION (bb); - if (BB_PARTITION (bb) != current_partition) - { - if (switched_sections) - { - error ("multiple hot/cold transitions found (bb %i)", - bb->index); - err = 1; - } - else - { - switched_sections = true; - current_partition = BB_PARTITION (bb); - } - } - } - - gcc_assert(!err); -} - /* Reorder basic blocks. The main entry point to this file. FLAGS is the set of flags to pass to cfg_layout_initialize(). */ @@ -2157,8 +2120,9 @@ reorder_basic_blocks (void) dump_flow_info (dump_file, dump_flags); } - if (flag_reorder_blocks_and_partition) - verify_hot_cold_block_grouping (); + /* Signal that rtl_verify_flow_info_1 can now verify that there + is at most one switch between hot/cold sections. */ + crtl->bb_reorder_complete = true; } /* Determine which partition the first basic block in the function @@ -2503,6 +2467,8 @@ partition_hot_cold_basic_blocks (void) if (!crossing_edges.exists ()) return 0; + crtl->has_bb_partition = true; + /* Make sure the source of any crossing edge ends in a jump and the destination of any crossing edge has a label. */ add_labels_and_missing_jumps (crossing_edges); -- cgit v1.2.1