diff options
author | Andre Vieira <andre.simoesdiasvieira@arm.com> | 2019-10-29 13:15:46 +0000 |
---|---|---|
committer | Andre Vieira <avieira@gcc.gnu.org> | 2019-10-29 13:15:46 +0000 |
commit | 97c146036750e7cb3966d292572ec158a78f356e (patch) | |
tree | f8bd6e942ea43e0643932c1975603c427d76bb64 /gcc/tree-ssa-sccvn.c | |
parent | 3ab768774318cff1ecc7951a59bc9f66ceb015ff (diff) | |
download | gcc-97c146036750e7cb3966d292572ec158a78f356e.zip gcc-97c146036750e7cb3966d292572ec158a78f356e.tar.gz gcc-97c146036750e7cb3966d292572ec158a78f356e.tar.bz2 |
[vect]PR 88915: Vectorize epilogues when versioning loops
gcc/ChangeLog:
2019-10-29 Andre Vieira <andre.simoesdiasvieira@arm.com>
PR 88915
* tree-ssa-loop-niter.h (simplify_replace_tree): Change declaration.
* tree-ssa-loop-niter.c (simplify_replace_tree): Add context parameter
and make the valueize function pointer also take a void pointer.
* gcc/tree-ssa-sccvn.c (vn_valueize_wrapper): New function to wrap
around vn_valueize, to call it without a context.
(process_bb): Use vn_valueize_wrapper instead of vn_valueize.
* tree-vect-loop.c (_loop_vec_info): Initialize epilogue_vinfos.
(~_loop_vec_info): Release epilogue_vinfos.
(vect_analyze_loop_costing): Use knowledge of main VF to estimate
number of iterations of epilogue.
(vect_analyze_loop_2): Adapt to analyse main loop for all supported
vector sizes when vect-epilogues-nomask=1. Also keep track of lowest
versioning threshold needed for main loop.
(vect_analyze_loop): Likewise.
(find_in_mapping): New helper function.
(update_epilogue_loop_vinfo): New function.
(vect_transform_loop): When vectorizing epilogues re-use analysis done
on main loop and call update_epilogue_loop_vinfo to update it.
* tree-vect-loop-manip.c (vect_update_inits_of_drs): No longer insert
stmts on loop preheader edge.
(vect_do_peeling): Enable skip-vectors when doing loop versioning if
we decided to vectorize epilogues. Update epilogues NITERS and
construct ADVANCE to update epilogues data references where needed.
* tree-vectorizer.h (_loop_vec_info): Add epilogue_vinfos.
(vect_do_peeling, vect_update_inits_of_drs,
determine_peel_for_niter, vect_analyze_loop): Add or update
declarations.
* tree-vectorizer.c (try_vectorize_loop_1): Make sure to use already
created loop_vec_info's for epilogues when available. Otherwise analyse
epilogue separately.
From-SVN: r277569
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 3872168..7465bed 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -309,6 +309,10 @@ static vn_tables_t valid_info; /* Valueization hook. Valueize NAME if it is an SSA name, otherwise just return it. */ tree (*vn_valueize) (tree); +tree vn_valueize_wrapper (tree t, void* context ATTRIBUTE_UNUSED) +{ + return vn_valueize (t); +} /* This represents the top of the VN lattice, which is the universal @@ -6412,7 +6416,7 @@ process_bb (rpo_elim &avail, basic_block bb, if (bb->loop_father->nb_iterations) bb->loop_father->nb_iterations = simplify_replace_tree (bb->loop_father->nb_iterations, - NULL_TREE, NULL_TREE, vn_valueize); + NULL_TREE, NULL_TREE, &vn_valueize_wrapper); } /* Value-number all defs in the basic-block. */ |