24 #ifdef EXPENSIVE_CHECKS 27 bool VerifyMachineDomInfo =
false;
33 cl::desc(
"Verify machine dominator info (time consuming)"));
43 "MachineDominator Tree Construction",
true,
true)
58 CriticalEdgesToSplit.
clear();
70 CriticalEdgesToSplit.
clear();
77 errs() <<
"MachineDominatorTree verification failed\n";
87 void MachineDominatorTree::applySplitCriticalEdges()
const {
89 if (CriticalEdgesToSplit.
empty())
101 for (CriticalEdge &Edge : CriticalEdgesToSplit) {
107 if (PredBB == Edge.NewBB)
121 if (NewBBs.count(PredBB)) {
122 assert(PredBB->pred_size() == 1 &&
"A basic block resulting from a " 123 "critical edge split has more " 124 "than one predecessor!");
125 PredBB = *PredBB->pred_begin();
127 if (!DT->dominates(SuccDTNode, DT->getNode(PredBB))) {
128 IsNewIDom[Idx] =
false;
137 for (CriticalEdge &Edge : CriticalEdgesToSplit) {
145 DT->changeImmediateDominator(DT->getNode(Edge.ToBB), NewDTNode);
149 CriticalEdgesToSplit.clear();
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 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.
Core dominator tree base class.
void initializeMachineDominatorTreePass(PassRegistry &)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
void calculate(MachineFunction &F)
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()
#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...
LLVM_NODISCARD bool empty() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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)