37 Twine(Opts.dot_ddg_filename_prefix +
"." +
G.getName() +
".dot").
str();
48 errs() <<
" error opening file for writing!";
55std::string DDGDotGraphTraits::getNodeLabel(
const DDGNode *Node,
58 return getSimpleNodeLabel(Node,
Graph);
60 return getVerboseNodeLabel(Node,
Graph);
63std::string DDGDotGraphTraits::getEdgeAttributes(
66 const DDGEdge *
E =
static_cast<const DDGEdge *
>(*
I.getCurrent());
68 return getSimpleEdgeAttributes(Node,
E,
G);
70 return getVerboseEdgeAttributes(Node,
E,
G);
73bool DDGDotGraphTraits::isNodeHidden(
const DDGNode *Node,
78 return Graph->getPiBlock(*Node) !=
nullptr;
81std::string DDGDotGraphTraits::getNodeAttributes(
const DDGNode *Node,
84 return "shape=box, style=\"rounded,filled\", fillcolor=lightyellow, "
85 "color=darkorange, penwidth=3";
88 return "style=filled, fillcolor=lightcyan";
93DDGDotGraphTraits::getSimpleNodeLabel(
const DDGNode *Node,
96 raw_string_ostream OS(Str);
98 for (
auto *
II :
static_cast<const SimpleDDGNode *
>(Node)->getInstructions())
101 OS <<
"pi-block\nwith\n"
111DDGDotGraphTraits::getVerboseNodeLabel(
const DDGNode *Node,
114 raw_string_ostream OS(Str);
115 OS <<
"<kind:" <<
Node->getKind() <<
">\n";
117 for (
auto *
II :
static_cast<const SimpleDDGNode *
>(Node)->getInstructions())
120 OS <<
"--- start of nodes in pi-block ---\n";
123 for (
auto *PN : PNodes) {
124 OS << getVerboseNodeLabel(PN,
G);
125 if (++
Count != PNodes.size())
128 OS <<
"--- end of nodes in pi-block ---\n";
144 OS <<
", color=blue";
147std::string DDGDotGraphTraits::getSimpleEdgeAttributes(
150 raw_string_ostream OS(Str);
152 OS <<
"label=\"[" <<
Kind <<
"]\"";
157std::string DDGDotGraphTraits::getVerboseEdgeAttributes(
160 raw_string_ostream OS(Str);
164 OS <<
G->getDependenceString(*Src,
Edge->getTargetNode());
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static void writeEdgeKindColorAttr(raw_ostream &OS, DDGEdge::EdgeKind Kind)
EdgeKind to DOT color mapping:
static void writeDDGToDotFile(const AnalysisOptions &Opts, DataDependenceGraph &G)
uint64_t IntrinsicInst * II
static constexpr StringLiteral Filename
std::pair< BasicBlock *, BasicBlock * > Edge
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Analysis pass that builds the DDG for a loop.
LLVM_ABI PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U)
Data Dependency Graph Edge.
EdgeKind
The kind of edge in the DDG.
Data Dependence Graph Node The graph can represent the following types of nodes:
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.
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.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM_ABI std::string str() const
Return the twine contents as a std::string.
A raw_ostream that writes to a file descriptor.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
NodeAddr< NodeBase * > Node
@ OF_Text
The file should be opened in text mode on platforms like z/OS that make this distinction.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & WriteGraph(raw_ostream &O, const GraphType &G, bool ShortNames=false, const Twine &Title="")
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
const AnalysisOptions & getAnalysisOptions(const LLVMContext &C)
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...
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...