15 #ifndef LLVM_CODEGEN_MACHINEDOMINATORS_H
16 #define LLVM_CODEGEN_MACHINEDOMINATORS_H
28 this->Roots.push_back(MBB);
57 inline const std::vector<MachineBasicBlock*> &
getRoots()
const {
58 return DT->getRoots();
66 return DT->getRootNode();
73 return DT->dominates(A, B);
78 return DT->dominates(A, B);
85 if (BBA != BBB)
return DT->dominates(BBA, BBB);
89 for (; &*I != A && &*I != B; ++
I)
103 return DT->properlyDominates(A, B);
108 return DT->properlyDominates(A, B);
115 return DT->findNearestCommonDominator(A, B);
119 return DT->getNode(BB);
126 return DT->getNode(BB);
134 return DT->addNewBlock(BB, DomBB);
142 DT->changeImmediateDominator(N, NewIDom);
147 DT->changeImmediateDominator(N, NewIDom);
160 DT->splitBlock(NewBB);
166 return DT->isReachableFromEntry(A);
179 template<
class T>
struct GraphTraits;
static NodeType * getEntryNode(MachineDominatorTree *DT)
bool properlyDominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
The main container class for the LLVM Intermediate Representation.
static NodeType * getEntryNode(NodeType *N)
MachineDomTreeNode * getRootNode() const
MachineBasicBlock * getRoot() const
EXTERN_TEMPLATE_INSTANTIATION(class DomTreeNodeBase< BasicBlock >)
DominatorTreeBase< MachineBasicBlock > & getBase()
static ChildIteratorType child_end(NodeType *N)
bool dominates(const MachineInstr *A, const MachineInstr *B) const
void eraseNode(MachineBasicBlock *BB)
void splitBlock(MachineBasicBlock *NewBB)
static ChildIteratorType child_begin(NodeType *N)
DomTreeNodeBase< MachineBasicBlock > MachineDomTreeNode
MachineDomTreeNode * getNode(MachineBasicBlock *BB) const
virtual void releaseMemory()
MachineBasicBlock * findNearestCommonDominator(MachineBasicBlock *A, MachineBasicBlock *B)
const MachineBasicBlock * getParent() const
MachineDomTreeNode * operator[](MachineBasicBlock *BB) const
virtual void print(raw_ostream &OS, const Module *) const
bool properlyDominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
void changeImmediateDominator(MachineDomTreeNode *N, MachineDomTreeNode *NewIDom)
NodeType::iterator ChildIteratorType
MachineDomTreeNode NodeType
const std::vector< MachineBasicBlock * > & getRoots() const
DominatorTreeBase< MachineBasicBlock > * DT
bool dominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
bundle_iterator< const MachineInstr, const_instr_iterator > const_iterator
void changeImmediateDominator(MachineBasicBlock *N, MachineBasicBlock *NewIDom)
bool isReachableFromEntry(const MachineBasicBlock *A)
std::vector< DomTreeNodeBase< NodeT > * >::iterator iterator
MachineDomTreeNode * addNewBlock(MachineBasicBlock *BB, MachineBasicBlock *DomBB)
bool dominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
virtual void getAnalysisUsage(AnalysisUsage &AU) const
virtual bool runOnMachineFunction(MachineFunction &F)