1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

fix a latent bug in memcpyoptimizer that my recent patches exposed: it wasn't

updating memdep when fusing stores together.  This fixes the crash optimizing
the bullet benchmark.

llvm-svn: 123091
This commit is contained in:
Chris Lattner 2011-01-08 22:19:21 +00:00
parent 563e57abbd
commit 7df7b47828

View File

@ -456,8 +456,10 @@ Instruction *MemCpyOpt::tryMergingIntoMemset(Instruction *StartInst,
// Zap all the stores.
for (SmallVector<Instruction*, 16>::const_iterator
SI = Range.TheStores.begin(),
SE = Range.TheStores.end(); SI != SE; ++SI)
SE = Range.TheStores.end(); SI != SE; ++SI) {
MD->removeInstruction(*SI);
(*SI)->eraseFromParent();
}
++NumMemSetInfer;
}
@ -912,7 +914,7 @@ bool MemCpyOpt::iterateOnFunction(Function &F) {
// Reprocess the instruction if desired.
if (RepeatInstruction) {
--BI;
if (BI != BB->begin()) --BI;
MadeChange = true;
}
}