Home | History | Annotate | Download | only in Scalar

Lines Matching defs:Edge

18 //      to indicate the weights of each edge coming out of the branch.
19 // The weight of each edge is the weight of the target block for
20 // that edge. The weight of a block B is computed as the maximum
63 "sample block/edge weights through the CFG."));
68 typedef std::pair<BasicBlock *, BasicBlock *> Edge;
69 typedef DenseMap<Edge, unsigned> EdgeWeightMap;
108 void printEdgeWeight(raw_ostream &OS, Edge E);
117 unsigned visitEdge(Edge E, unsigned *NumUnknownEdges, Edge *UnknownEdge);
133 /// Edge weights are computed by propagating basic block weights in
141 SmallSet<Edge, 128> VisitedEdges;
179 /// \brief Print the weight of edge \p E on stream \p OS.
182 /// \param E Edge to print.
183 void SampleProfileLoader::printEdgeWeight(raw_ostream &OS, Edge E) {
400 /// \brief Visit the given edge to decide if it has a valid weight.
405 /// \param E Edge to visit.
410 unsigned SampleProfileLoader::visitEdge(Edge E, unsigned *NumUnknownEdges,
411 Edge *UnknownEdge) {
423 /// If the weight of a basic block is known, and there is only one edge
424 /// with an unknown weight, we can calculate the weight of that edge.
440 // matter that we only keep track of a single unknown edge. The
442 // edge is unknown (see setEdgeOrBlockWeight).
446 Edge UnknownEdge, SelfReferentialEdge;
451 Edge E = std::make_pair(Pred, BB);
459 Edge E = std::make_pair(BB, Succ);
467 // - All the edge weights are known (i.e., NumUnknownEdges == 0).
473 // - Only one edge is unknown and BB has already been visited.
474 // In this case, we can compute the weight of the edge by
476 // edge weights. If the edges weight more than BB, then the
477 // edge of the last remaining edge is set to zero.
479 // - There exists a self-referential edge and the weight of BB is
480 // known. In this case, this edge can be based on BB's weight.
482 // the self-referential edge as we did in the previous case.
492 // of all edge weights.
496 DEBUG(dbgs() << "All edge weights for " << BB->getName()
503 // If there is a single unknown edge and the block has been
511 DEBUG(dbgs() << "Set weight for edge: ";
516 // We have a self-referential edge and the weight of BB is known.
523 DEBUG(dbgs() << "Set self-referential edge weight to: ";
532 /// \brief Build in/out edge lists for each basic block in the CFG.
535 /// edges to another block B2, we only add a single B1->B2 edge.
567 /// of that edge is the weight of the block.
571 /// edge will be the weight of the block minus the sum of all the known
573 /// we set the unknown edge weight to zero.
575 /// - If there is a self-referential edge, and the weight of the block is
576 /// known, the weight for that edge is set to the weight of the block
596 // edge weights computed during propagation.
613 Edge E = std::make_pair(BB, Succ);
678 /// of that edge is the weight of the block.
681 /// block is already known, the weight of the unknown edge will
684 /// we set the unknown edge weight to zero.
686 /// - If there is a self-referential edge, and the weight of the block is
687 /// known, the weight for that edge is set to the weight of the block