When removing instructions from the analysis, be sure to check the confirmed
authorOwen Anderson <resistor@mac.com>
Fri, 20 Jul 2007 06:16:07 +0000 (06:16 +0000)
committerOwen Anderson <resistor@mac.com>
Fri, 20 Jul 2007 06:16:07 +0000 (06:16 +0000)
flag when determining what to do with dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40079 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemoryDependenceAnalysis.cpp

index 498e54c7272031e77ee3f2a9475715ee981718fb..3ec733f9e4c30756993bb11433d306a26a68cd0a 100644 (file)
@@ -248,7 +248,8 @@ Instruction* MemoryDependenceAnalysis::getDependency(Instruction* query,
 void MemoryDependenceAnalysis::removeInstruction(Instruction* rem) {
   // Figure out the new dep for things that currently depend on rem
   Instruction* newDep = NonLocal;
-  if (depGraphLocal[rem].first != NonLocal) {
+  if (depGraphLocal[rem].first != NonLocal &&
+      depGraphLocal[rem].second) {
     // If we have dep info for rem, set them to it
     BasicBlock::iterator RI = depGraphLocal[rem].first;
     RI++;