LLVM: include/llvm/IR/Dominators.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_IR_DOMINATORS_H
15#define LLVM_IR_DOMINATORS_H
16
35#include
36
37namespace llvm {
38
44template struct GraphTraits;
45
51
53
57
59
62
66
69
74
79
86
92}
93
95
99
100public:
102 Start(Start_), End(End_) {}
103
104 BasicBlockEdge(const std::pair<BasicBlock *, BasicBlock *> &Pair)
105 : Start(Pair.first), End(Pair.second) {}
106
107 BasicBlockEdge(const std::pair<const BasicBlock *, const BasicBlock *> &Pair)
108 : Start(Pair.first), End(Pair.second) {}
109
113
117
118
119 LLVM_ABI bool isSingleEdge() const;
120};
121
124
126
128 return BasicBlockEdge(BBInfo::getEmptyKey(), BBInfo::getEmptyKey());
129 }
130
132 return BasicBlockEdge(BBInfo::getTombstoneKey(), BBInfo::getTombstoneKey());
133 }
134
136 return hash_combine(BBInfo::getHashValue(Edge.getStart()),
137 BBInfo::getHashValue(Edge.getEnd()));
138 }
139
141 return BBInfo::isEqual(LHS.getStart(), RHS.getStart()) &&
142 BBInfo::isEqual(LHS.getEnd(), RHS.getEnd());
143 }
144};
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
165 public:
167
173
174
176 FunctionAnalysisManager::Invalidator &);
177
178
179 using Base::dominates;
180
181
183
184
185
186
187
188
189
190
191
192
194
195
196
201
202
203
204
205
206
208
209
210
211
212
216
219
220
221 using Base::isReachableFromEntry;
222
223
224 LLVM_ABI bool isReachableFromEntry(const Use &U) const;
225
226
227 using Base::findNearestCommonDominator;
228
229
230
233
234
237};
238
239
240
241
242
258
259template <>
263
264template <>
268
281
282
286
287public:
288
290
291
293};
294
295
297 : public PassInfoMixin {
299
300public:
302
304
306};
307
308
313
314
315
316
317
319
320
323
324public:
326
328
331
333
335
339
341
343};
344}
345
346#endif
This file implements a class to represent arbitrary precision integral constant values and operations...
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
#define LLVM_TEMPLATE_ABI
This file defines DenseMapInfo traits for DenseMap.
This file builds on the ADT/GraphTraits.h file to build generic depth first graph iterator.
This file defines a set of templates that efficiently compute a dominator tree over a generic graph.
This file provides various utilities for inspecting and working with the control flow graph in LLVM I...
This header defines various interfaces for pass management in LLVM.
This defines the Use class.
This file defines the PointerIntPair class.
static bool dominates(InstrPosIndexes &PosIndexes, const MachineInstr &A, const MachineInstr &B)
This file defines the SmallVector class.
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition Dominators.h:96
const BasicBlock * getEnd() const
Definition Dominators.h:114
const BasicBlock * getStart() const
Definition Dominators.h:110
BasicBlockEdge(const std::pair< const BasicBlock *, const BasicBlock * > &Pair)
Definition Dominators.h:107
BasicBlockEdge(const BasicBlock *Start_, const BasicBlock *End_)
Definition Dominators.h:101
BasicBlockEdge(const std::pair< BasicBlock *, BasicBlock * > &Pair)
Definition Dominators.h:104
LLVM Basic Block Representation.
InstListType::iterator iterator
Instruction iterators...
Base class for the actual dominator tree node.
typename SmallVector< DomTreeNodeBase *, 4 >::const_iterator const_iterator
Analysis pass which computes a DominatorTree.
Definition Dominators.h:283
LLVM_ABI DominatorTree run(Function &F, FunctionAnalysisManager &)
Run the analysis pass over a function and produce a dominator tree.
DominatorTree Result
Provide the result typedef for this analysis pass.
Definition Dominators.h:289
Core dominator tree base class.
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
DominatorTreeBase()=default
void recalculate(ParentType &Func)
LLVM_ABI DominatorTreePrinterPass(raw_ostream &OS)
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static bool isRequired()
Definition Dominators.h:305
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
DominatorTreeWrapperPass()
DominatorTree & getDomTree()
Definition Dominators.h:329
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Definition Dominators.h:336
const DominatorTree & getDomTree() const
Definition Dominators.h:330
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
Definition Dominators.h:340
static char ID
Definition Dominators.h:325
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition Dominators.h:164
bool dominates(const Value *Def, BasicBlock::iterator User) const
Definition Dominators.h:198
DominatorTreeBase< BasicBlock, false > Base
Definition Dominators.h:166
DominatorTree(Function &F)
Definition Dominators.h:169
DominatorTree(DominatorTree &DT, DomTreeBuilder::BBUpdates U)
Definition Dominators.h:170
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
A Use represents the edge between a Value definition and its users.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
bool Verify(const DomTreeT &DT, typename DomTreeT::VerificationLevel VL)
GraphDiff< BasicBlock *, false > BBDomTreeGraphDiff
Definition Dominators.h:60
void CalculateWithUpdates(DomTreeT &DT, ArrayRef< typename DomTreeT::UpdateType > Updates)
ArrayRef< llvm::cfg::Update< BasicBlock * > > BBUpdates
Definition Dominators.h:58
GraphDiff< BasicBlock *, true > BBPostDomTreeGraphDiff
Definition Dominators.h:61
void DeleteEdge(DomTreeT &DT, typename DomTreeT::NodePtr From, typename DomTreeT::NodePtr To)
void Calculate(DomTreeT &DT)
PostDomTreeBase< BasicBlock > BBPostDomTree
Definition Dominators.h:56
void ApplyUpdates(DomTreeT &DT, GraphDiff< typename DomTreeT::NodePtr, DomTreeT::IsPostDominator > &PreViewCFG, GraphDiff< typename DomTreeT::NodePtr, DomTreeT::IsPostDominator > *PostViewCFG)
void InsertEdge(DomTreeT &DT, typename DomTreeT::NodePtr From, typename DomTreeT::NodePtr To)
DomTreeBase< BasicBlock > BBDomTree
Definition Dominators.h:55
This is an optimization pass for GlobalISel generic memory operations.
df_iterator< T > df_begin(const T &G)
DominatorTreeBase< T, true > PostDomTreeBase
DomTreeNodeBase< BasicBlock > DomTreeNode
Definition Dominators.h:94
DominatorTreeBase< T, false > DomTreeBase
LLVM_ABI bool VerifyDomInfo
Enables verification of dominator trees.
df_iterator< T > df_end(const T &G)
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
static BasicBlockEdge getEmptyKey()
Definition Dominators.h:127
static BasicBlockEdge getTombstoneKey()
Definition Dominators.h:131
DenseMapInfo< const BasicBlock * > BBInfo
Definition Dominators.h:123
static unsigned getHashValue(const BasicBlockEdge &Edge)
Definition Dominators.h:135
static LLVM_ABI unsigned getHashValue(const BasicBlockEdge *V)
static bool isEqual(const BasicBlockEdge &LHS, const BasicBlockEdge &RHS)
Definition Dominators.h:140
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition Dominators.h:243
static ChildIteratorType child_end(NodeRef N)
Definition Dominators.h:250
static NodeRef getEntryNode(NodeRef N)
Definition Dominators.h:248
ChildIterator ChildIteratorType
Definition Dominators.h:245
Node * NodeRef
Definition Dominators.h:244
df_iterator< Node *, df_iterator_default_set< Node * > > nodes_iterator
Definition Dominators.h:246
static nodes_iterator nodes_begin(NodeRef N)
Definition Dominators.h:252
static nodes_iterator nodes_end(NodeRef N)
Definition Dominators.h:256
static ChildIteratorType child_begin(NodeRef N)
Definition Dominators.h:249
Verifier pass for the DominatorTree.
Definition Dominators.h:309
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static bool isRequired()
Definition Dominators.h:311
static nodes_iterator nodes_end(DominatorTree *N)
Definition Dominators.h:277
static NodeRef getEntryNode(DominatorTree *DT)
Definition Dominators.h:271
static nodes_iterator nodes_begin(DominatorTree *N)
Definition Dominators.h:273
typename DominatorTree *::UnknownGraphTypeError NodeRef
A CRTP mix-in to automatically provide informational APIs needed for passes.