aboutsummaryrefslogtreecommitdiff
path: root/gcc/targhooks.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-05-13 14:09:40 +0200
committerRichard Biener <rguenther@suse.de>2020-05-13 17:19:38 +0200
commit78db0e093e69f360ac1ef871ca08895a4d2bec06 (patch)
tree0947d6f76ea1b64662ee13ecf46033c789754221 /gcc/targhooks.c
parentf9f98e59a7f6663f31b671c44998190079097f97 (diff)
downloadgcc-78db0e093e69f360ac1ef871ca08895a4d2bec06.zip
gcc-78db0e093e69f360ac1ef871ca08895a4d2bec06.tar.gz
gcc-78db0e093e69f360ac1ef871ca08895a4d2bec06.tar.bz2
add vectype parameter to add_stmt_cost hook
This adds a vectype parameter to add_stmt_cost which avoids the need to pass down a (wrong) stmt_info just to carry this information. Useful for invariants which do not have a stmt_info associated. 2020-05-13 Richard Biener <rguenther@suse.de> * target.def (add_stmt_cost): Add new vectype parameter. * targhooks.c (default_add_stmt_cost): Adjust. * targhooks.h (default_add_stmt_cost): Likewise. * config/aarch64/aarch64.c (aarch64_add_stmt_cost): Take new vectype parameter. * config/arm/arm.c (arm_add_stmt_cost): Likewise. * config/i386/i386.c (ix86_add_stmt_cost): Likewise. * config/rs6000/rs6000.c (rs6000_add_stmt_cost): Likewise. * tree-vectorizer.h (stmt_info_for_cost::vectype): Add. (dump_stmt_cost): Add new vectype parameter. (add_stmt_cost): Likewise. (record_stmt_cost): Likewise. (record_stmt_cost): Add overload with old signature. * tree-vect-loop.c (vect_compute_single_scalar_iteration_cost): Adjust. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Likewise. * tree-vectorizer.c (dump_stmt_cost): Add new vectype parameter. * tree-vect-stmts.c (record_stmt_cost): Likewise. (vect_prologue_cost_for_slp_op): Remove stmt_vec_info parameter and pass down correct vectype and NULL stmt_info. (vect_model_simple_cost): Adjust. (vect_model_store_cost): Likewise.
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r--gcc/targhooks.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index e098232..0113c7b 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -1350,13 +1350,12 @@ default_init_cost (class loop *loop_info ATTRIBUTE_UNUSED)
unsigned
default_add_stmt_cost (class vec_info *vinfo, void *data, int count,
enum vect_cost_for_stmt kind,
- class _stmt_vec_info *stmt_info, int misalign,
+ class _stmt_vec_info *stmt_info, tree vectype,
+ int misalign,
enum vect_cost_model_location where)
{
unsigned *cost = (unsigned *) data;
unsigned retval = 0;
-
- tree vectype = stmt_info ? stmt_vectype (stmt_info) : NULL_TREE;
int stmt_cost = targetm.vectorize.builtin_vectorization_cost (kind, vectype,
misalign);
/* Statements in an inner loop relative to the loop being