+2014-02-14 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-vect-loop.c (vect_is_slp_reduction): Don't set
+ use_stmt twice.
+ (get_initial_def_for_induction, vectorizable_induction): Ignore
+ debug stmts when looking for exit_phi.
+ (vectorizable_live_operation): Fix up condition.
+
2014-02-14 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32.c (nds32_asm_function_prologue): Do not use
--- /dev/null
+static unsigned short
+foo (unsigned char *x, int y)
+{
+ unsigned short r = 0;
+ int i;
+ for (i = 0; i < y; i++)
+ r += x[i];
+ return r;
+}
+
+int baz (int, unsigned short);
+
+void
+bar (unsigned char *x, unsigned char *y)
+{
+ int i;
+ unsigned short key = foo (x, 0x10000);
+ baz (0, 0);
+ for (i = 0; i < 0x80000; i++)
+ y[i] = x[baz (i, key)];
+}
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, lhs)
{
gimple use_stmt = USE_STMT (use_p);
- if (is_gimple_debug (use_stmt))
- continue;
-
- use_stmt = USE_STMT (use_p);
+ if (is_gimple_debug (use_stmt))
+ continue;
/* Check if we got back to the reduction phi. */
if (use_stmt == phi)
exit_phi = NULL;
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, loop_arg)
{
- if (!flow_bb_inside_loop_p (iv_loop, gimple_bb (USE_STMT (use_p))))
+ gimple use_stmt = USE_STMT (use_p);
+ if (is_gimple_debug (use_stmt))
+ continue;
+
+ if (!flow_bb_inside_loop_p (iv_loop, gimple_bb (use_stmt)))
{
- exit_phi = USE_STMT (use_p);
+ exit_phi = use_stmt;
break;
}
}
loop_arg = PHI_ARG_DEF_FROM_EDGE (phi, latch_e);
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, loop_arg)
{
- if (!flow_bb_inside_loop_p (loop->inner,
- gimple_bb (USE_STMT (use_p))))
+ gimple use_stmt = USE_STMT (use_p);
+ if (is_gimple_debug (use_stmt))
+ continue;
+
+ if (!flow_bb_inside_loop_p (loop->inner, gimple_bb (use_stmt)))
{
- exit_phi = USE_STMT (use_p);
+ exit_phi = use_stmt;
break;
}
}
{
gimple use_stmt = USE_STMT (use_p);
if (gimple_code (use_stmt) == GIMPLE_PHI
- || gimple_bb (use_stmt) == merge_bb)
+ && gimple_bb (use_stmt) == merge_bb)
{
if (vec_stmt)
{