Lines Matching full: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
69 "sample block/edge weights through the CFG."));
86 typedef std::pair<const BasicBlock *, const BasicBlock *> Edge;
87 typedef DenseMap<Edge, uint64_t> EdgeWeightMap;
118 void printEdgeWeight(raw_ostream &OS, Edge E);
126 uint64_t visitEdge(Edge E, unsigned *NumUnknownEdges, Edge *UnknownEdge);
141 /// Edge weights are computed by propagating basic block weights in
149 SmallSet<Edge, 32> VisitedEdges;
411 /// \brief Print the weight of edge \p E on stream \p OS.
414 /// \param E Edge to print.
415 void SampleProfileLoader::printEdgeWeight(raw_ostream &OS, Edge E) {
769 /// \brief Visit the given edge to decide if it has a valid weight.
774 /// \param E Edge to visit.
779 uint64_t SampleProfileLoader::visitEdge(Edge E, unsigned *NumUnknownEdges,
780 Edge *UnknownEdge) {
792 /// If the weight of a basic block is known, and there is only one edge
793 /// with an unknown weight, we can calculate the weight of that edge.
810 // matter that we only keep track of a single unknown edge. The
812 // edge is unknown (see setEdgeOrBlockWeight).
816 Edge UnknownEdge, SelfReferentialEdge, SingleEdge;
822 Edge E = std::make_pair(Pred, BB);
834 Edge E = std::make_pair(BB, Succ);
845 // - All the edge weights are known (i.e., NumUnknownEdges == 0).
851 // - Only one edge is unknown and BB has already been visited.
852 // In this case, we can compute the weight of the edge by
854 // edge weights. If the edges weight more than BB, then the
855 // edge of the last remaining edge is set to zero.
857 // - There exists a self-referential edge and the weight of BB is
858 // known. In this case, this edge can be based on BB's weight.
860 // the self-referential edge as we did in the previous case.
871 // of all edge weights.
875 DEBUG(dbgs() << "All edge weights for " << BB->getName()
881 // If there is only one edge for the visited basic block, use the
882 // block weight to adjust edge weight if edge weight is smaller.
887 // If there is a single unknown edge and the block has been
895 DEBUG(dbgs() << "Set weight for edge: ";
900 // We have a self-referential edge and the weight of BB is known.
907 DEBUG(dbgs() << "Set self-referential edge weight to: ";
916 /// \brief Build in/out edge lists for each basic block in the CFG.
919 /// edges to another block B2, we only add a single B1->B2 edge.
951 /// of that edge is the weight of the block.
955 /// edge will be the weight of the block minus the sum of all the known
957 /// we set the unknown edge weight to zero.
959 /// - If there is a self-referential edge, and the weight of the block is
960 /// known, the weight for that edge is set to the weight of the block
984 // edge weights computed during propagation.
1016 Edge E = std::make_pair(BB, Succ);
1111 /// of that edge is the weight of the block.
1114 /// block is already known, the weight of the unknown edge will
1117 /// we set the unknown edge weight to zero.
1119 /// - If there is a self-referential edge, and the weight of the block is
1120 /// known, the weight for that edge is set to the weight of the block