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
66 "sample block/edge weights through the CFG."));
93 typedef std::pair<const BasicBlock *, const BasicBlock *> Edge;
94 typedef DenseMap<Edge, uint64_t> EdgeWeightMap;
137 void printEdgeWeight(raw_ostream &OS, Edge E);
146 uint64_t visitEdge(Edge E, unsigned *NumUnknownEdges, Edge *UnknownEdge);
161 /// Edge weights are computed by propagating basic block weights in
169 SmallSet<Edge, 128> VisitedEdges;
404 /// \brief Print the weight of edge \p E on stream \p OS.
407 /// \param E Edge to print.
408 void SampleProfileLoader::printEdgeWeight(raw_ostream &OS, Edge E) {
816 /// \brief Visit the given edge to decide if it has a valid weight.
821 /// \param E Edge to visit.
826 uint64_t SampleProfileLoader::visitEdge(Edge E, unsigned *NumUnknownEdges,
827 Edge *UnknownEdge) {
839 /// If the weight of a basic block is known, and there is only one edge
840 /// with an unknown weight, we can calculate the weight of that edge.
857 // matter that we only keep track of a single unknown edge. The
859 // edge is unknown (see setEdgeOrBlockWeight).
863 Edge UnknownEdge, SelfReferentialEdge;
868 Edge E = std::make_pair(Pred, BB);
876 Edge E = std::make_pair(BB, Succ);
884 // - All the edge weights are known (i.e., NumUnknownEdges == 0).
890 // - Only one edge is unknown and BB has already been visited.
891 // In this case, we can compute the weight of the edge by
893 // edge weights. If the edges weight more than BB, then the
894 // edge of the last remaining edge is set to zero.
896 // - There exists a self-referential edge and the weight of BB is
897 // known. In this case, this edge can be based on BB's weight.
899 // the self-referential edge as we did in the previous case.
909 // of all edge weights.
913 DEBUG(dbgs() << "All edge weights for " << BB->getName()
920 // If there is a single unknown edge and the block has been
928 DEBUG(dbgs() << "Set weight for edge: ";
933 // We have a self-referential edge and the weight of BB is known.
940 DEBUG(dbgs() << "Set self-referential edge weight to: ";
949 /// \brief Build in/out edge lists for each basic block in the CFG.
952 /// edges to another block B2, we only add a single B1->B2 edge.
984 /// of that edge is the weight of the block.
988 /// edge will be the weight of the block minus the sum of all the known
990 /// we set the unknown edge weight to zero.
992 /// - If there is a self-referential edge, and the weight of the block is
993 /// known, the weight for that edge is set to the weight of the block
1017 // edge weights computed during propagation.
1036 Edge E = std::make_pair(BB, Succ);
1131 /// of that edge is the weight of the block.
1134 /// block is already known, the weight of the unknown edge will
1137 /// we set the unknown edge weight to zero.
1139 /// - If there is a self-referential edge, and the weight of the block is
1140 /// known, the weight for that edge is set to the weight of the block