Fix Regression/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25587 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-01-24 19:36:27 +00:00
parent 720d2108be
commit 15256cb14e

View File

@ -554,9 +554,7 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) {
// Convert the stored type to the actual type, shift it left to insert
// then 'or' into place.
Value *SV = SI->getOperand(0);
if (SV->getType() == NewAI->getType()->getElementType()) {
assert(Offset == 0 && "Store out of bounds!");
} else {
if (SV->getType() != NewAI->getType()->getElementType() || Offset != 0) {
Value *Old = new LoadInst(NewAI, NewAI->getName()+".in", SI);
// If SV is signed, convert it to unsigned, so that the next cast zero
// extends the value.