[LoopVectorizer][SVE] Vectorize a simple loop with with a scalable VF.
authorSander de Smalen <sander.desmalen@arm.com>
Tue, 8 Dec 2020 14:20:04 +0000 (14:20 +0000)
committerSander de Smalen <sander.desmalen@arm.com>
Wed, 9 Dec 2020 11:25:21 +0000 (11:25 +0000)
commitd568cff696e8fb89ce1b040561c037412767af60
tree682bb4d9750172ed760ffdc31e26df4f89c35477
parentadc37145dec9cadf76af05326150ed22a3cc2fdd
[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
llvm/include/llvm/IR/IRBuilder.h
llvm/lib/IR/IRBuilder.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/test/Transforms/LoopVectorize/metadata-width.ll
llvm/test/Transforms/LoopVectorize/scalable-loop-unpredicated-body-scalar-tail.ll [new file with mode: 0644]