Home | History | Annotate | Download | only in Analysis

Lines Matching full:edge

23 static void addEdge(SmallVectorImpl<LazyCallGraph::Edge> &Edges,
25 LazyCallGraph::Edge::Kind EK) {
27 // edge. Even if the function's definition is subject to replacement by
35 // safety of optimizing a direct call edge.
39 Edges.emplace_back(LazyCallGraph::Edge(F, EK));
45 SmallVectorImpl<LazyCallGraph::Edge> &Edges,
51 addEdge(Edges, EdgeIndexMap, *F, LazyCallGraph::Edge::Ref);
81 addEdge(Edges, EdgeIndexMap, *Callee, LazyCallGraph::Edge::Call);
96 void LazyCallGraph::Node::insertEdgeInternal(Function &Target, Edge::Kind EK) {
104 void LazyCallGraph::Node::insertEdgeInternal(Node &TargetN, Edge::Kind EK) {
109 void LazyCallGraph::Node::setEdgeKind(Function &TargetF, Edge::Kind EK) {
116 "Target not in the edge set for this caller?");
118 Edges[IndexMapI->second] = Edge();
134 EntryEdges.emplace_back(F, Edge::Ref);
149 for (const Edge &E : EntryEdges)
196 for (Edge &E : *N)
197 assert(E.getNode() && "Can't have an edge to a raw function!");
233 for (Edge &E : N) {
239 "Edge between SCCs violates post-order relationship.");
243 "Edge to a RefSCC missing us in its parent set.");
266 assert(!SourceN[TargetN].isCall() && "Must start with a ref edge!");
276 SourceN.setEdgeKind(TargetN.getFunction(), Edge::Call);
285 // insertion of an edge changes the SCC structure in any way.
288 // edge is toward the beginning of the postorder sequence because all edges
293 SourceN.setEdgeKind(TargetN.getFunction(), Edge::Call);
301 // When we do have an edge from an earlier SCC to a later SCC in the
308 // target SCC in postorder and for each SCC, if it has an edge to an SCC
315 // and thus the new edge will flow toward the start, we are done.
324 // including the target SCC and the source SCC. Inserting the edge from
330 // - Only mutates the SCCs when adding the edge actually changes the SCC
334 // constraint after the edge is inserted.
347 for (Edge &E : N.calls()) {
377 SourceN.setEdgeKind(TargetN.getFunction(), Edge::Call);
408 for (Edge &E : N) {
472 SourceN.setEdgeKind(TargetN.getFunction(), Edge::Call);
483 assert(SourceN[TargetN].isCall() && "Must start with a call edge!");
493 // Set the edge kind.
494 SourceN.setEdgeKind(TargetN.getFunction(), Edge::Ref);
496 // If this call edge is just connecting two separate SCCs within this RefSCC,
506 // Otherwise we are removing a call edge from a single SCC. This may break
533 // below: whenever we build an edge that reaches the target node, we know
615 // Move to the next edge.
655 // other SCCs we form because it contains the target node of the removed edge
674 assert(!SourceN[TargetN].isCall() && "Must start with a ref edge!");
683 // just flip the edge here.
684 SourceN.setEdgeKind(TargetN.getFunction(), Edge::Call);
694 assert(SourceN[TargetN].isCall() && "Must start with a call edge!");
703 // just flip the edge here.
704 SourceN.setEdgeKind(TargetN.getFunction(), Edge::Ref);
717 SourceN.insertEdgeInternal(TargetN, Edge::Ref);
726 Edge::Kind EK) {
834 // a connected set with the inserted edge, merge all of them into this SCC.
852 // FIXME: We should try to find a way to avoid this (rather expensive) edge
859 for (Edge &E : N) {
888 // connect the nodes to form the new edge.
889 SourceN.insertEdgeInternal(TargetN, Edge::Ref);
921 for (Edge &E : N) {
937 // Because the SCCs form a DAG, deleting such an edge cannot change the set
938 // of SCCs in the graph. However, it may cut an edge of the SCC DAG, making
947 // It may orphan an SCC if it is the last edge reaching it, but that does
952 << " edge orphaned the callee's SCC!\n");
963 "Cannot remove a call edge, it must first be made a ref edge");
965 // First remove the actual edge.
991 // Tarjan walk to re-form RefSCCs below: whenever we build an edge that
1064 // Check if this edge's target node connects to the deleted edge's
1176 // another edge walk.
1195 for (Edge &E : N) {
1209 "SCCs by removing this edge.");
1213 "SCCs before we removed this edge.");
1215 // If this SCC stopped being a leaf through this edge removal, remove it from
1219 // entire list if this RefSCC wasn't a leaf before the edge removal.
1229 void LazyCallGraph::insertEdge(Node &SourceN, Function &Target, Edge::Kind EK) {
1251 for (Edge &E : EntryEdges)
1258 for (Edge &E : N->Edges)
1355 // Move to the next edge.
1404 for (Edge &E : N) {
1475 // Move to the next edge.
1520 for (const LazyCallGraph::Edge &E : N)
1567 for (const LazyCallGraph::Edge &E : N) {
1570 if (!E.isCall()) // It is a ref edge.