OSDN Git Service

[LSV] Look through selects for consecutive addresses
authorRoman Tereshin <rtereshin@apple.com>
Wed, 25 Jul 2018 21:33:00 +0000 (21:33 +0000)
committerRoman Tereshin <rtereshin@apple.com>
Wed, 25 Jul 2018 21:33:00 +0000 (21:33 +0000)
commit406c0440c5fc7bca370641f3f0a2d36940c88861
tree18ac54d86a7e7b74ebb264a7a180c253a9a29f41
parentd73322deb3b99030d7cdbf5b304a3fbacbb17a4a
[LSV] Look through selects for consecutive addresses

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.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D49428

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337965 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
test/Transforms/LoadStoreVectorizer/AMDGPU/selects.ll [new file with mode: 0644]