23 #ifdef EXPENSIVE_CHECKS
30 cl::desc(
"Verify machine dominator info (time consuming)"));
40 "MachineDominator Tree Construction",
true,
true)
50 CriticalEdgesToSplit.
clear();
80 void MachineDominatorTree::applySplitCriticalEdges()
const {
82 if (CriticalEdgesToSplit.
empty())
94 for (CriticalEdge &Edge : CriticalEdgesToSplit) {
100 if (PredBB == Edge.NewBB)
114 if (NewBBs.count(PredBB)) {
115 assert(PredBB->pred_size() == 1 &&
"A basic block resulting from a "
116 "critical edge split has more "
117 "than one predecessor!");
118 PredBB = *PredBB->pred_begin();
120 if (!DT->dominates(SuccDTNode, DT->getNode(PredBB))) {
121 IsNewIDom[Idx] =
false;
130 for (CriticalEdge &Edge : CriticalEdgesToSplit) {
138 DT->changeImmediateDominator(DT->getNode(Edge.ToBB), NewDTNode);
142 CriticalEdgesToSplit.clear();
149 OtherDT.DT->recalculate(F);
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. ...
char & MachineDominatorsID
MachineDominators - This pass is a machine dominators analysis pass.
MachineBasicBlock * getRoot() const
bool compare(const MachineDominatorTree &Other) const
Returns false if the other dominator tree matches this dominator tree.
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 getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
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...
Represent the analysis usage information of a pass.
iterator_range< pred_iterator > predecessors()
~MachineDominatorTree() override
#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_ATTRIBUTE_ALWAYS_INLINE size_type size() 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)