HomePhabricator

[LoopVectorizer][SVE] Vectorize a simple loop with with a scalable VF.

Authored by sdesmalen on Dec 8 2020, 6:20 AM.

Description

[LoopVectorizer][SVE] Vectorize a simple loop with with a scalable VF.

  • Steps are scaled by vscale, a runtime value.
  • Changes to circumvent the cost-model for now (temporary) so that the cost-model can be implemented separately.

This can vectorize the following loop [1]:

void loop(int N, double *a, double *b) {
  #pragma clang loop vectorize_width(4, scalable)
  for (int i = 0; i < N; i++) {
    a[i] = b[i] + 1.0;
  }
}

[1] This source-level example is based on the pragma proposed
separately in D89031. This patch only implements the LLVM part.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D91077