Skip to content

[vectorize-remark] the pass-analysis result inconsistent with the final assembly output #64636

Open
@vfdff

Description

@vfdff
void foo (int *restrict y, int *restrict x, int *restrict indices, int n) {
  for (int k = 0; k < 10; k++)
  for (int i = 0; i < n; i++) {
      y[i + k * M] = y[i + k* M] + 1;
      y[i + k * (M+1)] = indices[i] + 2;
  }
}
  • When I add option -Rpass-analysis=loop-vectorize, it reports :8:22: remark: loop not vectorized,but in the final output assemble, we get sve assemble code as following:
.LBB0_2:                                // =>This Inner Loop Header: Depth=1
        ld1w    { z0.s }, p0/z, [x2, x9, lsl #2]
        add     z0.s, z0.s, #2                  // =0x2
        st1w    { z0.s }, p0, [x0, x9, lsl #2]
        add     x9, x9, x10
        whilelo p0.s, x9, x8
        b.mi    .LBB0_2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions