forked from OSchip/llvm-project
parent
47981226d5
commit
5ca37b274c
|
@ -503,7 +503,6 @@ void SROA::isSafeElementUse(Value *Ptr, bool isFirstElt, AllocaInst *AI,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
isSafeElementUse(GEP, AreAllZeroIndices, AI, Info);
|
isSafeElementUse(GEP, AreAllZeroIndices, AI, Info);
|
||||||
if (Info.isUnsafe) return;
|
if (Info.isUnsafe) return;
|
||||||
break;
|
break;
|
||||||
|
@ -1481,7 +1480,8 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, uint64_t Offset) {
|
||||||
if (StoreInst *SI = dyn_cast<StoreInst>(User)) {
|
if (StoreInst *SI = dyn_cast<StoreInst>(User)) {
|
||||||
assert(SI->getOperand(0) != Ptr && "Consistency error!");
|
assert(SI->getOperand(0) != Ptr && "Consistency error!");
|
||||||
// FIXME: Remove once builder has Twine API.
|
// FIXME: Remove once builder has Twine API.
|
||||||
Value *Old = Builder.CreateLoad(NewAI, (NewAI->getName()+".in").str().c_str());
|
Value *Old = Builder.CreateLoad(NewAI,
|
||||||
|
(NewAI->getName()+".in").str().c_str());
|
||||||
Value *New = ConvertScalar_InsertValue(SI->getOperand(0), Old, Offset,
|
Value *New = ConvertScalar_InsertValue(SI->getOperand(0), Old, Offset,
|
||||||
Builder);
|
Builder);
|
||||||
Builder.CreateStore(New, NewAI);
|
Builder.CreateStore(New, NewAI);
|
||||||
|
@ -1506,7 +1506,8 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, uint64_t Offset) {
|
||||||
APVal |= APVal << 8;
|
APVal |= APVal << 8;
|
||||||
|
|
||||||
// FIXME: Remove once builder has Twine API.
|
// FIXME: Remove once builder has Twine API.
|
||||||
Value *Old = Builder.CreateLoad(NewAI, (NewAI->getName()+".in").str().c_str());
|
Value *Old = Builder.CreateLoad(NewAI,
|
||||||
|
(NewAI->getName()+".in").str().c_str());
|
||||||
Value *New = ConvertScalar_InsertValue(
|
Value *New = ConvertScalar_InsertValue(
|
||||||
ConstantInt::get(User->getContext(), APVal),
|
ConstantInt::get(User->getContext(), APVal),
|
||||||
Old, Offset, Builder);
|
Old, Offset, Builder);
|
||||||
|
|
Loading…
Reference in New Issue