[PowerPC] Try harder to find a base+offset when looking for consecutive accesses
authorHal Finkel <hfinkel@anl.gov>
Thu, 3 Sep 2015 22:37:44 +0000 (22:37 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 3 Sep 2015 22:37:44 +0000 (22:37 +0000)
commite1cc054190a9cdf28a1c0eb03dd748febf8d2019
treed4532ab1aeb6452efe94ece7ca20b88f68dc10ad
parentdc0eb17133567488576c3541a450665d51c3a3bb
[PowerPC] Try harder to find a base+offset when looking for consecutive accesses

When forming permutation-based unaligned vector loads, we need to know whether
it is valid to read ahead of the requested address by a full vector length.
Doing so is more efficient (and allows for more CSE with later loads), but
could trigger a page fault if invalid. To determine validity, we look for other
loads in the same block that access the relevant address range.

The relevant point here is that we need to do this as part of the process of
forming permutation-based vector loads, and this happens quite early in the
SDAG pipeline - specifically before many of the address calculations are fully
canonicalized. As a result, we need to try harder to recognize base+offset
address computations, because they still might appear as chain of adds
(base+offset+offset, for example). To account for this, we'll look through
chains of adds, accumulating the constant offsets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246813 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
test/CodeGen/PowerPC/qpx-unal-cons-lds.ll [new file with mode: 0644]