[PATCH] D49428: [LSV] Look through selects for consecutive addresses

Roman Tereshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 09:22:18 PDT 2018


rtereshin created this revision.
rtereshin added reviewers: volkan, arsenm, rampitec.
Herald added subscribers: llvm-commits, nhaehnle, wdng.

In some cases LSV sees `(load/store _ (select _ <pointer expression> <pointer expression>))`
patterns in input IR, often due to sinking and other forms of CFG simplification, sometimes
interspersed with bitcasts and all-constant-indices GEPs. With this patch`areConsecutivePointers`
method would attempt to handle select instructions. This leads to an increased number of
successful vectorizations.

Technically, select instructions could appear in index arithmetic as well, however, we don't see
those in our test suites / benchmarks. Also, there is a lot more freedom in IR shapes computing
integral indices in general than in what's common in pointer computations, and it appears that
it's quite unreliable to do anything short of  making select instructions first class citizens of
Scalar Evolution, which for the purposes of this patch is most definitely an overkill.


Repository:
  rL LLVM

https://reviews.llvm.org/D49428

Files:
  lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
  test/Transforms/LoadStoreVectorizer/AMDGPU/selects.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49428.155897.patch
Type: text/x-patch
Size: 11441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180717/7f910687/attachment.bin>


More information about the llvm-commits mailing list