Add support to scalar replacement for partial vector accesses of an alloca, e.g.
authorCameron Zwarich <zwarich@apple.com>
Wed, 9 Mar 2011 05:43:05 +0000 (05:43 +0000)
committerCameron Zwarich <zwarich@apple.com>
Wed, 9 Mar 2011 05:43:05 +0000 (05:43 +0000)
commitb2fd770136b92637c5f084b743eab29f910288d5
tree133f3f8350b6a2b6bb456655888deeb78d4e8de5
parentc9ecd14cee020f884313b60f8696384d3e7848f7
Add support to scalar replacement for partial vector accesses of an alloca, e.g.
a union of a float, <2 x float>, and <4 x float>. This mostly comes up with the
use of vector intrinsics, especially in NEON when programmers know the layout of
the register file. This enables codegen to eliminate a lot of the subregister
traffic it would otherwise generate.

This commit only enables this for a small number of floating-point cases, but a
lot more integer cases. I assume this is okay for all ports, but I did not do
extensive testing of the quality of code involving i512 vectors and the like. If
there is a use case where this generates worse code than before, let me know and
we can scale it back.

This fixes <rdar://problem/9036264>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127317 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/ScalarReplAggregates.cpp
test/Transforms/ScalarRepl/vector_promote.ll