40 cl::desc(
"Verify dominator info (time consuming)"));
44 unsigned NumEdgesToEnd = 0;
48 if (NumEdgesToEnd >= 2)
51 assert(NumEdgesToEnd == 1);
70 template void llvm::Calculate<Function, Inverse<BasicBlock *>>(
98 if (isa<InvokeInst>(Def) || isa<PHINode>(User))
106 for (; &*I != Def && &*I != User; ++
I)
200 if (PN && PN->getParent() == BBE.
getEnd() &&
201 PN->getIncomingBlock(U) == BBE.
getStart())
208 UseBB = PN->getIncomingBlock(U);
222 if (
PHINode *PN = dyn_cast<PHINode>(UserInst))
223 UseBB = PN->getIncomingBlock(U);
240 if (
const InvokeInst *II = dyn_cast<InvokeInst>(Def)) {
254 if (isa<PHINode>(UserInst))
259 for (; &*I != Def && &*I != UserInst; ++
I)
262 return &*I != UserInst;
273 if (
PHINode *PN = dyn_cast<PHINode>(I))
286 errs() <<
"DominatorTree is not up to date!\nComputed:\n";
288 errs() <<
"\nActual:\n";
309 char DominatorTreeAnalysis::PassID;
315 OS <<
"DominatorTree for function: " << F.
getName() <<
"\n";
339 "Dominator Tree Construction",
true,
true)
bool compare(const DominatorTree &Other) const
Returns false if the other dominator tree matches this dominator tree.
static bool VerifyDomInfo
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
A Module instance is used to store all the information related to an LLVM module. ...
const BasicBlock * getStart() const
const Function * getParent() const
Return the enclosing method, or null if none.
Analysis pass which computes a DominatorTree.
template void Calculate< Function, BasicBlock * >(DominatorTreeBase< GraphTraits< BasicBlock * >::NodeType > &DT, Function &F)
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
StringRef getName() const
Return a constant reference to the value's name.
iterator begin()
Instruction iterator methods.
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
A Use represents the edge between a Value definition and its users.
DominatorTree run(Function &F)
Run the analysis pass over a function and produce a dominator tree.
bool isReachableFromEntry(const Use &U) const
Provide an overload for a Use.
Base class for the actual dominator tree node.
DominatorTreePrinterPass(raw_ostream &OS)
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
BasicBlock * getNormalDest() const
unsigned getNumSuccessors() const
Return the number of successors that this terminator has.
PreservedAnalyses run(Function &F, AnalysisManager< Function > *AM)
Subclasses of this class are all able to terminate a basic block.
An abstract set of preserved analyses following a transformation pass run.
LLVM Basic Block Representation.
BasicBlock * getSuccessor(unsigned idx) const
Return the specified successor.
Interval::pred_iterator pred_begin(Interval *I)
pred_begin/pred_end - define methods so that Intervals may be used just like BasicBlocks can with the...
User * getUser() const
Returns the User that contains this Use.
Interval::pred_iterator pred_end(Interval *I)
void verifyDomTree() const
Verify the correctness of the domtree by re-computing it.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
static cl::opt< bool, true > VerifyDomInfoX("verify-dom-info", cl::location(VerifyDomInfo), cl::desc("Verify dominator info (time consuming)"))
const BasicBlock * getEnd() const
bool dominates(const Instruction *Def, const Use &U) const
Return true if Def dominates a use in User.
Generic dominator tree construction - This file provides routines to construct immediate dominator in...
PassT::Result & getResult(IRUnitT &IR)
Get the result of an analysis pass for this module.
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
BasicBlock * getSinglePredecessor()
Return the predecessor of this block if it has a single predecessor block.
LLVM_ATTRIBUTE_UNUSED_RESULT std::enable_if< !is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
INITIALIZE_PASS(DominatorTreeWrapperPass,"domtree","Dominator Tree Construction", true, true) bool DominatorTreeWrapperPass
void print(raw_ostream &o) const
print - Convert to human readable form
TerminatorInst * getTerminator()
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
PreservedAnalyses run(Function &F, AnalysisManager< Function > *AM)
bool isSingleEdge() const
This class implements an extremely fast bulk output stream that can only output to a stream...
InvokeInst - Invoke instruction.
void recalculate(FT &F)
recalculate - compute a dominator tree for the given function
A generic analysis pass manager with lazy running and caching of results.
Legacy analysis pass which computes a DominatorTree.
This header defines various interfaces for pass management in LLVM.
LocationClass< Ty > location(Ty &L)
const BasicBlock * getParent() const