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 | c8c2b06a90f68ed087164d008a8d39ae1fee5a93 (patch) | |
tree | 3e168ee7b4dd0d62d170c1a032b73cce7b4eb3b5 /llvm/lib/Analysis/InstructionSimplify.cpp | |
parent | 0d1f3cb1b5d2c89d12d01bfa1b729a11b4864d49 (diff) | |
download | bcm5719-llvm-c8c2b06a90f68ed087164d008a8d39ae1fee5a93.tar.gz bcm5719-llvm-c8c2b06a90f68ed087164d008a8d39ae1fee5a93.zip |
Don't call dominates on unreachable instructions.
llvm-svn: 151466
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 37253f72cf6..b518d0ca71c 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/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. |