14 #ifndef LLVM_CODEGEN_MACHINEDOMINATORS_H 15 #define LLVM_CODEGEN_MACHINEDOMINATORS_H 33 this->Roots.push_back(MBB);
71 std::unique_ptr<DomTreeT> DT;
78 void applySplitCriticalEdges()
const;
90 applySplitCriticalEdges();
101 applySplitCriticalEdges();
102 return DT->getRoots();
106 applySplitCriticalEdges();
107 return DT->getRoot();
111 applySplitCriticalEdges();
112 return DT->getRootNode();
121 applySplitCriticalEdges();
122 return DT->dominates(A, B);
126 applySplitCriticalEdges();
127 return DT->dominates(A, B);
133 applySplitCriticalEdges();
135 if (BBA != BBB)
return DT->dominates(BBA, BBB);
139 for (; &*I != A && &*I !=
B; ++
I)
147 applySplitCriticalEdges();
148 return DT->properlyDominates(A, B);
153 applySplitCriticalEdges();
154 return DT->properlyDominates(A, B);
161 applySplitCriticalEdges();
162 return DT->findNearestCommonDominator(A, B);
166 applySplitCriticalEdges();
167 return DT->getNode(BB);
174 applySplitCriticalEdges();
175 return DT->getNode(BB);
183 applySplitCriticalEdges();
184 return DT->addNewBlock(BB, DomBB);
192 applySplitCriticalEdges();
193 DT->changeImmediateDominator(N, NewIDom);
198 applySplitCriticalEdges();
199 DT->changeImmediateDominator(N, NewIDom);
206 applySplitCriticalEdges();
213 applySplitCriticalEdges();
214 DT->splitBlock(NewBB);
220 applySplitCriticalEdges();
221 return DT->isReachableFromEntry(A);
224 void releaseMemory()
override;
226 void verifyAnalysis()
const override;
245 bool Inserted = NewBBs.
insert(NewBB).second;
248 "A basic block inserted via edge splitting cannot appear twice");
249 CriticalEdgesToSplit.
push_back({FromBB, ToBB, NewBB});
258 template <
class Node,
class ChildIterator>
290 #endif // LLVM_CODEGEN_MACHINEDOMINATORS_H
MachineBasicBlock * getRoot() const
typename std::vector< DomTreeNodeBase * >::const_iterator const_iterator
MachineDomTreeNode * getNode(MachineBasicBlock *BB) const
getNode - return the (Post)DominatorTree node for the specified basic block.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
void push_back(const T &Elt)
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.
const SmallVectorImpl< MachineBasicBlock * > & getRoots() const
getRoots - Return the root blocks of the current CFG.
bool dominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
DomTreeNodeBase< MachineBasicBlock > MachineDomTreeNode
static NodeRef getEntryNode(NodeRef N)
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
MachineDomTreeNode * operator[](MachineBasicBlock *BB) const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
MachineDominatorTree(MachineFunction &MF)
static ChildIteratorType child_end(NodeRef N)
MachineDomTreeNode::const_iterator ChildIteratorType
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...
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.
typename MachineDomTreeNode *::UnknownGraphTypeError NodeRef
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
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.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
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)
bool properlyDominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const
bool dominates(const MachineInstr *A, const MachineInstr *B) const
Generic dominator tree construction - This file provides routines to construct immediate dominator in...
static NodeRef getEntryNode(MachineDominatorTree *DT)
MachineDomTreeNode * getRootNode() const
bool dominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
static ChildIteratorType child_begin(NodeRef N)
bool properlyDominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
const MachineBasicBlock * getParent() const
Representation of each machine instruction.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
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...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
typename std::vector< DomTreeNodeBase * >::iterator iterator
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...
MachineDomTreeNode * addNewBlock(MachineBasicBlock *BB, MachineBasicBlock *DomBB)
addNewBlock - Add a new node to the dominator tree information.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...