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 | 8a629577f89869f9810065dc61afd7e4302d3e46 (patch) | |
tree | 5dbef721f8add4e2905ba78b750118db3aa5db02 /lib/Transforms/Scalar/MemCpyOptimizer.cpp | |
parent | 0468e3e2654cdd0ede16efa025161ce39785eb8d (diff) | |
download | external_llvm-8a629577f89869f9810065dc61afd7e4302d3e46.zip external_llvm-8a629577f89869f9810065dc61afd7e4302d3e46.tar.gz external_llvm-8a629577f89869f9810065dc61afd7e4302d3e46.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123091 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/MemCpyOptimizer.cpp')
-rw-r--r-- | lib/Transforms/Scalar/MemCpyOptimizer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/lib/Transforms/Scalar/MemCpyOptimizer.cpp index 76fab1c..102eab6 100644 --- a/lib/Transforms/Scalar/MemCpyOptimizer.cpp +++ b/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; } } |