From 03001a351528a1fc35bfe0c70deb08c7e18d314b Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 11 Mar 2019 11:31:05 +0000 Subject: [PATCH] re PR tree-optimization/89649 (r269458 FAILs g++.dg/pr80481.C, scan-assembler-not vmovaps) 2019-03-11 Richard Biener PR tree-optimization/89649 * tree-vectorizer.h (vect_loop_versioning): Adjust prototype. * tree-vect-loop-manip.c (vect_do_peeling): Unset force_vectorize on the prolog and epilog loops. (vect_loop_versioning): Return copy of loop. * tree-vect-loop.c (vect_transform_loop): Unset force_vectorize on the non-vectorized version of the loop. From-SVN: r269578 --- gcc/ChangeLog | 10 ++++++++++ gcc/tree-vect-loop-manip.c | 6 +++++- gcc/tree-vect-loop.c | 6 ++++-- gcc/tree-vectorizer.h | 4 ++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 24194ab823e..cf2e61d2d1f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2019-03-11 Richard Biener + + PR tree-optimization/89649 + * tree-vectorizer.h (vect_loop_versioning): Adjust prototype. + * tree-vect-loop-manip.c (vect_do_peeling): Unset force_vectorize + on the prolog and epilog loops. + (vect_loop_versioning): Return copy of loop. + * tree-vect-loop.c (vect_transform_loop): Unset force_vectorize + on the non-vectorized version of the loop. + 2019-03-10 Uroš Bizjak PR target/68924 diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index 58d1850666f..77d3dac771e 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -2542,6 +2542,7 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1, "slpeel_tree_duplicate_loop_to_edge_cfg failed.\n"); gcc_unreachable (); } + prolog->force_vectorize = false; slpeel_update_phi_nodes_for_loops (loop_vinfo, prolog, loop, true); first_loop = prolog; reset_original_copy_tables (); @@ -2612,6 +2613,7 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1, "slpeel_tree_duplicate_loop_to_edge_cfg failed.\n"); gcc_unreachable (); } + epilog->force_vectorize = false; slpeel_update_phi_nodes_for_loops (loop_vinfo, loop, epilog, false); /* Scalar version loop may be preferred. In this case, add guard @@ -2984,7 +2986,7 @@ vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo, tree * cond_expr) The versioning precondition(s) are placed in *COND_EXPR and *COND_EXPR_STMT_LIST. */ -void +struct loop * vect_loop_versioning (loop_vec_info loop_vinfo, unsigned int th, bool check_profitability, poly_uint64 versioning_threshold) @@ -3154,4 +3156,6 @@ vect_loop_versioning (loop_vec_info loop_vinfo, GSI_SAME_STMT); } update_ssa (TODO_update_ssa); + + return nloop; } diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index e088b6f79e8..bd81193a236 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -8201,8 +8201,10 @@ vect_transform_loop (loop_vec_info loop_vinfo) versioning_threshold); check_profitability = false; } - vect_loop_versioning (loop_vinfo, th, check_profitability, - versioning_threshold); + struct loop *sloop + = vect_loop_versioning (loop_vinfo, th, check_profitability, + versioning_threshold); + sloop->force_vectorize = false; check_profitability = false; } diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 0e056f34b53..d67c54427cc 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1449,8 +1449,8 @@ extern void vect_set_loop_condition (struct loop *, loop_vec_info, extern bool slpeel_can_duplicate_loop_p (const struct loop *, const_edge); struct loop *slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *, struct loop *, edge); -extern void vect_loop_versioning (loop_vec_info, unsigned int, bool, - poly_uint64); +struct loop *vect_loop_versioning (loop_vec_info, unsigned int, bool, + poly_uint64); extern struct loop *vect_do_peeling (loop_vec_info, tree, tree, tree *, tree *, tree *, int, bool, bool); extern void vect_prepare_for_masked_peels (loop_vec_info); -- 2.30.2