+2020-01-20 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/93094
+ * tree-vectorizer.h (vect_loop_versioning): Adjust.
+ (vect_transform_loop): Likewise.
+ * tree-vectorizer.c (try_vectorize_loop_1): Pass down
+ loop_vectorized_call to vect_transform_loop.
+ * tree-vect-loop.c (vect_transform_loop): Pass down
+ loop_vectorized_call to vect_loop_versioning.
+ * tree-vect-loop-manip.c (vect_loop_versioning): Use
+ the earlier discovered loop_vectorized_call.
+
2020-01-19 Eric S. Raymond <esr@thyrsus.com>
* doc/contribute.texi: Update for SVN -> Git transition.
+2020-01-20 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/93094
+ * gcc.dg/vect/pr93094.c: New testcase.
+
2020-01-19 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/analyzer/CVE-2005-1689-dedupe-issue.c: Ensure that all
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-O3 -fno-tree-pre" } */
+/* { dg-additional-options "-mavx512bw" { target x86_64-*-* i?86-*-* } } */
+
+void
+ll (char *un, char *rr, int te, int fp, int nb)
+{
+ const int xe = nb & 1;
+
+ while (fp-- != 0)
+ {
+ if ((rr[0] & xe) == 0)
+ un[0] = 0;
+
+ un += te;
+ rr += te;
+ }
+}
*COND_EXPR_STMT_LIST. */
class loop *
-vect_loop_versioning (loop_vec_info loop_vinfo)
+vect_loop_versioning (loop_vec_info loop_vinfo,
+ gimple *loop_vectorized_call)
{
class loop *loop = LOOP_VINFO_LOOP (loop_vinfo), *nloop;
class loop *scalar_loop = LOOP_VINFO_SCALAR_LOOP (loop_vinfo);
if-conversion re-use that. Note we cannot re-use the copy of
an if-converted outer-loop when vectorizing the inner loop only. */
gcond *cond;
- gimple *call;
if ((!loop_to_version->inner || loop == loop_to_version)
- && (call = vect_loop_vectorized_call (loop_to_version, &cond)))
+ && loop_vectorized_call)
{
gcc_assert (scalar_loop);
- condition_bb = gimple_bb (cond);
+ condition_bb = gimple_bb (loop_vectorized_call);
+ cond = as_a <gcond *> (last_stmt (condition_bb));
gimple_cond_set_condition_from_tree (cond, cond_expr);
update_stmt (cond);
if (cond_expr_stmt_list)
{
- cond_exp_gsi = gsi_for_stmt (call);
+ cond_exp_gsi = gsi_for_stmt (loop_vectorized_call);
gsi_insert_seq_before (&cond_exp_gsi, cond_expr_stmt_list,
GSI_SAME_STMT);
}
Returns scalar epilogue loop if any. */
class loop *
-vect_transform_loop (loop_vec_info loop_vinfo)
+vect_transform_loop (loop_vec_info loop_vinfo, gimple *loop_vectorized_call)
{
class loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
class loop *epilogue = NULL;
if (LOOP_REQUIRES_VERSIONING (loop_vinfo))
{
class loop *sloop
- = vect_loop_versioning (loop_vinfo);
+ = vect_loop_versioning (loop_vinfo, loop_vectorized_call);
sloop->force_vectorize = false;
check_profitability = false;
}
"loop vectorized using variable length vectors\n");
}
- loop_p new_loop = vect_transform_loop (loop_vinfo);
+ loop_p new_loop = vect_transform_loop (loop_vinfo,
+ loop_vectorized_call);
(*num_vectorized_loops)++;
/* Now that the loop has been vectorized, allow it to be unrolled
etc. */
extern bool slpeel_can_duplicate_loop_p (const class loop *, const_edge);
class loop *slpeel_tree_duplicate_loop_to_edge_cfg (class loop *,
class loop *, edge);
-class loop *vect_loop_versioning (loop_vec_info);
+class loop *vect_loop_versioning (loop_vec_info, gimple *);
extern class loop *vect_do_peeling (loop_vec_info, tree, tree,
tree *, tree *, tree *, int, bool, bool,
tree *);
extern stmt_vec_info info_for_reduction (stmt_vec_info);
/* Drive for loop transformation stage. */
-extern class loop *vect_transform_loop (loop_vec_info);
+extern class loop *vect_transform_loop (loop_vec_info, gimple *);
extern opt_loop_vec_info vect_analyze_loop_form (class loop *,
vec_info_shared *);
extern bool vectorizable_live_operation (stmt_vec_info, gimple_stmt_iterator *,