Skip to content

Assertion "Request for a fixed element count on a scalable object" failed, vectorizer crashing with -Rpass=loop-vectorize #160792

@namikukr-qc

Description

@namikukr-qc

Ran into a crash recently with the vectorizer while trying to build something. Note that this crash only happens if -Rpass=loop-vectorize is enabled.

Reproducer: https://godbolt.org/z/Ms47v6Eea
Note: using the x86 trunk for the assertions build since there doesn't seem to one for armv8-a.

Can't seem to reproduce it while giving the resulting IR into llc to produce assembly.

Seems to be associated with commit 1858532 (tag: @fhahn ).

Source C code used to produce the issue:

void foo(int *a, int *b, int *c) {
  int i;
  int temp;
  int *ptr = a;

  long qval;

  for (i = 0; i < 64; i++) {
    qval = b[i];
    temp = c[i];
    if (temp < 0) {
      temp += qval >> 1;
      temp /= qval;
    }
    ptr[i] = temp;
  }
}

int main(int argc, char **argv) {
  int a[] = {5, 3, 4, 5, 6, 7, 6};
  int b[] = {0, 1, 2, 3, 4, 5, 6};
  int c[] = {1, 2, 3, 4, 5, 6, 7};
  foo(a, b, c);
  return 0;
}

clang -march=armv8-a+sve -O3 -Rpass=loop-vectorize test.c -o test.s

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashPrefer [crash-on-valid] or [crash-on-invalid]vectorizers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions