mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
Add BasicBlock level dominates(A,B) interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37493 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -170,11 +170,16 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateDFSNumbers();
|
void updateDFSNumbers();
|
||||||
|
|
||||||
/// dominates - Returns true iff this dominates N. Note that this is not a
|
/// dominates - Returns true iff this dominates N. Note that this is not a
|
||||||
/// constant time operation!
|
/// constant time operation!
|
||||||
///
|
///
|
||||||
inline bool dominates(const DomTreeNode *A, DomTreeNode *B) {
|
inline bool dominates(const DomTreeNode *A, DomTreeNode *B) {
|
||||||
if (B == A) return true; // A node trivially dominates itself.
|
if (B == A)
|
||||||
|
return true; // A node trivially dominates itself.
|
||||||
|
|
||||||
|
if (A == 0 || B == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
ETNode *NodeA = A->getETNode();
|
ETNode *NodeA = A->getETNode();
|
||||||
ETNode *NodeB = B->getETNode();
|
ETNode *NodeB = B->getETNode();
|
||||||
@@ -192,7 +197,14 @@ protected:
|
|||||||
//return NodeB->DominatedBySlow(NodeA);
|
//return NodeB->DominatedBySlow(NodeA);
|
||||||
return dominatedBySlowTreeWalk(A, B);
|
return dominatedBySlowTreeWalk(A, B);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool dominates(BasicBlock *A, BasicBlock *B) {
|
||||||
|
if (A == B)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return dominates(getNode(A), getNode(B));
|
||||||
|
}
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// API to update (Post)DominatorTree information based on modifications to
|
// API to update (Post)DominatorTree information based on modifications to
|
||||||
// the CFG...
|
// the CFG...
|
||||||
|
Reference in New Issue
Block a user