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
// 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;
}
// Reprocess the instruction if desired.
if (RepeatInstruction) {
- --BI;
+ if (BI != BB->begin()) --BI;
MadeChange = true;
}
}