[PATCH] D115863: [SVE][CodeGen] Use splice instruction when lowering VECTOR_SPLICE

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 16 01:10:47 PST 2021


david-arm created this revision.
david-arm added reviewers: sdesmalen, CarolineConcatto, kmclaughlin, peterwaller-arm.
Herald added subscribers: ctetreau, psnobl, hiraditya, tschuett.
Herald added a reviewer: efriedma.
david-arm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

For certain negative indices passed to the VECTOR_SPLICE operation
we can actually directly use the SVE splice instruction by creating
the appropriate predicate. The predicate needs to be constructed in
such a way that all but the last -idx elements are false. We can do
this efficiently using a combination of 'ptrue' (with the appropriate
fixed pattern, e.g. vl1, vl2, etc.) and 'rev'. The advantage of using
these instructions to generate the predicate is they do not set any
flags, unlike the whilelo instruction. This is critical when the splice
operation is in a loop, since we want MachineLICM to hoist the
predicate generation out of the loop.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115863

Files:
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/test/CodeGen/AArch64/named-vector-shuffles-sve.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115863.394784.patch
Type: text/x-patch
Size: 21267 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211216/19046f04/attachment.bin>


More information about the llvm-commits mailing list