aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-09-08 14:49:59 +0200
committerRichard Biener <rguenther@suse.de>2020-09-10 11:18:18 +0200
commit47ddf4c7b1d4471cb9534f27844ab5e4279c2168 (patch)
tree5983e9d8c24326c178aa7f721b107e4651fa1628 /gcc/tree-vectorizer.h
parent484af18ee1c63eb8d212563e40aa765da5be7f82 (diff)
downloadgcc-47ddf4c7b1d4471cb9534f27844ab5e4279c2168.zip
gcc-47ddf4c7b1d4471cb9534f27844ab5e4279c2168.tar.gz
gcc-47ddf4c7b1d4471cb9534f27844ab5e4279c2168.tar.bz2
tree-optimization/96043 - BB vectorization costing improvement
This makes the BB vectorizer cost independent SLP subgraphs separately. While on pristine trunk and for x86_64 I failed to distill a testcase where the vectorizer would think _any_ basic-block vectorization opportunity is not profitable I do have pending work that would make the cost savings of a profitable opportunity make another independently not profitable opportunity vectorized. 2020-09-08 Richard Biener <rguenther@suse.de> PR tree-optimization/96043 * tree-vectorizer.h (_slp_instance::cost_vec): New. (_slp_instance::subgraph_entries): Likewise. (BB_VINFO_TARGET_COST_DATA): Remove. * tree-vect-slp.c (vect_free_slp_instance): Free cost_vec and subgraph_entries. (vect_analyze_slp_instance): Initialize them. (vect_slp_analyze_operations): Defer passing costs to the target, instead record them in the SLP graph entry. (get_ultimate_leader): New helper for graph partitioning. (vect_bb_partition_graph_r): Likewise. (vect_bb_partition_graph): New function to partition the SLP graph into independently costable parts. (vect_bb_vectorization_profitable_p): Adjust to work on a subgraph. (vect_bb_vectorization_profitable_p): New wrapper, discarding non-profitable vectorization of subgraphs. (vect_slp_analyze_bb_1): Call vect_bb_partition_graph before costing. * gcc.dg/vect/costmodel/x86_64/costmodel-pr69297.c: Adjust.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index fb1111c..8bf3313 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -183,6 +183,13 @@ public:
/* The SLP node containing the reduction PHIs. */
slp_tree reduc_phis;
+
+ /* Vector cost of this entry to the SLP graph. */
+ stmt_vector_for_cost cost_vec;
+
+ /* If this instance is the main entry of a subgraph the set of
+ entries into the same subgraph, including itself. */
+ vec<_slp_instance *> subgraph_entries;
} *slp_instance;
@@ -913,7 +920,6 @@ public:
#define BB_VINFO_SLP_INSTANCES(B) (B)->slp_instances
#define BB_VINFO_DATAREFS(B) (B)->shared->datarefs
#define BB_VINFO_DDRS(B) (B)->shared->ddrs
-#define BB_VINFO_TARGET_COST_DATA(B) (B)->target_cost_data
static inline bb_vec_info
vec_info_for_bb (basic_block bb)