[PATCH] D82418: [SLP] Limit GEP lists based on width of index computation.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 16:11:46 PDT 2020


fhahn created this revision.
fhahn added reviewers: craig.topper, RKSimon, xbolva00, ABataev, spatel.
Herald added subscribers: arphaman, hiraditya, kristof.beyls.
Herald added a project: LLVM.

D68667 <https://reviews.llvm.org/D68667> introduced a tighter limit to the number of GEPs to simplify
together. The limit was based on the vector element size of the pointer,
but the pointers themselves are not actually put in vectors.

IIUC we try to vectorize the index computations here, so we should base
the limit on the vector element size of the computation of the index.

This restores the test regression on AArch64 and also restores the
vectorization for a important pattern in SPEC2006/464.h264ref on
AArch64 (@test_i16_extend). We get a large benefit from doing a single
load up front and then processing the index computations in vectors.

Note that we could probably even further improve the AArch64 codegen, if
we would do zexts to i32 instead of i64 for the sub operands and then do
a single vector sext on the result of the subtractions. AArch64 provides
dedicated vector instructions to do so. Sketch of proof in Alive:
https://alive2.llvm.org/ce/z/A4xYAB


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82418

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82418.272852.patch
Type: text/x-patch
Size: 14378 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200623/510deeb6/attachment.bin>


More information about the llvm-commits mailing list