gcc.dg/tree-ssa/pr94969.c. */
if (DDR_NUM_DIST_VECTS (ddr) != 1)
this_dir = 2;
- /* If the overlap is exact preserve stmt order. */
- else if (lambda_vector_zerop (DDR_DIST_VECT (ddr, 0),
- DDR_NB_LOOPS (ddr)))
- ;
- /* Else as the distance vector is lexicographic positive swap
- the dependence direction. */
else
{
- if (DDR_REVERSED_P (ddr))
- this_dir = -this_dir;
- this_dir = -this_dir;
-
+ /* If the overlap is exact preserve stmt order. */
+ if (lambda_vector_zerop (DDR_DIST_VECT (ddr, 0),
+ DDR_NB_LOOPS (ddr)))
+ ;
+ /* Else as the distance vector is lexicographic positive swap
+ the dependence direction. */
+ else
+ {
+ if (DDR_REVERSED_P (ddr))
+ this_dir = -this_dir;
+ this_dir = -this_dir;
+ }
/* When then dependence distance of the innermost common
loop of the DRs is zero we have a conflict. */
auto l1 = gimple_bb (DR_STMT (dr1))->loop_father;
auto l2 = gimple_bb (DR_STMT (dr2))->loop_father;
int idx = index_in_loop_nest (find_common_loop (l1, l2)->num,
DDR_LOOP_NEST (ddr));
- if (DDR_DIST_VECT (ddr, 0)[idx] == 0)
+ if (DDR_DIST_VECT (ddr, 0)[idx] == 0
+ /* Unless it is the outermost loop which is the one
+ we eventually distribute. */
+ && idx != 0)
this_dir = 2;
}
}