diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-02-26 01:50:14 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-02-26 01:50:14 +0000 |
commit | 8c727f9200cd54adc4a1b742950e80035bc53a20 (patch) | |
tree | 2b9986ec2c0f65a797d3c6edab4632deeaec2cd7 /lib/Analysis/InstructionSimplify.cpp | |
parent | 6fd3428afa46ace6712f0649bf4a7bd6799cc355 (diff) | |
download | external_llvm-8c727f9200cd54adc4a1b742950e80035bc53a20.zip external_llvm-8c727f9200cd54adc4a1b742950e80035bc53a20.tar.gz external_llvm-8c727f9200cd54adc4a1b742950e80035bc53a20.tar.bz2 |
Don't call dominates on unreachable instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151466 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/InstructionSimplify.cpp')
-rw-r--r-- | lib/Analysis/InstructionSimplify.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp index 37253f7..b518d0c 100644 --- a/lib/Analysis/InstructionSimplify.cpp +++ b/lib/Analysis/InstructionSimplify.cpp @@ -92,7 +92,8 @@ static bool ValueDominatesPHI(Value *V, PHINode *P, const DominatorTree *DT) { // If we have a DominatorTree then do a precise test. if (DT) - return DT->dominates(I, P); + return !DT->isReachableFromEntry(P->getParent()) || + !DT->isReachableFromEntry(I->getParent()) || DT->dominates(I, P); // Otherwise, if the instruction is in the entry block, and is not an invoke, // then it obviously dominates all phi nodes. |