diff options
author | Yuri Rumyantsev <ysrumyan@gmail.com> | 2016-11-16 16:22:39 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2016-11-16 08:22:39 -0800 |
commit | 598eaaa2a2368bb7d5ac3bafe7a0d1bb26d43f6e (patch) | |
tree | dc23b763501a2bee6d35f9e53240208b4bacc573 /gcc/tree-vect-loop-manip.c | |
parent | 03b85dcd4861611b49a7e7bf737246b6460b2295 (diff) | |
download | gcc-598eaaa2a2368bb7d5ac3bafe7a0d1bb26d43f6e.zip gcc-598eaaa2a2368bb7d5ac3bafe7a0d1bb26d43f6e.tar.gz gcc-598eaaa2a2368bb7d5ac3bafe7a0d1bb26d43f6e.tar.bz2 |
Support non-masked epilogue vectoriziation
gcc/
2016-11-16 Yuri Rumyantsev <ysrumyan@gmail.com>
* params.def (PARAM_VECT_EPILOGUES_NOMASK): New.
* tree-if-conv.c (tree_if_conversion): Make public.
* * tree-if-conv.h: New file.
* tree-vect-data-refs.c (vect_analyze_data_ref_dependences) Avoid
dynamic alias checks for epilogues.
* tree-vect-loop-manip.c (vect_do_peeling): Return created epilog.
* tree-vect-loop.c: include tree-if-conv.h.
(new_loop_vec_info): Add zeroing orig_loop_info field.
(vect_analyze_loop_2): Don't try to enhance alignment for epilogues.
(vect_analyze_loop): Add argument ORIG_LOOP_INFO which is not NULL
if epilogue is vectorized, set up orig_loop_info field of loop_vinfo
using passed argument.
(vect_transform_loop): Check if created epilogue should be returned
for further vectorization with less vf. If-convert epilogue if
required. Print vectorization success for epilogue.
* tree-vectorizer.c (vectorize_loops): Add epilogue vectorization
if it is required, pass loop_vinfo produced during vectorization of
loop body to vect_analyze_loop.
* tree-vectorizer.h (struct _loop_vec_info): Add new field
orig_loop_info.
(LOOP_VINFO_ORIG_LOOP_INFO): New.
(LOOP_VINFO_EPILOGUE_P): New.
(LOOP_VINFO_ORIG_VECT_FACTOR): New.
(vect_do_peeling): Change prototype to return epilogue.
(vect_analyze_loop): Add argument of loop_vec_info type.
(vect_transform_loop): Return created loop.
gcc/testsuite/
2016-11-16 Yuri Rumyantsev <ysrumyan@gmail.com>
* lib/target-supports.exp (check_avx2_hw_available): New.
(check_effective_target_avx2_runtime): New.
* gcc.dg/vect/vect-tail-nomask-1.c: New test.
From-SVN: r242501
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r-- | gcc/tree-vect-loop-manip.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index 4c6b8c7..e13d6a2 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -1614,11 +1614,13 @@ slpeel_update_phi_nodes_for_lcssa (struct loop *epilog) Note this function peels prolog and epilog only if it's necessary, as well as guards. + Returns created epilogue or NULL. TODO: Guard for prefer_scalar_loop should be emitted along with versioning conditions if loop versioning is needed. */ -void + +struct loop * vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1, tree *niters_vector, int th, bool check_profitability, bool niters_no_overflow) @@ -1634,7 +1636,7 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1, || LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo)); if (!prolog_peeling && !epilog_peeling) - return; + return NULL; prob_vector = 9 * REG_BR_PROB_BASE / 10; if ((vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo)) == 2) @@ -1642,7 +1644,7 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1, prob_prolog = prob_epilog = (vf - 1) * REG_BR_PROB_BASE / vf; vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo); - struct loop *prolog, *epilog, *loop = LOOP_VINFO_LOOP (loop_vinfo); + struct loop *prolog, *epilog = NULL, *loop = LOOP_VINFO_LOOP (loop_vinfo); struct loop *first_loop = loop; create_lcssa_for_virtual_phi (loop); update_ssa (TODO_update_ssa_only_virtuals); @@ -1824,6 +1826,8 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1, } adjust_vec.release (); free_original_copy_tables (); + + return epilog; } /* Function vect_create_cond_for_niters_checks. |