mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-08 05:16:53 +00:00
It is not possible to determie dominance between two PHI nodes
based on their ordering. llvm-svn: 35369
This commit is contained in:
parent
3062ae001d
commit
58a8e74de6
@ -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*/;
|
||||
|
Loading…
x
Reference in New Issue
Block a user