forked from OSchip/llvm-project
Fix scalarrepl to not 'miscompile' undefined code, part #2.
This fixes the store case, my previous patch just fixed the load case. rdar://5707076. llvm-svn: 46932
This commit is contained in:
parent
3050f74a1d
commit
dcddd64424
|
@ -1150,7 +1150,7 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) {
|
|||
// 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);
|
||||
|
|
Loading…
Reference in New Issue