27#ifdef EXPENSIVE_CHECKS
36 cl::desc(
"Verify machine dominator info (time consuming)"));
42namespace DomTreeBuilder {
43template void Calculate<MBBDomTree>(MBBDomTree &DT);
44template void CalculateWithUpdates<MBBDomTree>(MBBDomTree &DT, MBBUpdates U);
52template void ApplyUpdates<MBBDomTree>(MBBDomTree &DT, MBBDomTreeGraphDiff &,
53 MBBDomTreeGraphDiff *);
55template bool Verify<MBBDomTree>(
const MBBDomTree &DT,
56 MBBDomTree::VerificationLevel VL);
66 return !PAC.preserved() &&
82 OS <<
"MachineDominatorTree for machine function: " << MF.
getName() <<
'\n';
90 "MachineDominator Tree Construction",
true,
true)
99 CriticalEdgesToSplit.
clear();
125void MachineDominatorTree::applySplitCriticalEdges()
const {
127 if (CriticalEdgesToSplit.
empty())
139 for (CriticalEdge &Edge : CriticalEdgesToSplit) {
145 if (PredBB == Edge.NewBB)
159 if (NewBBs.count(PredBB)) {
160 assert(PredBB->pred_size() == 1 &&
"A basic block resulting from a "
161 "critical edge split has more "
162 "than one predecessor!");
163 PredBB = *PredBB->pred_begin();
166 IsNewIDom[
Idx] =
false;
175 for (CriticalEdge &Edge : CriticalEdgesToSplit) {
179 Edge.NewBB, Edge.FromBB);
190 CriticalEdgesToSplit.clear();
BlockVerifier::State From
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
Generic dominator tree construction - this file provides routines to construct immediate dominator in...
static cl::opt< bool, true > VerifyMachineDomInfoX("verify-machine-dom-info", cl::location(VerifyMachineDomInfo), cl::Hidden, cl::desc("Verify machine dominator info (time consuming)"))
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file implements the SmallBitVector class.
This templated class represents "all analyses that operate over <a particular IR unit>" (e....
API to communicate dependencies between analyses during invalidation.
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represents analyses that only rely on functions' control flow.
Base class for the actual dominator tree node.
Core dominator tree base class.
void changeImmediateDominator(DomTreeNodeBase< NodeT > *N, DomTreeNodeBase< NodeT > *NewIDom)
changeImmediateDominator - This method is used to update the dominator tree information when a node's...
DomTreeNodeBase< NodeT > * addNewBlock(NodeT *BB, NodeT *DomBB)
Add a new node to the dominator tree information.
bool dominates(const DomTreeNodeBase< NodeT > *A, const DomTreeNodeBase< NodeT > *B) const
dominates - Returns true iff A dominates B.
void recalculate(ParentType &Func)
recalculate - compute a dominator tree for the given function
DomTreeNodeBase< NodeT > * getNode(const NodeT *BB) const
getNode - return the (Post)DominatorTree node for the specified basic block.
iterator_range< pred_iterator > predecessors()
Analysis pass which computes a MachineDominatorTree.
Result run(MachineFunction &MF, MachineFunctionAnalysisManager &)
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
Analysis pass which computes a MachineDominatorTree.
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
bool invalidate(MachineFunction &, const PreservedAnalyses &PA, MachineFunctionAnalysisManager::Invalidator &)
Handle invalidation explicitly.
void calculate(MachineFunction &F)
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
A Module instance is used to store all the information related to an LLVM module.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalysisChecker getChecker() const
Build a checker for this PreservedAnalyses and the specified analysis type.
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is ...
This class implements an extremely fast bulk output stream that can only output to a stream.
LocationClass< Ty > location(Ty &L)
This is an optimization pass for GlobalISel generic memory operations.
char & MachineDominatorsID
MachineDominators - This pass is a machine dominators analysis pass.
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr)
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
bool VerifyMachineDomInfo
void initializeMachineDominatorTreeWrapperPassPass(PassRegistry &)
A special type used by analysis passes to provide an address that identifies that particular analysis...