23 #ifdef EXPENSIVE_CHECKS 26 static bool VerifyMachineDomInfo =
false;
30 cl::desc(
"Verify machine dominator info (time consuming)"));
40 "MachineDominator Tree Construction",
true,
true)
50 CriticalEdgesToSplit.
clear();
63 CriticalEdgesToSplit.
clear();
68 if (DT && VerifyMachineDomInfo) {
74 DT->compare(OtherDT)) {
75 errs() <<
"MachineDominatorTree for function " << F.
getName()
76 <<
" is not up to date!\nComputed:\n";
78 errs() <<
"\nActual:\n";
90 void MachineDominatorTree::applySplitCriticalEdges()
const {
92 if (CriticalEdgesToSplit.
empty())
104 for (CriticalEdge &Edge : CriticalEdgesToSplit) {
110 if (PredBB == Edge.NewBB)
124 if (NewBBs.count(PredBB)) {
125 assert(PredBB->pred_size() == 1 &&
"A basic block resulting from a " 126 "critical edge split has more " 127 "than one predecessor!");
128 PredBB = *PredBB->pred_begin();
130 if (!DT->dominates(SuccDTNode, DT->getNode(PredBB))) {
131 IsNewIDom[Idx] =
false;
140 for (CriticalEdge &Edge : CriticalEdgesToSplit) {
148 DT->changeImmediateDominator(DT->getNode(Edge.ToBB), NewDTNode);
152 CriticalEdgesToSplit.clear();
MachineBasicBlock * getRoot() const
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 ...
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
char & MachineDominatorsID
MachineDominators - This pass is a machine dominators analysis pass.
void recalculate(ParentType &Func)
recalculate - compute a dominator tree for the given function
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...
static cl::opt< bool, true > VerifyMachineDomInfoX("verify-machine-dom-info", cl::location(VerifyMachineDomInfo), cl::Hidden, cl::desc("Verify machine dominator info (time consuming)"))
Base class for the actual dominator tree node.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
Core dominator tree base class.
void initializeMachineDominatorTreePass(PassRegistry &)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
Represent the analysis usage information of a pass.
iterator_range< pred_iterator > predecessors()
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
void print(raw_ostream &O) const
print - Convert to human readable form
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
MachineDomTreeNode * getRootNode() const
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
LLVM_NODISCARD bool empty() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool VerifyMachineDomInfo
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)