When scalar replacement returns a vector type, only accept it if the vector
authorCameron Zwarich <zwarich@apple.com>
Sat, 18 Jun 2011 06:17:51 +0000 (06:17 +0000)
committerCameron Zwarich <zwarich@apple.com>
Sat, 18 Jun 2011 06:17:51 +0000 (06:17 +0000)
commit3ebb05d9a6bf6604a4b25770cfda1872983b03b2
treed7956f4983b57f4fb0569f20f3e28d651e258302
parentb85e4eba85a38698f3b3332f82554bf8442547e2
When scalar replacement returns a vector type, only accept it if the vector
type's bitwidth matches the (allocated) size of the alloca. This severely
pessimizes vector scalar replacement when the only vector type being used is
something like <3 x float> on x86 or ARM whose allocated size matches a
<4 x float>.

I hope to fix some of the flawed assumptions about allocated size throughout
scalar replacement and reenable this in most cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133338 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/ScalarReplAggregates.cpp
test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll
test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll