15 #ifndef LLVM_CODEGEN_MACHINEDOMINATORS_H
16 #define LLVM_CODEGEN_MACHINEDOMINATORS_H
29 this->Roots.push_back(MBB);
67 void applySplitCriticalEdges()
const;
78 applySplitCriticalEdges();
88 inline const std::vector<MachineBasicBlock*> &
getRoots()
const {
89 applySplitCriticalEdges();
94 applySplitCriticalEdges();
99 applySplitCriticalEdges();
107 applySplitCriticalEdges();
113 applySplitCriticalEdges();
120 applySplitCriticalEdges();
122 if (BBA != BBB)
return DT->
dominates(BBA, BBB);
126 for (; &*I != A && &*I != B; ++
I)
140 applySplitCriticalEdges();
146 applySplitCriticalEdges();
154 applySplitCriticalEdges();
159 applySplitCriticalEdges();
167 applySplitCriticalEdges();
176 applySplitCriticalEdges();
185 applySplitCriticalEdges();
191 applySplitCriticalEdges();
199 applySplitCriticalEdges();
206 applySplitCriticalEdges();
213 applySplitCriticalEdges();
217 void releaseMemory()
override;
236 bool Inserted = NewBBs.
insert(NewBB).second;
239 "A basic block inserted via edge splitting cannot appear twice");
240 CriticalEdgesToSplit.
push_back({FromBB, ToBB, NewBB});
249 template<
class T>
struct GraphTraits;
static NodeType * getEntryNode(MachineDominatorTree *DT)
DomTreeNodeBase< NodeT > * addNewBlock(NodeT *BB, NodeT *DomBB)
addNewBlock - Add a new node to the dominator tree information.
void push_back(const T &Elt)
bool properlyDominates(const DomTreeNodeBase< NodeT > *A, const DomTreeNodeBase< NodeT > *B) const
properlyDominates - Returns true iff A dominates B and A != B.
bool properlyDominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
A Module instance is used to store all the information related to an LLVM module. ...
static NodeType * getEntryNode(NodeType *N)
MachineDomTreeNode * getRootNode() const
MachineBasicBlock * getRoot() const
DominatorTreeBase< MachineBasicBlock > & getBase()
static ChildIteratorType child_end(NodeType *N)
bool dominates(const MachineInstr *A, const MachineInstr *B) const
void eraseNode(MachineBasicBlock *BB)
eraseNode - Removes a node from the dominator tree.
void splitBlock(MachineBasicBlock *NewBB)
splitBlock - BB is split and now it has one successor.
static ChildIteratorType child_begin(NodeType *N)
DomTreeNodeBase< MachineBasicBlock > MachineDomTreeNode
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
std::vector< DomTreeNodeBase< NodeT > * >::iterator iterator
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
MachineDomTreeNode * getNode(MachineBasicBlock *BB) const
getNode - return the (Post)DominatorTree node for the specified basic block.
Base class for the actual dominator tree node.
MachineBasicBlock * findNearestCommonDominator(MachineBasicBlock *A, MachineBasicBlock *B)
findNearestCommonDominator - Find nearest common dominator basic block for basic block A and B...
const MachineBasicBlock * getParent() const
Core dominator tree base class.
void recordSplitCriticalEdge(MachineBasicBlock *FromBB, MachineBasicBlock *ToBB, MachineBasicBlock *NewBB)
Record that the critical edge (FromBB, ToBB) has been split with NewBB.
MachineDomTreeNode * operator[](MachineBasicBlock *BB) const
bool isReachableFromEntry(const NodeT *A) const
isReachableFromEntry - Return true if A is dominated by the entry block of the function containing it...
const std::vector< NodeT * > & getRoots() const
getRoots - Return the root blocks of the current CFG.
bool dominates(const DomTreeNodeBase< NodeT > *A, const DomTreeNodeBase< NodeT > *B) const
dominates - Returns true iff A dominates B.
void eraseNode(NodeT *BB)
eraseNode - Removes a node from the dominator tree.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
Represent the analysis usage information of a pass.
NodeT * findNearestCommonDominator(NodeT *A, NodeT *B)
findNearestCommonDominator - Find nearest common dominator basic block for basic block A and B...
bool properlyDominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
void changeImmediateDominator(MachineDomTreeNode *N, MachineDomTreeNode *NewIDom)
NodeType::iterator ChildIteratorType
Generic dominator tree construction - This file provides routines to construct immediate dominator in...
MachineDomTreeNode NodeType
const std::vector< MachineBasicBlock * > & getRoots() const
getRoots - Return the root blocks of the current CFG.
DominatorTreeBase< MachineBasicBlock > * DT
bool dominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
Representation of each machine instruction.
bundle_iterator< const MachineInstr, const_instr_iterator > const_iterator
void changeImmediateDominator(DomTreeNodeBase< NodeT > *N, DomTreeNodeBase< NodeT > *NewIDom)
changeImmediateDominator - This method is used to update the dominator tree information when a node's...
void changeImmediateDominator(MachineBasicBlock *N, MachineBasicBlock *NewIDom)
changeImmediateDominator - This method is used to update the dominator tree information when a node's...
bool isReachableFromEntry(const MachineBasicBlock *A)
isReachableFromEntry - Return true if A is dominated by the entry block of the function containing it...
This class implements an extremely fast bulk output stream that can only output to a stream...
This file defines a set of templates that efficiently compute a dominator tree over a generic graph...
DomTreeNodeBase< NodeT > * getNode(NodeT *BB) const
getNode - return the (Post)DominatorTree node for the specified basic block.
MachineDomTreeNode * addNewBlock(MachineBasicBlock *BB, MachineBasicBlock *DomBB)
addNewBlock - Add a new node to the dominator tree information.
bool dominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
void splitBlock(NodeT *NewBB)
splitBlock - BB is split and now it has one successor.