LLVM 22.0.0git
DDG.h
Go to the documentation of this file.
1//===- llvm/Analysis/DDG.h --------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the Data-Dependence Graph (DDG).
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_ANALYSIS_DDG_H
14#define LLVM_ANALYSIS_DDG_H
15
16#include "llvm/ADT/DenseMap.h"
22
23namespace llvm {
24class Function;
25class Loop;
26class LoopInfo;
27class DDGNode;
28class DDGEdge;
32class LPMUpdater;
33
34/// Data Dependence Graph Node
35/// The graph can represent the following types of nodes:
36/// 1. Single instruction node containing just one instruction.
37/// 2. Multiple instruction node where two or more instructions from
38/// the same basic block are merged into one node.
39/// 3. Pi-block node which is a group of other DDG nodes that are part of a
40/// strongly-connected component of the graph.
41/// A pi-block node contains more than one single or multiple instruction
42/// nodes. The root node cannot be part of a pi-block.
43/// 4. Root node is a special node that connects to all components such that
44/// there is always a path from it to any node in the graph.
46public:
48
56
57 DDGNode() = delete;
58 DDGNode(const NodeKind K) : Kind(K) {}
59 DDGNode(const DDGNode &N) = default;
60 DDGNode(DDGNode &&N) : DDGNodeBase(std::move(N)), Kind(N.Kind) {}
61 virtual ~DDGNode() = 0;
62
63 DDGNode &operator=(const DDGNode &N) = default;
64
66 DGNode::operator=(std::move(N));
67 Kind = N.Kind;
68 return *this;
69 }
70
71 /// Getter for the kind of this node.
72 NodeKind getKind() const { return Kind; }
73
74 /// Collect a list of instructions, in \p IList, for which predicate \p Pred
75 /// evaluates to true when iterating over instructions of this node. Return
76 /// true if at least one instruction was collected, and false otherwise.
77 bool collectInstructions(llvm::function_ref<bool(Instruction *)> const &Pred,
78 InstructionListType &IList) const;
79
80protected:
81 /// Setter for the kind of this node.
82 void setKind(NodeKind K) { Kind = K; }
83
84private:
85 NodeKind Kind;
86};
87
88/// Subclass of DDGNode representing the root node of the graph.
89/// There should only be one such node in a given graph.
90class RootDDGNode : public DDGNode {
91public:
93 RootDDGNode(const RootDDGNode &N) = delete;
95 ~RootDDGNode() override = default;
96
97 /// Define classof to be able to use isa<>, cast<>, dyn_cast<>, etc.
98 static bool classof(const DDGNode *N) {
99 return N->getKind() == NodeKind::Root;
100 }
101 static bool classof(const RootDDGNode *N) { return true; }
102};
103
104/// Subclass of DDGNode representing single or multi-instruction nodes.
106 friend class DDGBuilder;
107
108public:
109 SimpleDDGNode() = delete;
113 ~SimpleDDGNode() override;
114
116
118 DDGNode::operator=(std::move(N));
119 InstList = std::move(N.InstList);
120 return *this;
121 }
122
123 /// Get the list of instructions in this node.
125 assert(!InstList.empty() && "Instruction List is empty.");
126 return InstList;
127 }
129 return const_cast<InstructionListType &>(
130 static_cast<const SimpleDDGNode *>(this)->getInstructions());
131 }
132
133 /// Get the first/last instruction in the node.
134 Instruction *getFirstInstruction() const { return getInstructions().front(); }
135 Instruction *getLastInstruction() const { return getInstructions().back(); }
136
137 /// Define classof to be able to use isa<>, cast<>, dyn_cast<>, etc.
138 static bool classof(const DDGNode *N) {
139 return N->getKind() == NodeKind::SingleInstruction ||
140 N->getKind() == NodeKind::MultiInstruction;
141 }
142 static bool classof(const SimpleDDGNode *N) { return true; }
143
144private:
145 /// Append the list of instructions in \p Input to this node.
146 void appendInstructions(const InstructionListType &Input) {
147 setKind((InstList.size() == 0 && Input.size() == 1)
148 ? NodeKind::SingleInstruction
149 : NodeKind::MultiInstruction);
150 llvm::append_range(InstList, Input);
151 }
152 void appendInstructions(const SimpleDDGNode &Input) {
153 appendInstructions(Input.getInstructions());
154 }
155
156 /// List of instructions associated with a single or multi-instruction node.
157 SmallVector<Instruction *, 2> InstList;
158};
159
160/// Subclass of DDGNode representing a pi-block. A pi-block represents a group
161/// of DDG nodes that are part of a strongly-connected component of the graph.
162/// Replacing all the SCCs with pi-blocks results in an acyclic representation
163/// of the DDG. For example if we have:
164/// {a -> b}, {b -> c, d}, {c -> a}
165/// the cycle a -> b -> c -> a is abstracted into a pi-block "p" as follows:
166/// {p -> d} with "p" containing: {a -> b}, {b -> c}, {c -> a}
168public:
170
171 PiBlockDDGNode() = delete;
175 ~PiBlockDDGNode() override;
176
178
180 DDGNode::operator=(std::move(N));
181 NodeList = std::move(N.NodeList);
182 return *this;
183 }
184
185 /// Get the list of nodes in this pi-block.
186 const PiNodeList &getNodes() const {
187 assert(!NodeList.empty() && "Node list is empty.");
188 return NodeList;
189 }
191 return const_cast<PiNodeList &>(
192 static_cast<const PiBlockDDGNode *>(this)->getNodes());
193 }
194
195 /// Define classof to be able to use isa<>, cast<>, dyn_cast<>, etc.
196 static bool classof(const DDGNode *N) {
197 return N->getKind() == NodeKind::PiBlock;
198 }
199
200private:
201 /// List of nodes in this pi-block.
202 PiNodeList NodeList;
203};
204
205/// Data Dependency Graph Edge.
206/// An edge in the DDG can represent a def-use relationship or
207/// a memory dependence based on the result of DependenceAnalysis.
208/// A rooted edge connects the root node to one of the components
209/// of the graph.
210class DDGEdge : public DDGEdgeBase {
211public:
212 /// The kind of edge in the DDG
213 enum class EdgeKind {
218 Last = Rooted // Must be equal to the largest enum value.
219 };
220
221 explicit DDGEdge(DDGNode &N) = delete;
222 DDGEdge(DDGNode &N, EdgeKind K) : DDGEdgeBase(N), Kind(K) {}
223 DDGEdge(const DDGEdge &E) : DDGEdgeBase(E), Kind(E.getKind()) {}
224 DDGEdge(DDGEdge &&E) : DDGEdgeBase(std::move(E)), Kind(E.Kind) {}
225 DDGEdge &operator=(const DDGEdge &E) = default;
226
228 DDGEdgeBase::operator=(std::move(E));
229 Kind = E.Kind;
230 return *this;
231 }
232
233 /// Get the edge kind
234 EdgeKind getKind() const { return Kind; };
235
236 /// Return true if this is a def-use edge, and false otherwise.
237 bool isDefUse() const { return Kind == EdgeKind::RegisterDefUse; }
238
239 /// Return true if this is a memory dependence edge, and false otherwise.
240 bool isMemoryDependence() const { return Kind == EdgeKind::MemoryDependence; }
241
242 /// Return true if this is an edge stemming from the root node, and false
243 /// otherwise.
244 bool isRooted() const { return Kind == EdgeKind::Rooted; }
245
246private:
247 EdgeKind Kind;
248};
249
250/// Encapsulate some common data and functionality needed for different
251/// variations of data dependence graphs.
252template <typename NodeType> class DependenceGraphInfo {
253public:
255
258 DependenceGraphInfo(const std::string &N, const DependenceInfo &DepInfo)
259 : Name(N), DI(DepInfo), Root(nullptr) {}
262 virtual ~DependenceGraphInfo() = default;
263
264 /// Return the label that is used to name this graph.
265 StringRef getName() const { return Name; }
266
267 /// Return the root node of the graph.
268 NodeType &getRoot() const {
269 assert(Root && "Root node is not available yet. Graph construction may "
270 "still be in progress\n");
271 return *Root;
272 }
273
274 /// Collect all the data dependency infos coming from any pair of memory
275 /// accesses from \p Src to \p Dst, and store them into \p Deps. Return true
276 /// if a dependence exists, and false otherwise.
277 bool getDependencies(const NodeType &Src, const NodeType &Dst,
278 DependenceList &Deps) const;
279
280 /// Return a string representing the type of dependence that the dependence
281 /// analysis identified between the two given nodes. This function assumes
282 /// that there is a memory dependence between the given two nodes.
283 std::string getDependenceString(const NodeType &Src,
284 const NodeType &Dst) const;
285
286protected:
287 // Name of the graph.
288 std::string Name;
289
290 // Store a copy of DependenceInfo in the graph, so that individual memory
291 // dependencies don't need to be stored. Instead when the dependence is
292 // queried it is recomputed using @DI.
294
295 // A special node in the graph that has an edge to every connected component of
296 // the graph, to ensure all nodes are reachable in a graph walk.
297 NodeType *Root = nullptr;
298};
299
301
302/// Data Dependency Graph
305 friend class DDGBuilder;
306
307public:
310
317 ~DataDependenceGraph() override;
318
319 /// If node \p N belongs to a pi-block return a pointer to the pi-block,
320 /// otherwise return null.
321 const PiBlockDDGNode *getPiBlock(const NodeType &N) const;
322
323protected:
324 /// Add node \p N to the graph, if it's not added yet, and keep track of the
325 /// root node as well as pi-blocks and their members. Return true if node is
326 /// successfully added.
327 bool addNode(NodeType &N);
328
329private:
331
332 /// Mapping from graph nodes to their containing pi-blocks. If a node is not
333 /// part of a pi-block, it will not appear in this map.
334 PiBlockMapType PiBlockMap;
335};
336
337/// Concrete implementation of a pure data dependence graph builder. This class
338/// provides custom implementation for the pure-virtual functions used in the
339/// generic dependence graph build algorithm.
340///
341/// For information about time complexity of the build algorithm see the
342/// comments near the declaration of AbstractDependenceGraphBuilder.
344 : public AbstractDependenceGraphBuilder<DataDependenceGraph> {
345public:
350 auto *RN = new RootDDGNode();
351 assert(RN && "Failed to allocate memory for DDG root node.");
352 Graph.addNode(*RN);
353 return *RN;
354 }
356 auto *SN = new SimpleDDGNode(I);
357 assert(SN && "Failed to allocate memory for simple DDG node.");
358 Graph.addNode(*SN);
359 return *SN;
360 }
362 auto *Pi = new PiBlockDDGNode(L);
363 assert(Pi && "Failed to allocate memory for pi-block node.");
364 Graph.addNode(*Pi);
365 return *Pi;
366 }
369 assert(E && "Failed to allocate memory for edge");
370 Graph.connect(Src, Tgt, *E);
371 return *E;
372 }
375 assert(E && "Failed to allocate memory for edge");
376 Graph.connect(Src, Tgt, *E);
377 return *E;
378 }
380 auto *E = new DDGEdge(Tgt, DDGEdge::EdgeKind::Rooted);
381 assert(E && "Failed to allocate memory for edge");
382 assert(isa<RootDDGNode>(Src) && "Expected root node");
383 Graph.connect(Src, Tgt, *E);
384 return *E;
385 }
386
388 auto *PiNode = dyn_cast<const PiBlockDDGNode>(&N);
389 assert(PiNode && "Expected a pi-block node.");
390 return PiNode->getNodes();
391 }
392
393 /// Return true if the two nodes \pSrc and \pTgt are both simple nodes and
394 /// the consecutive instructions after merging belong to the same basic block.
395 bool areNodesMergeable(const DDGNode &Src, const DDGNode &Tgt) const final;
396 void mergeNodes(DDGNode &Src, DDGNode &Tgt) final;
397 bool shouldSimplify() const final;
398 bool shouldCreatePiBlocks() const final;
399};
400
401LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, const DDGNode &N);
403LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, const DDGEdge &E);
404LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, const DDGEdge::EdgeKind K);
406
407//===--------------------------------------------------------------------===//
408// DDG Analysis Passes
409//===--------------------------------------------------------------------===//
410
411/// Analysis pass that builds the DDG for a loop.
413public:
414 using Result = std::unique_ptr<DataDependenceGraph>;
417
418private:
420 LLVM_ABI static AnalysisKey Key;
421};
422
423/// Textual printer pass for the DDG of a loop.
424class DDGAnalysisPrinterPass : public PassInfoMixin<DDGAnalysisPrinterPass> {
425public:
426 explicit DDGAnalysisPrinterPass(raw_ostream &OS) : OS(OS) {}
429 LPMUpdater &U);
430 static bool isRequired() { return true; }
431
432private:
433 raw_ostream &OS;
434};
435
436//===--------------------------------------------------------------------===//
437// DependenceGraphInfo Implementation
438//===--------------------------------------------------------------------===//
439
440template <typename NodeType>
442 const NodeType &Src, const NodeType &Dst, DependenceList &Deps) const {
443 assert(Deps.empty() && "Expected empty output list at the start.");
444
445 // List of memory access instructions from src and dst nodes.
446 SmallVector<Instruction *, 8> SrcIList, DstIList;
447 auto isMemoryAccess = [](const Instruction *I) {
448 return I->mayReadOrWriteMemory();
449 };
450 Src.collectInstructions(isMemoryAccess, SrcIList);
451 Dst.collectInstructions(isMemoryAccess, DstIList);
452
453 for (auto *SrcI : SrcIList)
454 for (auto *DstI : DstIList)
455 if (auto Dep =
456 const_cast<DependenceInfo *>(&DI)->depends(SrcI, DstI))
457 Deps.push_back(std::move(Dep));
458
459 return !Deps.empty();
460}
461
462template <typename NodeType>
463std::string
465 const NodeType &Dst) const {
466 std::string Str;
467 raw_string_ostream OS(Str);
468 DependenceList Deps;
469 if (!getDependencies(Src, Dst, Deps))
470 return Str;
471 interleaveComma(Deps, OS, [&](const std::unique_ptr<Dependence> &D) {
472 D->dump(OS);
473 // Remove the extra new-line character printed by the dump
474 // method
475 if (Str.back() == '\n')
476 Str.pop_back();
477 });
478
479 return Str;
480}
481
482//===--------------------------------------------------------------------===//
483// GraphTraits specializations for the DDG
484//===--------------------------------------------------------------------===//
485
486/// non-const versions of the grapth trait specializations for DDG
487template <> struct GraphTraits<DDGNode *> {
488 using NodeRef = DDGNode *;
489
491 return &P->getTargetNode();
492 }
493
494 // Provide a mapped iterator so that the GraphTrait-based implementations can
495 // find the target nodes without having to explicitly go through the edges.
499
500 static NodeRef getEntryNode(NodeRef N) { return N; }
507
509 return N->begin();
510 }
511 static ChildEdgeIteratorType child_edge_end(NodeRef N) { return N->end(); }
512};
513
514template <>
525
526/// const versions of the grapth trait specializations for DDG
527template <> struct GraphTraits<const DDGNode *> {
528 using NodeRef = const DDGNode *;
529
531 return &P->getTargetNode();
532 }
533
534 // Provide a mapped iterator so that the GraphTrait-based implementations can
535 // find the target nodes without having to explicitly go through the edges.
539
540 static NodeRef getEntryNode(NodeRef N) { return N; }
547
549 return N->begin();
550 }
551 static ChildEdgeIteratorType child_edge_end(NodeRef N) { return N->end(); }
552};
553
554template <>
559 return &DG->getRoot();
560 }
562 return DG->begin();
563 }
565 return DG->end();
566 }
567};
568
569} // namespace llvm
570
571#endif // LLVM_ANALYSIS_DDG_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
aarch64 promote const
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_ABI
Definition Compiler.h:213
This file defines the DenseMap class.
SmallVector< Instruction *, 2 > InstructionListType
This file defines the interface and a base class implementation for a directed graph.
This header provides classes for managing per-loop analyses.
#define F(x, y, z)
Definition MD5.cpp:55
#define I(x, y, z)
Definition MD5.cpp:58
#define G(x, y, z)
Definition MD5.cpp:56
#define P(N)
The Input class is used to parse a yaml document into in-memory structs and vectors.
This abstract builder class defines a set of high-level steps for creating DDG-like graphs.
AbstractDependenceGraphBuilder(DataDependenceGraph &G, DependenceInfo &D, const BasicBlockListType &BBs)
static bool isRequired()
Definition DDG.h:430
DDGAnalysisPrinterPass(raw_ostream &OS)
Definition DDG.h:426
Analysis pass that builds the DDG for a loop.
Definition DDG.h:412
LLVM_ABI Result run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR)
DDG as a loop pass.
Definition DDG.cpp:308
std::unique_ptr< DataDependenceGraph > Result
Definition DDG.h:414
DDGNode & createPiBlock(const NodeListType &L) final
Create a pi-block node in the graph representing a group of nodes in an SCC of the graph.
Definition DDG.h:361
DDGNode & createFineGrainedNode(Instruction &I) final
Create an atomic node in the graph given a single instruction.
Definition DDG.h:355
DDGBuilder(DataDependenceGraph &G, DependenceInfo &D, const BasicBlockListType &BBs)
Definition DDG.h:346
DDGEdge & createMemoryEdge(DDGNode &Src, DDGNode &Tgt) final
Create a memory dependence edge going from Src to Tgt.
Definition DDG.h:373
DDGEdge & createRootedEdge(DDGNode &Src, DDGNode &Tgt) final
Create a rooted edge going from Src to Tgt .
Definition DDG.h:379
DDGNode & createRootNode() final
Create the root node of the graph.
Definition DDG.h:349
const NodeListType & getNodesInPiBlock(const DDGNode &N) final
Given a pi-block node, return a vector of all the nodes contained within it.
Definition DDG.h:387
DDGEdge & createDefUseEdge(DDGNode &Src, DDGNode &Tgt) final
Create a def-use edge going from Src to Tgt.
Definition DDG.h:367
Data Dependency Graph Edge.
Definition DDG.h:210
DDGEdge & operator=(DDGEdge &&E)
Definition DDG.h:227
bool isDefUse() const
Return true if this is a def-use edge, and false otherwise.
Definition DDG.h:237
bool isRooted() const
Return true if this is an edge stemming from the root node, and false otherwise.
Definition DDG.h:244
EdgeKind getKind() const
Get the edge kind.
Definition DDG.h:234
EdgeKind
The kind of edge in the DDG.
Definition DDG.h:213
DDGEdge(DDGEdge &&E)
Definition DDG.h:224
bool isMemoryDependence() const
Return true if this is a memory dependence edge, and false otherwise.
Definition DDG.h:240
DDGEdge(const DDGEdge &E)
Definition DDG.h:223
DDGEdge(DDGNode &N, EdgeKind K)
Definition DDG.h:222
DDGEdge(DDGNode &N)=delete
DDGEdge & operator=(const DDGEdge &E)=default
Data Dependence Graph Node The graph can represent the following types of nodes:
Definition DDG.h:45
DDGNode & operator=(DDGNode &&N)
Definition DDG.h:65
DDGNode & operator=(const DDGNode &N)=default
DDGNode(const DDGNode &N)=default
DDGNode(DDGNode &&N)
Definition DDG.h:60
SmallVectorImpl< Instruction * > InstructionListType
Definition DDG.h:47
NodeKind getKind() const
Getter for the kind of this node.
Definition DDG.h:72
DDGNode(const NodeKind K)
Definition DDG.h:58
void setKind(NodeKind K)
Setter for the kind of this node.
Definition DDG.h:82
DDGNode()=delete
virtual ~DDGNode()=0
Represent an edge in the directed graph.
DGEdge< DDGNode, DDGEdge > & operator=(const DGEdge< DDGNode, DDGEdge > &E)
Represent a node in the directed graph.
typename EdgeListTy::const_iterator const_iterator
typename EdgeListTy::iterator iterator
Data Dependency Graph.
Definition DDG.h:303
DataDependenceGraph(DataDependenceGraph &&G)
Definition DDG.h:313
DataDependenceGraph(const DataDependenceGraph &G)=delete
friend class DDGBuilder
Definition DDG.h:305
Encapsulate some common data and functionality needed for different variations of data dependence gra...
Definition DDG.h:252
std::string getDependenceString(const NodeType &Src, const NodeType &Dst) const
Return a string representing the type of dependence that the dependence analysis identified between t...
Definition DDG.h:464
const DependenceInfo DI
Definition DDG.h:293
NodeType & getRoot() const
Return the root node of the graph.
Definition DDG.h:268
DependenceGraphInfo(DependenceGraphInfo &&G)
Definition DDG.h:260
StringRef getName() const
Return the label that is used to name this graph.
Definition DDG.h:265
SmallVector< std::unique_ptr< Dependence >, 1 > DependenceList
Definition DDG.h:254
DependenceGraphInfo(const DependenceGraphInfo &G)=delete
DependenceGraphInfo(const std::string &N, const DependenceInfo &DepInfo)
Definition DDG.h:258
virtual ~DependenceGraphInfo()=default
bool getDependencies(const NodeType &Src, const NodeType &Dst, DependenceList &Deps) const
Collect all the data dependency infos coming from any pair of memory accesses from Src to Dst,...
Definition DDG.h:441
DependenceInfo - This class is the main dependence-analysis driver.
Directed graph.
const_iterator begin() const
const_iterator end() const
typename NodeListTy::iterator iterator
typename NodeListTy::const_iterator const_iterator
This class provides an interface for updating the loop pass manager based on mutations to the loop ne...
Represents a single loop in the control flow graph.
Definition LoopInfo.h:40
Subclass of DDGNode representing a pi-block.
Definition DDG.h:167
PiBlockDDGNode & operator=(PiBlockDDGNode &&N)
Definition DDG.h:179
const PiNodeList & getNodes() const
Get the list of nodes in this pi-block.
Definition DDG.h:186
static bool classof(const DDGNode *N)
Define classof to be able to use isa<>, cast<>, dyn_cast<>, etc.
Definition DDG.h:196
PiBlockDDGNode & operator=(const PiBlockDDGNode &N)=default
SmallVector< DDGNode *, 4 > PiNodeList
Definition DDG.h:169
PiNodeList & getNodes()
Definition DDG.h:190
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
Subclass of DDGNode representing the root node of the graph.
Definition DDG.h:90
static bool classof(const DDGNode *N)
Define classof to be able to use isa<>, cast<>, dyn_cast<>, etc.
Definition DDG.h:98
RootDDGNode(const RootDDGNode &N)=delete
static bool classof(const RootDDGNode *N)
Definition DDG.h:101
~RootDDGNode() override=default
RootDDGNode(RootDDGNode &&N)
Definition DDG.h:94
Subclass of DDGNode representing single or multi-instruction nodes.
Definition DDG.h:105
Instruction * getFirstInstruction() const
Get the first/last instruction in the node.
Definition DDG.h:134
SimpleDDGNode & operator=(const SimpleDDGNode &N)=default
const InstructionListType & getInstructions() const
Get the list of instructions in this node.
Definition DDG.h:124
SimpleDDGNode & operator=(SimpleDDGNode &&N)
Definition DDG.h:117
static bool classof(const DDGNode *N)
Define classof to be able to use isa<>, cast<>, dyn_cast<>, etc.
Definition DDG.h:138
static bool classof(const SimpleDDGNode *N)
Definition DDG.h:142
InstructionListType & getInstructions()
Definition DDG.h:128
Instruction * getLastInstruction() const
Definition DDG.h:135
friend class DDGBuilder
Definition DDG.h:106
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
A raw_ostream that writes to an std::string.
This is an optimization pass for GlobalISel generic memory operations.
DGEdge< DDGNode, DDGEdge > DDGEdgeBase
Definition DDG.h:30
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
Definition STLExtras.h:2136
void interleaveComma(const Container &c, StreamT &os, UnaryFunctor each_fn)
Definition STLExtras.h:2231
DirectedGraph< DDGNode, DDGEdge > DDGBase
Definition DDG.h:31
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
Definition Casting.h:547
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1867
DGNode< DDGNode, DDGEdge > DDGNodeBase
Definition DDG.h:29
DependenceGraphInfo< DDGNode > DDGInfo
Definition DDG.h:300
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:867
#define N
Determine the kind of a node from its type.
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition PassManager.h:93
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition Analysis.h:29
DDGNode::iterator ChildEdgeIteratorType
Definition DDG.h:498
mapped_iterator< DDGNode::iterator, decltype(&DDGGetTargetNode)> ChildIteratorType
Definition DDG.h:496
static DDGNode * DDGGetTargetNode(DGEdge< DDGNode, DDGEdge > *P)
Definition DDG.h:490
static ChildIteratorType child_end(NodeRef N)
Definition DDG.h:504
static ChildEdgeIteratorType child_edge_begin(NodeRef N)
Definition DDG.h:508
static ChildEdgeIteratorType child_edge_end(NodeRef N)
Definition DDG.h:511
static ChildIteratorType child_begin(NodeRef N)
Definition DDG.h:501
static NodeRef getEntryNode(NodeRef N)
Definition DDG.h:500
static nodes_iterator nodes_end(DataDependenceGraph *DG)
Definition DDG.h:523
DataDependenceGraph::iterator nodes_iterator
Definition DDG.h:516
static nodes_iterator nodes_begin(DataDependenceGraph *DG)
Definition DDG.h:520
static NodeRef getEntryNode(DataDependenceGraph *DG)
Definition DDG.h:517
static ChildIteratorType child_end(NodeRef N)
Definition DDG.h:544
static const DDGNode * DDGGetTargetNode(const DGEdge< DDGNode, DDGEdge > *P)
Definition DDG.h:530
DDGNode::const_iterator ChildEdgeIteratorType
Definition DDG.h:538
static ChildEdgeIteratorType child_edge_end(NodeRef N)
Definition DDG.h:551
static ChildEdgeIteratorType child_edge_begin(NodeRef N)
Definition DDG.h:548
mapped_iterator< DDGNode::const_iterator, decltype(&DDGGetTargetNode)> ChildIteratorType
Definition DDG.h:536
static NodeRef getEntryNode(NodeRef N)
Definition DDG.h:540
static ChildIteratorType child_begin(NodeRef N)
Definition DDG.h:541
static nodes_iterator nodes_begin(const DataDependenceGraph *DG)
Definition DDG.h:561
DataDependenceGraph::const_iterator nodes_iterator
Definition DDG.h:557
static NodeRef getEntryNode(const DataDependenceGraph *DG)
Definition DDG.h:558
static nodes_iterator nodes_end(const DataDependenceGraph *DG)
Definition DDG.h:564
typename DataDependenceGraph *::UnknownGraphTypeError NodeRef
Definition GraphTraits.h:95
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition PassManager.h:70