diff options
author | Chris Lattner <sabre@nondot.org> | 2011-01-08 22:19:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-01-08 22:19:21 +0000 |
commit | 7d6433ae76802243e5655cba8fcd0af4e3fc42ad (patch) | |
tree | 813e1f93015e11654e321cc913135d16b96ea61e /llvm | |
parent | ff6ed2ac5f3d7009b9dc51a29c2e033defbf9acb (diff) | |
download | bcm5719-llvm-7d6433ae76802243e5655cba8fcd0af4e3fc42ad.tar.gz bcm5719-llvm-7d6433ae76802243e5655cba8fcd0af4e3fc42ad.zip |
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
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp index 76fab1cd281..102eab65f2f 100644 --- a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp +++ b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp @@ -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; } } |