[PATCH] D95139: [SVE][LoopVectorize] Add support for extracting the last lane of a scalable vector

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 07:44:02 PST 2021


david-arm created this revision.
david-arm added reviewers: sdesmalen, kmclaughlin, CarolineConcatto, c-rhodes, greened.
Herald added subscribers: NickHung, psnobl, rogfer01, hiraditya, tschuett.
Herald added a reviewer: efriedma.
david-arm requested review of this revision.
Herald added subscribers: llvm-commits, vkmr.
Herald added a project: LLVM.

There are certain loops like this below:

  for (int i = 0; i < n; i++) {
    a[i] = b[i] + 1;
    *inv = a[i];
  }

that can only be vectorised if we are able to extract the last lane of the
vectorised form of 'a[i]'. For fixed width vectors this already works since
we know at compile time what the final lane is, however for scalable vectors
this is a different story. This patch adds support for extracting the last
lane from a scalable vector using a runtime determined lane value. I have
added support to VPIteration for non-constant lanes that still permits the
caching of values. Whilst doing this work I couldn't find any explicit tests
for extracting the last lane values of fixed width vectors so I added tests
for both scalable and fixed width vectors.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95139

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/VPlan.h
  llvm/test/Transforms/LoopVectorize/AArch64/neon-extract-last-veclane.ll
  llvm/test/Transforms/LoopVectorize/AArch64/sve-extract-last-veclane.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95139.318200.patch
Type: text/x-patch
Size: 15789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210121/73d520a9/attachment.bin>


More information about the llvm-commits mailing list