23 #ifdef EXPENSIVE_CHECKS
30 cl::desc(
"Verify machine dominator info (time consuming)"));
40 "MachineDominator Tree Construction",
true,
true)
50 CriticalEdgesToSplit.
clear();
63 CriticalEdgesToSplit.
clear();
77 void MachineDominatorTree::applySplitCriticalEdges()
const {
79 if (CriticalEdgesToSplit.
empty())
91 for (CriticalEdge &Edge : CriticalEdgesToSplit) {
97 if (PredBB == Edge.NewBB)
111 if (NewBBs.count(PredBB)) {
112 assert(PredBB->pred_size() == 1 &&
"A basic block resulting from a "
113 "critical edge split has more "
114 "than one predecessor!");
115 PredBB = *PredBB->pred_begin();
117 if (!DT->dominates(SuccDTNode, DT->getNode(PredBB))) {
118 IsNewIDom[Idx] =
false;
127 for (CriticalEdge &Edge : CriticalEdgesToSplit) {
135 DT->changeImmediateDominator(DT->getNode(Edge.ToBB), NewDTNode);
139 CriticalEdgesToSplit.clear();
150 DT->compare(OtherDT)) {
151 errs() <<
"MachineDominatorTree is not up to date!\nComputed:\n";
153 errs() <<
"\nActual:\n";
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
static cl::opt< bool, true > VerifyMachineDomInfoX("verify-machine-dom-info", cl::location(VerifyMachineDomInfo), cl::desc("Verify machine dominator info (time consuming)"))
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is ...
A Module instance is used to store all the information related to an LLVM module. ...
MachineDomTreeNode * getRootNode() const
char & MachineDominatorsID
MachineDominators - This pass is a machine dominators analysis pass.
MachineBasicBlock * getRoot() const
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
LLVM_NODISCARD bool empty() const
Base class for the actual dominator tree node.
Core dominator tree base class.
void initializeMachineDominatorTreePass(PassRegistry &)
void verifyDomTree() const
Verify the correctness of the domtree by re-computing it.
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Represent the analysis usage information of a pass.
iterator_range< pred_iterator > predecessors()
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
void print(raw_ostream &O) const
print - Convert to human readable form
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool VerifyMachineDomInfo
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
void recalculate(FT &F)
recalculate - compute a dominator tree for the given function
This class implements an extremely fast bulk output stream that can only output to a stream...
void print(raw_ostream &OS, const Module *) const override
print - Print out the internal state of the pass.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
LocationClass< Ty > location(Ty &L)