aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2015-10-01 08:33:09 +0200
committerSegher Boessenkool <segher@gcc.gnu.org>2015-10-01 08:33:09 +0200
commitaf71fa391d8bdfd5c3156a03afa42f0363a495a7 (patch)
treec6a35c51714f7001412d66c0f25a732df021e59b
parent26e5d47d44df43aaa6a14ae56bc057913c1d3e4c (diff)
downloadgcc-af71fa391d8bdfd5c3156a03afa42f0363a495a7.zip
gcc-af71fa391d8bdfd5c3156a03afa42f0363a495a7.tar.gz
gcc-af71fa391d8bdfd5c3156a03afa42f0363a495a7.tar.bz2
bb-reorder: Split out STC
2015-09-23 Segher Boessenkool <segher@kernel.crashing.org> * bb-reorder.c (reorder_basic_blocks_software_trace_cache): New function, factored out from ... (reorder_basic_blocks): ... here. From-SVN: r228316
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/bb-reorder.c29
2 files changed, 24 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c132980..053e902 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-01 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * bb-reorder.c (reorder_basic_blocks_software_trace_cache): New
+ function, factored out from ...
+ (reorder_basic_blocks): ... here.
+
2015-10-01 Tom de Vries <tom@codesourcery.com>
* tree-cfg.c (dump_function_to_file): Dump function attributes using
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 2110bd2..725cdc3 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -2226,24 +2226,15 @@ update_crossing_jump_flags (void)
}
}
-/* Reorder basic blocks. The main entry point to this file. FLAGS is
- the set of flags to pass to cfg_layout_initialize(). */
+/* Reorder basic blocks using the software trace cache (STC) algorithm. */
static void
-reorder_basic_blocks (void)
+reorder_basic_blocks_software_trace_cache (void)
{
int n_traces;
int i;
struct trace *traces;
- gcc_assert (current_ir_type () == IR_RTL_CFGLAYOUT);
-
- if (n_basic_blocks_for_fn (cfun) <= NUM_FIXED_BLOCKS + 1)
- return;
-
- set_edge_can_fallthru_flag ();
- mark_dfs_back_edges ();
-
/* We are estimating the length of uncond jump insn only once since the code
for getting the insn length always returns the minimal length now. */
if (uncond_jump_length == 0)
@@ -2268,6 +2259,22 @@ reorder_basic_blocks (void)
connect_traces (n_traces, traces);
FREE (traces);
FREE (bbd);
+}
+
+/* Reorder basic blocks. The main entry point to this file. */
+
+static void
+reorder_basic_blocks (void)
+{
+ gcc_assert (current_ir_type () == IR_RTL_CFGLAYOUT);
+
+ if (n_basic_blocks_for_fn (cfun) <= NUM_FIXED_BLOCKS + 1)
+ return;
+
+ set_edge_can_fallthru_flag ();
+ mark_dfs_back_edges ();
+
+ reorder_basic_blocks_software_trace_cache ();
relink_block_chain (/*stay_in_cfglayout_mode=*/true);