Lines Matching defs:edge

28 //                  v->w, insert edge ENTRY->w and edge v->EXIT.
33 // Chord - An edge not in the spanning tree.
107 // instrumentation that will end up on each edge.
114 // Sets the target node of this edge. Required to split edges.
117 // Get/set whether edge is in the spanning tree.
121 // Get/ set whether this edge will be instrumented with a path number
126 // Get/set whether this edge will be instrumented with a path counter
133 // Get/set the path number increment that this edge will be instrumented
141 // Get/set whether the edge has been instrumented.
145 // Returns the successor number of this edge in the source.
152 // Whether this edge is in the spanning tree.
155 // Whether this edge is an initialiation of the path number.
158 // Whether this edge is a path counter increment.
161 // Whether this edge has been instrumented.
173 // Returns the Exit->Root edge. This edge is required for creating
191 // Updates the state when an edge has been split
239 // Removes the edge from the appropriate predecessor and successor lists.
240 void unlinkEdge(BallLarusEdge* edge);
242 // Makes an edge part of the spanning tree.
243 void makeEdgeSpanning(BLInstrumentationEdge* edge);
246 void pushInitializationFromEdge(BLInstrumentationEdge* edge);
249 void pushCountersFromEdge(BLInstrumentationEdge* edge);
286 // edge->getIncrement().
287 ConstantInt* createIncrementConstant(BLInstrumentationEdge* edge);
321 // Inserts instrumentation for the given edge
323 // Pre: The edge's source node has pathNumber set if edge is non zero
327 // corresponding to the value of the path register after edge's
330 BLInstrumentationEdge* edge,
333 // If this edge is a critical edge, then inserts a node at this edge.
334 // This edge becomes the first edge, and a new BallLarusEdge is created.
335 bool splitCritical(BLInstrumentationEdge* edge, BLInstrumentationDag* dag);
390 const BLInstrumentationEdge& edge)
393 const BLInstrumentationEdge& edge) {
394 os << "[" << edge.getSource()->getName() << " -> "
395 << edge.getTarget()->getName() << "] init: "
396 << (edge.isInitialization() ? "yes" : "no")
397 << " incr:" << edge.getIncrement() << " cinc: "
398 << (edge.isCounterIncrement() ? "yes" : "no");
415 // Sets the target node of this edge. Required to split edges.
420 // Returns whether this edge is in the spanning tree.
425 // Sets whether this edge is in the spanning tree.
430 // Returns whether this edge will be instrumented with a path number
436 // Sets whether this edge will be instrumented with a path number
442 // Returns whether this edge will be instrumented with a path counter
450 // Sets whether this edge will be instrumented with a path counter
456 // Gets the path number increment that this edge will be instrumented
465 // Set whether this edge will be instrumented with a path number
471 // True iff the edge has already been instrumented.
476 // Set whether this edge has been instrumented.
481 // Returns the successor number of this edge in the source.
507 // Returns the Exit->Root edge. This edge is required for creating
518 for( BLEdgeIterator edge = _edges.begin(), end = _edges.end();
519 edge != end; edge++ ) {
520 if( (*edge)->getType() == BallLarusEdge::CALLEDGE_PHONY )
521 callEdges.push_back(*edge);
550 // Updates the state when an edge has been split
600 for(BLEdgeIterator edge = node->succBegin(), predEnd = node->predEnd();
601 edge != predEnd; edge++) {
602 if(edge == succEnd) {
603 edge = node->predBegin();
608 if ((*edge)->getType() == BallLarusEdge::SPLITEDGE)
611 nextNode = forward? (*edge)->getTarget(): (*edge)->getSource();
614 makeEdgeSpanning((BLInstrumentationEdge*)(*edge));
619 for(BLEdgeIterator edge = _edges.begin(), end = _edges.end();
620 edge != end; edge++) {
621 BLInstrumentationEdge* instEdge = (BLInstrumentationEdge*) (*edge);
623 if(!instEdge->isInSpanningTree() && (*edge)->getType()
650 BallLarusEdge* edge;
654 edge = (*next);
656 if( edge->getType() == BallLarusEdge::BACKEDGE_PHONY ||
657 edge->getType() == BallLarusEdge::SPLITEDGE_PHONY ||
658 edge->getType() == BallLarusEdge::CALLEDGE_PHONY ) {
659 unlinkEdge(edge);
681 for( BLEdgeIterator edge = _edges.begin(), end = _edges.end();
682 edge != end; edge++) {
683 std::string sourceName = (*edge)->getSource()->getName();
684 std::string targetName = (*edge)->getTarget()->getName();
689 long inc = ((BLInstrumentationEdge*)(*edge))->getIncrement();
691 switch( (*edge)->getType() ) {
779 // Removes the edge from the appropriate predecessor and successor
781 void BLInstrumentationDag::unlinkEdge(BallLarusEdge* edge) {
782 if(edge == getExitRootEdge())
783 DEBUG(dbgs() << " Removing exit->root edge\n");
785 edge->getSource()->removeSuccEdge(edge);
786 edge->getTarget()->removePredEdge(edge);
789 // Makes an edge part of the spanning tree.
790 void BLInstrumentationDag::makeEdgeSpanning(BLInstrumentationEdge* edge) {
791 edge->setIsInSpanningTree(true);
792 _treeEdges.push_back(edge);
797 BLInstrumentationEdge* edge) {
800 target = edge->getTarget();
813 edge->getIncrement());
818 edge->setIncrement(0);
819 edge->setIsInitialization(false);
824 void BLInstrumentationDag::pushCountersFromEdge(BLInstrumentationEdge* edge) {
827 source = edge->getSource();
829 || edge->isInitialization()) {
841 edge->getIncrement());
846 edge->setIncrement(0);
847 edge->setIsCounterIncrement(false);
900 // edge->getIncrement().
902 BLInstrumentationEdge* edge) {
903 return(createIncrementConstant(edge->getIncrement(), 32));
1068 // Inserts instrumentation for the given edge
1070 // Pre: The edge's source node has pathNumber set if edge is non zero
1074 // corresponding to the value of the path register after edge's
1078 void PathProfiler::insertInstrumentationStartingAt(BLInstrumentationEdge* edge,
1080 // Mark the edge as instrumented
1081 edge->setHasInstrumentation(true);
1082 DEBUG(dbgs() << "\nInstrumenting edge: " << (*edge) << "\n");
1084 // create a new node for this edge's instrumentation
1085 splitCritical(edge, dag);
1087 BLInstrumentationNode* sourceNode = (BLInstrumentationNode*)edge->getSource();
1088 BLInstrumentationNode* targetNode = (BLInstrumentationNode*)edge->getTarget();
1103 // The target node only has one predecessor, so we can safely insert edge
1117 errs() << "Instrumenting could not split a critical edge.\n";
1118 DEBUG(dbgs() << " Couldn't split edge " << (*edge) << ".\n");
1122 // Insert instrumentation if this is a back or split edge
1123 if( edge->getType() == BallLarusEdge::BACKEDGE ||
1124 edge->getType() == BallLarusEdge::SPLITEDGE ) {
1126 (BLInstrumentationEdge*) edge->getPhonyRoot();
1128 (BLInstrumentationEdge*) edge->getPhonyExit();
1130 assert( top->isInitialization() && " Top phony edge did not"
1132 assert( bottom->isCounterIncrement() && " Bottom phony edge"
1135 // split edge has yet to be initialized
1145 // add information from the bottom edge, if it exists
1171 // Insert instrumentation if this is a normal edge
1177 if( edge->isInitialization() ) { // initialize path number
1178 instrumentNode->setEndingPathNumber(createIncrementConstant(edge));
1179 } else if( edge->getIncrement() ) {// increment path number
1183 createIncrementConstant(edge),
1192 if( edge->isCounterIncrement() ) {
1228 // Iterate through each call edge and apply the appropriate hash increment
1231 for( BLEdgeIterator edge = callEdges.begin(),
1232 end = callEdges.end(); edge != end; edge++ ) {
1234 (BLInstrumentationNode*)(*edge)->getSource();
1248 long inc = ((BLInstrumentationEdge*)(*edge))->getIncrement();
1258 ((BLInstrumentationEdge*)(*edge))->getIncrement(), 32);
1399 // If this edge is a critical edge, then inserts a node at this edge.
1400 // This edge becomes the first edge, and a new BallLarusEdge is created.
1401 // Returns true if the edge was split
1402 bool PathProfiler::splitCritical(BLInstrumentationEdge* edge,
1404 unsigned succNum = edge->getSuccessorNumber();
1405 BallLarusNode* sourceNode = edge->getSource();
1406 BallLarusNode* targetNode = edge->getTarget();
1420 dag->splitUpdate(edge, newBlock);