This fixes the store case, my previous patch just fixed the load
case. rdar://
5707076.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46932
91177308-0d34-0410-b5e6-
96231b3b80d8
// then 'or' into place.
Value *SV = SI->getOperand(0);
const Type *AllocaType = NewAI->getType()->getElementType();
- if (SV->getType() == AllocaType) {
+ if (SV->getType() == AllocaType && Offset == 0) {
// All is well.
} else if (const VectorType *PTy = dyn_cast<VectorType>(AllocaType)) {
Value *Old = new LoadInst(NewAI, NewAI->getName()+".in", SI);