15 #ifndef LLVM_CODEGEN_MACHINEDOMINATORS_H 16 #define LLVM_CODEGEN_MACHINEDOMINATORS_H 34 this->Roots.push_back(MBB);
70 std::unique_ptr<DomTreeBase<MachineBasicBlock>> DT;
77 void applySplitCriticalEdges()
const;
86 applySplitCriticalEdges();
97 applySplitCriticalEdges();
98 return DT->getRoots();
102 applySplitCriticalEdges();
103 return DT->getRoot();
107 applySplitCriticalEdges();
108 return DT->getRootNode();
115 applySplitCriticalEdges();
116 return DT->dominates(A, B);
121 applySplitCriticalEdges();
122 return DT->dominates(A, B);
128 applySplitCriticalEdges();
130 if (BBA != BBB)
return DT->dominates(BBA, BBB);
134 for (; &*I != A && &*I !=
B; ++
I)
148 applySplitCriticalEdges();
149 return DT->properlyDominates(A, B);
154 applySplitCriticalEdges();
155 return DT->properlyDominates(A, B);
162 applySplitCriticalEdges();
163 return DT->findNearestCommonDominator(A, B);
167 applySplitCriticalEdges();
168 return DT->getNode(BB);
175 applySplitCriticalEdges();
176 return DT->getNode(BB);
184 applySplitCriticalEdges();
185 return DT->addNewBlock(BB, DomBB);
193 applySplitCriticalEdges();
194 DT->changeImmediateDominator(N, NewIDom);
199 applySplitCriticalEdges();
200 DT->changeImmediateDominator(N, NewIDom);
207 applySplitCriticalEdges();
214 applySplitCriticalEdges();
215 DT->splitBlock(NewBB);
221 applySplitCriticalEdges();
222 return DT->isReachableFromEntry(A);
225 void releaseMemory()
override;
227 void verifyAnalysis()
const override;
246 bool Inserted = NewBBs.
insert(NewBB).second;
249 "A basic block inserted via edge splitting cannot appear twice");
250 CriticalEdgesToSplit.
push_back({FromBB, ToBB, NewBB});
259 template <
class Node,
class ChildIterator>
291 #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...
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.
DomTreeBase< MachineBasicBlock > & getBase()
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...