[PATCH] D90343: [POC][LoopVectorizer] Vectorize a simple loop with a scalable VF.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 14:09:40 PDT 2020


sdesmalen created this revision.
Herald added subscribers: dexonsmith, dmgreen, hiraditya.
Herald added a project: LLVM.
sdesmalen requested review of this revision.

This patch is part of a proof of concept for vectorising a loop using 
scalable vectors. The patch is shared for reference and there is no
expectation for this patch to land in the current form.

- Removed a bunch of asserts that were previously added to prevent vectorization for scalable VFs.
- 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 vectorizes:

  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;
    }   
  }   


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90343

Files:
  llvm/include/llvm/IR/IRBuilder.h
  llvm/lib/IR/IRBuilder.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/scalable-loop-unpredicated-body-scalar-tail.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90343.301423.patch
Type: text/x-patch
Size: 18290 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201028/d91a4705/attachment.bin>


More information about the llvm-commits mailing list