Prefer to duplicate PPC Altivec loads when expanding unaligned loads
authorHal Finkel <hfinkel@anl.gov>
Sun, 26 May 2013 18:08:30 +0000 (18:08 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sun, 26 May 2013 18:08:30 +0000 (18:08 +0000)
commit1907cad7c822f07894a1189886fa7577f109045a
treeb0f3d0701b5c644414398333635637b68c96a342
parentea991637e491a171571c7361b07a5e55f4c08307
Prefer to duplicate PPC Altivec loads when expanding unaligned loads

When expanding unaligned Altivec loads, we use the decremented offset trick to
prevent page faults. Unfortunately, if we have a sequence of consecutive
unaligned loads, this leads to suboptimal code generation because the 'extra'
load from the first unaligned load can be combined with the base load from the
second (but only if the decremented offset trick is not used for the first).
Search up and down the chain, through loads and token factors, looking for
consecutive loads, and if one is found, don't use the offset reduction trick.
These duplicate loads are later combined to yield the desired sequence (in the
future, we might want a more-powerful chain search, but that will require some
changes to allow the combiner routines to access the AA object).

This should complete the initial implementation of the optimized unaligned
Altivec load expansion. There is some refactoring that should be done, but
that will happen when the unaligned store expansion is added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182719 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
test/CodeGen/PowerPC/unal-altivec.ll