when MergeBlockIntoPredecessor merges two blocks, update MemDep if it
authorChris Lattner <sabre@nondot.org>
Tue, 11 Jan 2011 08:16:49 +0000 (08:16 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 11 Jan 2011 08:16:49 +0000 (08:16 +0000)
is floating around in the ether.

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

lib/Transforms/Utils/BasicBlockUtils.cpp

index 40d33d15afc2fb394b7d4a901d191d2e9be4fe61..e71e84feac41fd92af2d881176c395e8a6ed0631 100644 (file)
@@ -179,6 +179,10 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, Pass *P) {
       
       if (LoopInfo *LI = P->getAnalysisIfAvailable<LoopInfo>())
         LI->removeBlock(BB);
+      
+      if (MemoryDependenceAnalysis *MD =
+            P->getAnalysisIfAvailable<MemoryDependenceAnalysis>())
+        MD->invalidateCachedPredecessors();
     }
   }