Skip to content
Snippets Groups Projects
Commit 7d6433ae authored by Chris Lattner's avatar Chris Lattner
Browse files

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
parent ff6ed2ac
No related branches found
No related tags found
No related merge requests found
...@@ -456,8 +456,10 @@ Instruction *MemCpyOpt::tryMergingIntoMemset(Instruction *StartInst, ...@@ -456,8 +456,10 @@ Instruction *MemCpyOpt::tryMergingIntoMemset(Instruction *StartInst,
// Zap all the stores. // Zap all the stores.
for (SmallVector<Instruction*, 16>::const_iterator for (SmallVector<Instruction*, 16>::const_iterator
SI = Range.TheStores.begin(), SI = Range.TheStores.begin(),
SE = Range.TheStores.end(); SI != SE; ++SI) SE = Range.TheStores.end(); SI != SE; ++SI) {
MD->removeInstruction(*SI);
(*SI)->eraseFromParent(); (*SI)->eraseFromParent();
}
++NumMemSetInfer; ++NumMemSetInfer;
} }
...@@ -912,7 +914,7 @@ bool MemCpyOpt::iterateOnFunction(Function &F) { ...@@ -912,7 +914,7 @@ bool MemCpyOpt::iterateOnFunction(Function &F) {
// Reprocess the instruction if desired. // Reprocess the instruction if desired.
if (RepeatInstruction) { if (RepeatInstruction) {
--BI; if (BI != BB->begin()) --BI;
MadeChange = true; MadeChange = true;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment