Skip to content

SLP Vectorizer Options trigger Assertion in cost computation on s390x #143513

Closed
@dominik-steenken

Description

@dominik-steenken

While running experiments with csmith, i ran into the following example (already reduced with cvise):

static int c[][10];
short d;
long *e;
long f;
int g, k;
char h, i;
static int j[3];
void l();
static int *m() {
  short *n = &d;
  d = 0;
  for (; d <= 2;)
    if (*n)
      ;
    else
      return j;
  return &g;
}
void p() { l(); }
void l() {
  int *q;
  h = 0;
  for (; h <= 6; h++) {
    int **r = &q;
    *e = 4073709551615;
    *r = m();
    k = 0;
    for (; k <= 6; k++) {
      i = 2;
      for (; i <= 6; i++)
        **r |= c[k][h] ^= f;
    }
  }
}

When compiling this with the options

  -O3 \
  -S \
  -w \
  -c \
  -o a.out \
  --target=s390x-ibm-linux \
  -march=z13 \
  -mllvm -slp-max-reg-size=256 \
  -mllvm -slp-vectorize-hor-store \
  -mllvm -slp-vectorize-non-power-of-2 \
  -mllvm -enable-tbaa=false \

The assertion (Idx + EltsPerVector) <= BaseVF && "SK_ExtractSubvector index out of range" fails in llvm::slpvectorizer::BoUpSLP::ShuffleCostEstimator::computeExtractCost. This does not seem to be an issue on X86.

repro.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions