public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-4719] add costing to SLP vectorized PHIs Date: Wed, 4 Nov 2020 12:44:18 +0000 (GMT) [thread overview] Message-ID: <20201104124418.432B13836C73@sourceware.org> (raw) https://gcc.gnu.org/g:1272573a6b2257a7ed525a81e26862a563fb68a0 commit r11-4719-g1272573a6b2257a7ed525a81e26862a563fb68a0 Author: Richard Biener <rguenther@suse.de> Date: Wed Nov 4 11:37:52 2020 +0100 add costing to SLP vectorized PHIs I forgot to cost vectorized PHIs. Scalar PHIs are just costed as scalar_stmt so the following costs vector PHIs as vector_stmt. 2020-11-04 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vectorizable_phi): Adjust prototype. * tree-vect-stmts.c (vect_transform_stmt): Adjust. (vect_analyze_stmt): Pass cost_vec to vectorizable_phi. * tree-vect-loop.c (vectorizable_phi): Do costing. Diff: --- gcc/tree-vect-loop.c | 4 +++- gcc/tree-vect-stmts.c | 4 ++-- gcc/tree-vectorizer.h | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 6cb2286d5c8..5e7188ab87a 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -7548,7 +7548,7 @@ vectorizable_lc_phi (loop_vec_info loop_vinfo, bool vectorizable_phi (vec_info *, stmt_vec_info stmt_info, gimple **vec_stmt, - slp_tree slp_node) + slp_tree slp_node, stmt_vector_for_cost *cost_vec) { if (!is_a <gphi *> (stmt_info->stmt) || !slp_node) return false; @@ -7577,6 +7577,8 @@ vectorizable_phi (vec_info *, "incompatible vector types for invariants\n"); return false; } + record_stmt_cost (cost_vec, SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node), + vector_stmt, stmt_info, vectype, 0, vect_body); STMT_VINFO_TYPE (stmt_info) = phi_info_type; return true; } diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 9cf85a0cd51..2c7a8a70913 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -10727,7 +10727,7 @@ vect_analyze_stmt (vec_info *vinfo, NULL, NULL, node, cost_vec) || vectorizable_comparison (vinfo, stmt_info, NULL, NULL, node, cost_vec) - || vectorizable_phi (vinfo, stmt_info, NULL, node)); + || vectorizable_phi (vinfo, stmt_info, NULL, node, cost_vec)); } if (!ok) @@ -10868,7 +10868,7 @@ vect_transform_stmt (vec_info *vinfo, break; case phi_info_type: - done = vectorizable_phi (vinfo, stmt_info, &vec_stmt, slp_node); + done = vectorizable_phi (vinfo, stmt_info, &vec_stmt, slp_node, NULL); gcc_assert (done); break; diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index fbf5291cf06..0252d799561 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1940,7 +1940,8 @@ extern bool vect_transform_cycle_phi (loop_vec_info, stmt_vec_info, slp_tree, slp_instance); extern bool vectorizable_lc_phi (loop_vec_info, stmt_vec_info, gimple **, slp_tree); -extern bool vectorizable_phi (vec_info *, stmt_vec_info, gimple **, slp_tree); +extern bool vectorizable_phi (vec_info *, stmt_vec_info, gimple **, slp_tree, + stmt_vector_for_cost *); extern bool vect_worthwhile_without_simd_p (vec_info *, tree_code); extern int vect_get_known_peeling_cost (loop_vec_info, int, int *, stmt_vector_for_cost *,
reply other threads:[~2020-11-04 12:44 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20201104124418.432B13836C73@sourceware.org \ --to=rguenth@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).