[PATCH] D117900: [AArch64][SVE] Fold gather/scatter with 32bits when possible

Caroline via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 09:05:02 PST 2022


CarolineConcatto created this revision.
Herald added subscribers: psnobl, hiraditya, kristof.beyls, tschuett.
Herald added a reviewer: efriedma.
CarolineConcatto requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In AArch64ISelLowering.cpp this patch implements these folds:

1. GEP (%ptr, SHL ((splat(%offset) + stepvector(A)) << splat(B)))

into GEP (%ptr + (%offset<<shift), step_vector (A << B))
and

2. GEP (%ptr, (splat(%offset) + stepvector(A)))

into GEP ((%ptr + %offset), stepvector(A))

The above transform simplifies the index operand so that it can be expressed
as i32 elements.
This allows using only one gather/scatter assembly instruction instead of two.

Patch by Paul Walker (@paulwalker-arm).

Depends on D117794 <https://reviews.llvm.org/D117794> and D117863 <https://reviews.llvm.org/D117863>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117900

Files:
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/test/CodeGen/AArch64/sve-gather-scatter-addr-opts.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117900.402008.patch
Type: text/x-patch
Size: 21099 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220121/d51faaea/attachment.bin>


More information about the llvm-commits mailing list