summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Inführ <dominik.infuehr@theobroma-systems.com>2017-07-05 15:09:34 +0200
committerChristoph Muellner <christoph.muellner@theobroma-systems.com>2018-10-17 23:23:21 +0200
commitd201b78a412e693d2d655ac6158ee9378055a013 (patch)
tree7c2022172a849dcfe9bab88f64682838bff13f5b
parentbae700831ec90aa7def9837147d26cb1511a4f6d (diff)
tree-vect-slp: Enable vectorization when -fvectorize-more is given.
GCC 6+ detects more SLP instances compared to earlier versions. Cost analysis is done for all instances together and not all combinations. Additional instances make vectorization unprofitable, fix it by ignoring all but first instance when -fvectorize-more is given. Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
-rw-r--r--gcc/common.opt4
-rw-r--r--gcc/tree-vect-slp.c12
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/common.opt b/gcc/common.opt
index 6d98927fcc65..abb50ad4fabb 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2640,6 +2640,10 @@ flist-find-pipeline
Common Report Var(list_find_pipe) Optimization
Pipeline the find operation in a linked list.
+fvectorize-more
+Common Report Var(flag_vectorize_more) Optimization
+Vectorize a bit more.
+
funwind-tables
Common Report Var(flag_unwind_tables) Optimization
Just generate unwind tables for exception handling.
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 66548cf6f86e..8b3492567797 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -2526,6 +2526,18 @@ vect_slp_analyze_operations (vec<slp_instance> slp_instances, void *data)
vect_free_slp_instance (instance);
slp_instances.ordered_remove (i);
}
+ else if (flag_vectorize_more != 0 && i > 0)
+ {
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "removing SLP instance operations starting from: ");
+ dump_gimple_stmt (MSG_NOTE, TDF_SLIM,
+ SLP_TREE_SCALAR_STMTS
+ (SLP_INSTANCE_TREE (instance))[0], 0);
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "remove all but first instance\n");
+ vect_free_slp_instance (instance);
+ slp_instances.ordered_remove (i);
+ }
else
{
/* Compute the costs of the SLP instance. */