[llvm-commits] [llvm] r123091 - /llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
Chris Lattner
sabre at nondot.org
Sat Jan 8 14:19:21 PST 2011
Author: lattner
Date: Sat Jan 8 16:19:21 2011
New Revision: 123091
URL: http://llvm.org/viewvc/llvm-project?rev=123091&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=123091&r1=123090&r2=123091&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Sat Jan 8 16:19:21 2011
@@ -456,8 +456,10 @@
// 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 @@
// Reprocess the instruction if desired.
if (RepeatInstruction) {
- --BI;
+ if (BI != BB->begin()) --BI;
MadeChange = true;
}
}
More information about the llvm-commits
mailing list