From e2523b287cc52e9908e615d06ae249caa9b3e416 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 11 Jan 2011 08:16:49 +0000 Subject: [PATCH] when MergeBlockIntoPredecessor merges two blocks, update MemDep if it is floating around in the ether. llvm-svn: 123223 --- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index 40d33d15afc2..e71e84feac41 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -179,6 +179,10 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, Pass *P) { if (LoopInfo *LI = P->getAnalysisIfAvailable()) LI->removeBlock(BB); + + if (MemoryDependenceAnalysis *MD = + P->getAnalysisIfAvailable()) + MD->invalidateCachedPredecessors(); } }