diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-02-26 05:30:08 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-02-26 05:30:08 +0000 |
commit | b660977c67e757bbcfb49e6a5f7c7872736ea7c9 (patch) | |
tree | b612d9ab0ecc0ff1e63cf53e2f3e9374521c7fee /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | |
parent | a1d6afeddfbe6428451a55472c33517feac8b6ef (diff) | |
download | bcm5719-llvm-b660977c67e757bbcfb49e6a5f7c7872736ea7c9.tar.gz bcm5719-llvm-b660977c67e757bbcfb49e6a5f7c7872736ea7c9.zip |
Don't call dominates on unreachable instructions. Should fix the dragonegg
build. Testcase is still reducing.
llvm-svn: 151474
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp index cfaf2da6ce5..3a544f35d50 100644 --- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -350,14 +350,18 @@ namespace { bool shouldExplore(Use *U) { Instruction *I = cast<Instruction>(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<Instruction>(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; |