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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu.org

--- Comment #22 from Richard Biener <rguenth at gcc dot gnu.org> ---
Creating dr for aa[_13]
analyze_innermost: success.
        base_address: &aa
        offset from base address: (ssizetype) ((sizetype) i_35 * 8)
        constant offset from base address: -8
        step: 32
        base alignment: 16
        base misalignment: 0
        offset alignment: 8
        step alignment: 32
        base_object: aa
        Access function 0: {{0, +, 1}_1, +, 4}_2

but somehow we computed dr_info->misalignment of zero and thus we classify
this as dr_aligned.  Previously the gap code disqualified SLP use and
avoided this latent issue.

t.f:14:12: note:   inner step divides the vector alignment.
t.f:14:12: missed:   misalign = 0 bytes of ref aa[_13]

it's a bit odd - vect_compute_data_ref_alignment does

  innermost_loop_behavior *drb = vect_dr_behavior (vinfo, dr_info);

but vect_dr_behavior in this case returns &STMT_VINFO_DR_WRT_VEC_LOOP
(stmt_info) because the access is in the inner loop:

  if (loop_vinfo == NULL
      || !nested_in_vect_loop_p (LOOP_VINFO_LOOP (loop_vinfo), stmt_info))
    return &DR_INNERMOST (dr_info->dr);
  else
    return &STMT_VINFO_DR_WRT_VEC_LOOP (stmt_info);

with respect to the outer loop the access is computed misaligned through
step_alignment

$8 = {base_address = <addr_expr 0x7ffff683a140>, 
  offset = <integer_cst 0x7ffff68256c0>, init = <integer_cst 0x7ffff68256c0>, 
  step = <integer_cst 0x7ffff68256d8>, base_alignment = 16, 
  base_misalignment = 0, offset_alignment = 128, step_alignment = 8}

and misaligned with respect to the inner loop via offset_alignment:

$12 = {base_address = <addr_expr 0x7ffff68342c0>, 
  offset = <nop_expr 0x7ffff683a000>, init = <integer_cst 0x7ffff68309d8>, 
  step = <integer_cst 0x7ffff6830a50>, base_alignment = 16, 
  base_misalignment = 0, offset_alignment = 8, step_alignment = 32}

but we seem to only look at offset_alignment of one and step_alignment of
the other data piece.  It seems to me the innermost behavior should
cover the outer step via offset_alignment (but maybe I'm wrong).

Still this seems to be a quite old issue.  It seems to me we have to
consider both for the nested case, thus the 'else' arm should be
unconditional and use 'drb'.

I'm testing a patch.

Reply via email to