Go to the documentation of this file.
25 cl::desc(
"The prefix used for the DDG dot file names."));
40 std::string Filename =
42 errs() <<
"Writing '" << Filename <<
"'...";
52 errs() <<
" error opening file for writing!";
62 return getSimpleNodeLabel(Node, Graph);
64 return getVerboseNodeLabel(Node, Graph);
72 return getSimpleEdgeAttributes(Node,
E,
G);
74 return getVerboseEdgeAttributes(Node,
E,
G);
79 if (
isSimple() && isa<RootDDGNode>(Node))
81 assert(Graph &&
"expected a valid graph pointer");
86 DDGDotGraphTraits::getSimpleNodeLabel(
const DDGNode *Node,
90 if (isa<SimpleDDGNode>(Node))
91 for (
auto *II :
static_cast<const SimpleDDGNode *
>(Node)->getInstructions())
93 else if (isa<PiBlockDDGNode>(Node))
94 OS <<
"pi-block\nwith\n"
95 << cast<PiBlockDDGNode>(Node)->getNodes().size() <<
" nodes\n";
96 else if (isa<RootDDGNode>(Node))
104 DDGDotGraphTraits::getVerboseNodeLabel(
const DDGNode *Node,
108 OS <<
"<kind:" << Node->getKind() <<
">\n";
109 if (isa<SimpleDDGNode>(Node))
110 for (
auto *II :
static_cast<const SimpleDDGNode *
>(Node)->getInstructions())
112 else if (isa<PiBlockDDGNode>(Node)) {
113 OS <<
"--- start of nodes in pi-block ---\n";
115 const auto &PNodes = cast<PiBlockDDGNode>(Node)->getNodes();
116 for (
auto *PN : PNodes) {
117 OS << getVerboseNodeLabel(PN,
G);
118 if (++Count != PNodes.size())
121 OS <<
"--- end of nodes in pi-block ---\n";
122 }
else if (isa<RootDDGNode>(Node))
129 std::string DDGDotGraphTraits::getSimpleEdgeAttributes(
134 OS <<
"label=\"[" <<
Kind <<
"]\"";
138 std::string DDGDotGraphTraits::getVerboseEdgeAttributes(
A set of analyses that are preserved following a run of a transformation pass.
static cl::opt< bool > DotOnly("dot-ddg-only", cl::init(false), cl::Hidden, cl::ZeroOrMore, cl::desc("simple ddg dot graph"))
This is an optimization pass for GlobalISel generic memory operations.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represents a single loop in the control flow graph.
A raw_ostream that writes to an std::string.
bool isNodeHidden(const DDGNode *Node, const DataDependenceGraph *G)
Do not print nodes that are part of a pi-block separately.
EdgeKind getKind() const
Get the edge kind.
std::string getNodeLabel(const DDGNode *Node, const DataDependenceGraph *Graph)
Print a DDG node either in concise form (-ddg-dot-only) or verbose mode (-ddg-dot).
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U)
static cl::opt< std::string > DDGDotFilenamePrefix("dot-ddg-filename-prefix", cl::init("ddg"), cl::Hidden, cl::desc("The prefix used for the DDG dot file names."))
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Data Dependency Graph Edge.
std::string str() const
Return the twine contents as a std::string.
@ OF_Text
The file should be opened in text mode on platforms like z/OS that make this distinction.
This class provides an interface for updating the loop pass manager based on mutations to the loop ne...
Subclass of DDGNode representing single or multi-instruction nodes.
initializer< Ty > init(const Ty &Val)
const NodeType & getTargetNode() const
Retrieve the target node this edge connects to.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
raw_ostream & WriteGraph(raw_ostream &O, const GraphType &G, bool ShortNames=false, const Twine &Title="")
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static void writeDDGToDotFile(DataDependenceGraph &G, bool DOnly=false)
A raw_ostream that writes to a file descriptor.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Data Dependence Graph Node The graph can represent the following types of nodes:
std::string getEdgeAttributes(const DDGNode *Node, GraphTraits< const DDGNode * >::ChildIteratorType I, const DataDependenceGraph *G)
Print attributes of an edge in the DDG graph.
A container for analyses that lazily runs them and caches their results.
Analysis pass that builds the DDG for a loop.
Instrumentation for Order File
const PiBlockDDGNode * getPiBlock(const NodeType &N) const
If node N belongs to a pi-block return a pointer to the pi-block, otherwise return null.
EdgeKind
The kind of edge in the DDG.