diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-01-09 21:10:23 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-01-09 21:10:23 +0100 |
commit | cb330ba582c9b175bb0c2debaba075a8af8d0b95 (patch) | |
tree | 6dd4df32ad5eb0ca2c76ee47cb1d2ae5a80687ef /gcc/tree-vect-loop-manip.c | |
parent | 47d5beb478d39937b8068410101241ae806adc25 (diff) | |
download | gcc-cb330ba582c9b175bb0c2debaba075a8af8d0b95.zip gcc-cb330ba582c9b175bb0c2debaba075a8af8d0b95.tar.gz gcc-cb330ba582c9b175bb0c2debaba075a8af8d0b95.tar.bz2 |
re PR tree-optimization/78899 (Vestorized loop with optmized mask stores motion is completely deleted after r242520.)
PR tree-optimization/78899
* tree-if-conv.c (version_loop_for_if_conversion): Instead of
returning bool return struct loop *, NULL for failure and the new
loop on success.
(versionable_outer_loop_p): Don't version outer loop if it has
dont_vectorized bit set.
(tree_if_conversion): When versioning outer loop, ensure
tree_if_conversion is performed also on the inner loop of the
non-vectorizable outer loop copy.
* tree-vectorizer.c (set_uid_loop_bbs): Formatting fix. Fold
LOOP_VECTORIZED in inner loop of the scalar outer loop and
prevent vectorization of it.
(vectorize_loops): For outer + inner LOOP_VECTORIZED, ensure
the outer loop vectorization of the non-scalar version is attempted
before vectorization of the inner loop in scalar version. If
outer LOOP_VECTORIZED guarded loop is not vectorized, prevent
vectorization of its inner loop.
* tree-vect-loop-manip.c (rename_variables_in_bb): If outer_loop
has 2 inner loops, rename also on edges from bb whose single pred
is outer_loop->header. Fix typo in function comment.
* gcc.target/i386/pr78899.c: New test.
* gcc.dg/pr71077.c: New test.
From-SVN: r244238
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r-- | gcc/tree-vect-loop-manip.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index 51d52ac..935cd75 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -71,7 +71,7 @@ rename_use_op (use_operand_p op_p) } -/* Renames the variables in basic block BB. Allow renaming of PHI argumnets +/* Renames the variables in basic block BB. Allow renaming of PHI arguments on edges incoming from outer-block header if RENAME_FROM_OUTER_LOOP is true. */ @@ -102,9 +102,25 @@ rename_variables_in_bb (basic_block bb, bool rename_from_outer_loop) FOR_EACH_EDGE (e, ei, bb->preds) { - if (!flow_bb_inside_loop_p (loop, e->src) - && (!rename_from_outer_loop || e->src != outer_loop->header)) - continue; + if (!flow_bb_inside_loop_p (loop, e->src)) + { + if (!rename_from_outer_loop) + continue; + if (e->src != outer_loop->header) + { + if (outer_loop->inner->next) + { + /* If outer_loop has 2 inner loops, allow there to + be an extra basic block which decides which of the + two loops to use using LOOP_VECTORIZED. */ + if (!single_pred_p (e->src) + || single_pred (e->src) != outer_loop->header) + continue; + } + else + continue; + } + } for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) rename_use_op (PHI_ARG_DEF_PTR_FROM_EDGE (gsi.phi (), e)); |