+2015-10-28 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/65962
+ * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
+ Avoid creating loop carried dependences also for outer loops
+ of the loop a use to replace is in.
+
2015-10-28 Richard Biener <rguenther@suse.de>
* common.opt (fchecking): New flag controlling flag_checking.
+2015-10-28 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/65962
+ * gcc.dg/vect/vect-62.c: Adjust.
+
2015-10-28 Richard Biener <rguenther@suse.de>
PR middle-end/68067
}
/* Multidimensional array. Aligned. The "inner" dimensions
- are invariant in the inner loop. Vectorizable, but the
- vectorizer detects that everything is invariant and that
- the loop is better left untouched. (it should be optimized away). */
+ are invariant in the inner loop. The outer loop is
+ vectorizable after invariant/store motion. */
for (i = 0; i < N; i++)
{
for (j = 0; j < N; j++)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
gimple *def_stmt = SSA_NAME_DEF_STMT (sprime);
basic_block def_bb = gimple_bb (def_stmt);
if (gimple_code (def_stmt) == GIMPLE_PHI
- && b->loop_father->header == def_bb)
+ && def_bb->loop_father->header == def_bb)
{
+ loop_p loop = def_bb->loop_father;
ssa_op_iter iter;
tree op;
bool found = false;
affine_iv iv;
def_bb = gimple_bb (SSA_NAME_DEF_STMT (op));
if (def_bb
- && flow_bb_inside_loop_p (b->loop_father, def_bb)
- && simple_iv (b->loop_father,
- b->loop_father, op, &iv, true))
+ && flow_bb_inside_loop_p (loop, def_bb)
+ && simple_iv (loop, loop, op, &iv, true))
{
found = true;
break;
print_generic_expr (dump_file, sprime, 0);
fprintf (dump_file, " which would add a loop"
" carried dependence to loop %d\n",
- b->loop_father->num);
+ loop->num);
}
/* Don't keep sprime available. */
sprime = NULL_TREE;