LLVM: lib/Analysis/PostDominators.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
20
21using namespace llvm;
22
23#define DEBUG_TYPE "postdomtree"
24
25#ifdef EXPENSIVE_CHECKS
27#else
29#endif
30
31
32
33
34
36
39
41 "Post-Dominator Tree Construction", true, true)
42
45
46
50}
51
54 assert(I1 && I2 && "Expecting valid I1 and I2");
55
56 const BasicBlock *BB1 = I1->getParent();
58
59 if (BB1 != BB2)
61
62
64 return false;
65
66
68 for (; &*I != I1 && &*I != I2; ++I)
69 ;
70
71 return &*I == I2;
72}
73
76 return false;
77}
78
81 assert(DT.verify(PostDominatorTree::VerificationLevel::Full));
83 assert(DT.verify(PostDominatorTree::VerificationLevel::Basic));
84}
85
89
93
94AnalysisKey PostDominatorTreeAnalysis::Key;
95
101
104
107 OS << "PostDominatorTree for function: " << F.getName() << "\n";
109
111}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This header defines various interfaces for pass management in LLVM.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static constexpr bool ExpensiveChecksEnabled
Definition PostDominators.cpp:28
This templated class represents "all analyses that operate over " (e....
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
LLVM Basic Block Representation.
iterator begin()
Instruction iterator methods.
InstListType::const_iterator const_iterator
Represents analyses that only rely on functions' control flow.
bool dominates(const DomTreeNodeBase< T > *A, const DomTreeNodeBase< T > *B) const
FunctionPass class - This class is used to implement most global optimizations.
A Module instance is used to store all the information related to an LLVM module.
Analysis pass which computes a PostDominatorTree.
LLVM_ABI PostDominatorTree run(Function &F, FunctionAnalysisManager &)
Run the analysis pass over a function and produce a post dominator tree.
Definition PostDominators.cpp:96
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition PostDominators.cpp:106
LLVM_ABI PostDominatorTreePrinterPass(raw_ostream &OS)
Definition PostDominators.cpp:102
PostDominatorTree Class - Concrete subclass of DominatorTree that is used to compute the post-dominat...
LLVM_ABI bool dominates(const Instruction *I1, const Instruction *I2) const
Return true if I1 dominates I2.
Definition PostDominators.cpp:52
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.
const ParentTy * getParent() const
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr, unsigned DynamicVGPRBlockSize=0)
LLVM_ABI FunctionPass * createPostDomTree()
Definition PostDominators.cpp:90
bool isa(const From &Val)
isa - Return true if the parameter to the template is an instance of one of the template type argu...
LLVM_ABI bool VerifyDomInfo
Enables verification of dominator trees.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
A special type used by analysis passes to provide an address that identifies that particular analysis...
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
Definition PostDominators.cpp:74
void print(raw_ostream &OS, const Module *) const override
print - Print out the internal state of the pass.
Definition PostDominators.cpp:86
PostDominatorTreeWrapperPass()
Definition PostDominators.cpp:37
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
Definition PostDominators.cpp:79