https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113431

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org
           Priority|P3                          |P1

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
Looks like a dependence issue - we vectorize it as

  _24 = a[0][1];
  vect_cst__13 = {_24, _24, _24, _24};
  mask__19.9_3 = { 0, 0, 0, 0 } == vect_cst__13;
  vect_patt_31.10_1 = VEC_COND_EXPR <mask__19.9_3, { 1, 1, 1, 1 }, { 0, 0, 0, 0
}>;

  <bb 3> [local count: 29488088]:
  # b.2_66 = PHI <_4(5), 0(2)>
  # ivtmp_45 = PHI <ivtmp_38(5), 2(2)>
  # ivtmp_8 = PHI <ivtmp_14(5), &MEM <int[2][9]> [(void *)&a + 4B](2)>
  # ivtmp_23 = PHI <ivtmp_25(5), 0(2)>
  _18 = a[0][1];
  _19 = _18 == 0;
  _20 = (int) _19;
  MEM <vector(4) int> [(int *)ivtmp_8] = vect_patt_31.10_1;
  MEM <vector(4) int> [(int *)ivtmp_8 + 16B] = vect_patt_31.10_1;
  ivtmp_22 = ivtmp_8 + 36;
  _4 = b.2_66 + 1;
  ivtmp_38 = ivtmp_45 - 1;
  ivtmp_14 = ivtmp_8 + 36;
  ivtmp_25 = ivtmp_23 + 1;
  if (ivtmp_25 < 2)
    goto <bb 5>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 5> [local count: 14744044]:
  goto <bb 3>; [100.00%]

(compute_affine_dependence
  ref_a: a[0][1], stmt_a: _18 = a[0][1];
  ref_b: a[b.2_66][1], stmt_b: a[b.2_66][1] = _20;
(analyze_overlapping_iterations
  (chrec_a = 1)
  (chrec_b = 1)
(analyze_ziv_subscript
)
  (overlap_iterations_a = [0])
  (overlap_iterations_b = [0]))
(analyze_overlapping_iterations
  (chrec_a = 0)
  (chrec_b = {0, +, 1}<nw>_1)
(analyze_siv_subscript
)
  (overlap_iterations_a = [0])
  (overlap_iterations_b = [0]))
(Dependence relation cannot be represented by distance vector.)
)

t.c:8:21: missed:   versioning for alias required: bad dist vector for a[0][1]
and a[b.2_66][1]
consider run-time aliasing test between a[0][1] and a[b.2_66][1]

that looks OK, but we're not emitting such alias test.  We're using SLP
since we can handle non-grouped loads (guess that what it will bisect to).
Then:

t.c:6:16: note:   === vect_prune_runtime_alias_test_list ===
t.c:6:16: note:   no need for alias check between a[0][1] and a[b.2_66][1] when
VF is 1
t.c:6:16: note:   improved number of alias checks from 1 to 0

which is then obviously wrong.

Reply via email to