summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Muellner <christoph.muellner@theobroma-systems.com>2018-09-18 18:11:01 +0200
committerChristoph Muellner <christoph.muellner@theobroma-systems.com>2018-10-17 23:23:56 +0200
commit25496d131d54f793ebabf1a522de8c94c1b9c55e (patch)
treebe5cc47d2cce60c61ea35476edbc621dcaa2f96f
parent6a71ac8910553760163c3da559558469e517f7f5 (diff)
Introduce new command line flag -funroll-more.
This flag triggers more aggressive loop unrolling in tree-predcom. Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
-rw-r--r--gcc/common.opt4
-rw-r--r--gcc/tree-predcom.c13
2 files changed, 16 insertions, 1 deletions
diff --git a/gcc/common.opt b/gcc/common.opt
index abb50ad4fabb..01dc499b6716 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2644,6 +2644,10 @@ fvectorize-more
Common Report Var(flag_vectorize_more) Optimization
Vectorize a bit more.
+funroll-more
+Common Report Var(flag_unroll_more) Optimization
+Unroll a bit more.
+
funwind-tables
Common Report Var(flag_unwind_tables) Optimization
Just generate unwind tables for exception handling.
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index a2bb6763e524..67dc9d112cb0 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -2568,6 +2568,15 @@ tree_predictive_commoning_loop (struct loop *loop)
edge exit;
bitmap tmp_vars;
+ unroll_factor = 4;
+ unroll = can_unroll_loop_p (loop, unroll_factor, &desc);
+ exit = single_dom_exit (loop);
+
+ if (unroll && flag_unroll_more)
+ {
+ tree_unroll_loop (loop, unroll_factor, exit, &desc);
+ }
+
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Processing loop %d\n", loop->num);
@@ -2650,7 +2659,7 @@ tree_predictive_commoning_loop (struct loop *loop)
/* Execute the predictive commoning transformations, and possibly unroll the
loop. */
- if (unroll)
+ if (unroll && !flag_unroll_more)
{
struct epcc_data dta;
@@ -2716,6 +2725,8 @@ tree_predictive_commoning (void)
}
free_original_copy_tables ();
+ ret = TODO_cleanup_cfg;
+
return ret;
}