Fix PR15674 (and PR15603): a SROA think-o.
authorChandler Carruth <chandlerc@gmail.com>
Sun, 7 Apr 2013 11:47:54 +0000 (11:47 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 7 Apr 2013 11:47:54 +0000 (11:47 +0000)
commit05c7e7f99dfa1ff353c3d13e71143b61baa583f6
tree70c8f1cbbfd619ec8be31181053fff399c8191c7
parent3aea7cb7b2c54071fc273a0c3a97850bd14de5ac
Fix PR15674 (and PR15603): a SROA think-o.

The fix for PR14972 in r177055 introduced a real think-o in the *store*
side, likely because I was much more focused on the load side. While we
can arbitrarily widen (or narrow) a loaded value, we can't arbitrarily
widen a value to be stored, as that changes the width of memory access!
Lock down the code path in the store rewriting which would do this to
only handle the intended circumstance.

All of the existing tests continue to pass, and I've added a test from
the PR.

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