aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/SROA.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-04-07 11:47:54 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-04-07 11:47:54 +0000
commit05c7e7f99dfa1ff353c3d13e71143b61baa583f6 (patch)
tree70c8f1cbbfd619ec8be31181053fff399c8191c7 /lib/Transforms/Scalar/SROA.cpp
parent3aea7cb7b2c54071fc273a0c3a97850bd14de5ac (diff)
downloadexternal_llvm-05c7e7f99dfa1ff353c3d13e71143b61baa583f6.zip
external_llvm-05c7e7f99dfa1ff353c3d13e71143b61baa583f6.tar.gz
external_llvm-05c7e7f99dfa1ff353c3d13e71143b61baa583f6.tar.bz2
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
Diffstat (limited to 'lib/Transforms/Scalar/SROA.cpp')
-rw-r--r--lib/Transforms/Scalar/SROA.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp
index f6bb365..1e18873 100644
--- a/lib/Transforms/Scalar/SROA.cpp
+++ b/lib/Transforms/Scalar/SROA.cpp
@@ -2671,6 +2671,7 @@ private:
StoreInst *NewSI;
if (BeginOffset == NewAllocaBeginOffset &&
+ EndOffset == NewAllocaEndOffset &&
canConvertValue(TD, V->getType(), NewAllocaTy)) {
V = convertValue(TD, IRB, V, NewAllocaTy);
NewSI = IRB.CreateAlignedStore(V, &NewAI, NewAI.getAlignment(),