diff options
| author | Devang Patel <dpatel@apple.com> | 2007-03-26 23:18:28 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2007-03-26 23:18:28 +0000 |
| commit | bea581d70c6dfe3331ad1a39ff7f21d2ef7a7267 (patch) | |
| tree | 73ab77c3c9659554a548bf5a654507ee4ea9eee0 /llvm/lib | |
| parent | 55566a972ca7fe1f543a4d43ec5ad2b73ee20944 (diff) | |
| download | bcm5719-llvm-bea581d70c6dfe3331ad1a39ff7f21d2ef7a7267.tar.gz bcm5719-llvm-bea581d70c6dfe3331ad1a39ff7f21d2ef7a7267.zip | |
It is not possible to determie dominance between two PHI nodes
based on their ordering.
llvm-svn: 35369
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Dominators.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Dominators.cpp b/llvm/lib/VMCore/Dominators.cpp index a0e818fc313..7019c98d89e 100644 --- a/llvm/lib/VMCore/Dominators.cpp +++ b/llvm/lib/VMCore/Dominators.cpp @@ -19,6 +19,7 @@ #include "llvm/Assembly/Writer.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/SetOperations.h" +#include "llvm/Instructions.h" #include <algorithm> using namespace llvm; @@ -265,6 +266,11 @@ bool DominatorSetBase::dominates(Instruction *A, Instruction *B) const { BasicBlock *BBA = A->getParent(), *BBB = B->getParent(); if (BBA != BBB) return dominates(BBA, BBB); + // It is not possible to determie dominance between two PHI nodes + // based on their ordering. + if (isa<PHINode>(A) && isa<PHINode>(B)) + return false; + // Loop through the basic block until we find A or B. BasicBlock::iterator I = BBA->begin(); for (; &*I != A && &*I != B; ++I) /*empty*/; |

