From 5465c9422f3d755f42c49fa1f635962412470e96 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sun, 26 Feb 2012 05:30:08 +0000 Subject: [PATCH] Don't call dominates on unreachable instructions. Should fix the dragonegg build. Testcase is still reducing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151474 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/MemoryDependenceAnalysis.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index cfaf2da6ce5..3a544f35d50 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -350,14 +350,18 @@ namespace { bool shouldExplore(Use *U) { Instruction *I = cast(U->getUser()); - if (BeforeHere != I && DT->dominates(BeforeHere, I)) + BasicBlock *BB = I->getParent(); + if (BeforeHere != I && + (!DT->isReachableFromEntry(BB) || DT->dominates(BeforeHere, I))) return false; return true; } bool captured(Use *U) { Instruction *I = cast(U->getUser()); - if (BeforeHere != I && DT->dominates(BeforeHere, I)) + BasicBlock *BB = I->getParent(); + if (BeforeHere != I && + (!DT->isReachableFromEntry(BB) || DT->dominates(BeforeHere, I))) return false; Captured = true; return true; -- 2.34.1