Teach the rewriting of memcpy calls to support subvector copies.
authorChandler Carruth <chandlerc@gmail.com>
Mon, 17 Dec 2012 14:51:24 +0000 (14:51 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 17 Dec 2012 14:51:24 +0000 (14:51 +0000)
commit99a54942ae0fb6fdca03e91b2e492e9738fa4436
tree2d89b7446fc7cb60170726ba9c5b0e8c791ab7a0
parent3d170e64ca1af491e2aa58f882f93b8e8111eef8
Teach the rewriting of memcpy calls to support subvector copies.

This also cleans up a bit of the memcpy call rewriting by sinking some
irrelevant code further down and making the call-emitting code a bit
more concrete.

Previously, memcpy of a subvector would actually miscompile (!!!) the
copy into a single vector element copy. I have no idea how this ever
worked. =/ This is the memcpy half of PR14478 which we probably weren't
noticing previously because it didn't actually assert.

The rewrite relies on the newly refactored insert- and extractVector
functions to do the heavy lifting, and those are the same as used for
loads and stores which makes the test coverage a bit more meaningful
here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170338 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SROA.cpp
test/Transforms/SROA/vector-promotion.ll