Home | History | Annotate | Download | only in Instrumentation

Lines Matching refs:edge

28 //                  v->w, insert edge ENTRY->w and edge v->EXIT.
33 // Chord - An edge not in the spanning tree.
108 // instrumentation that will end up on each edge.
115 // Sets the target node of this edge. Required to split edges.
118 // Get/set whether edge is in the spanning tree.
122 // Get/ set whether this edge will be instrumented with a path number
127 // Get/set whether this edge will be instrumented with a path counter
134 // Get/set the path number increment that this edge will be instrumented
142 // Get/set whether the edge has been instrumented.
146 // Returns the successor number of this edge in the source.
153 // Whether this edge is in the spanning tree.
156 // Whether this edge is an initialiation of the path number.
159 // Whether this edge is a path counter increment.
162 // Whether this edge has been instrumented.
174 // Returns the Exit->Root edge. This edge is required for creating
192 // Updates the state when an edge has been split
227 // Allows subclasses to determine which type of Edge is created.
240 // Removes the edge from the appropriate predecessor and successor lists.
241 void unlinkEdge(BallLarusEdge* edge);
243 // Makes an edge part of the spanning tree.
244 void makeEdgeSpanning(BLInstrumentationEdge* edge);
247 void pushInitializationFromEdge(BLInstrumentationEdge* edge);
250 void pushCountersFromEdge(BLInstrumentationEdge* edge);
287 // edge->getIncrement().
288 ConstantInt* createIncrementConstant(BLInstrumentationEdge* edge);
322 // Inserts instrumentation for the given edge
324 // Pre: The edge's source node has pathNumber set if edge is non zero
327 // Post: Edge's target node has a pathNumber set to the path number Value
328 // corresponding to the value of the path register after edge's
331 BLInstrumentationEdge* edge,
334 // If this edge is a critical edge, then inserts a node at this edge.
335 // This edge becomes the first edge, and a new BallLarusEdge is created.
336 bool splitCritical(BLInstrumentationEdge* edge, BLInstrumentationDag* dag);
391 const BLInstrumentationEdge& edge)
394 const BLInstrumentationEdge& edge) {
395 os << "[" << edge.getSource()->getName() << " -> "
396 << edge.getTarget()->getName() << "] init: "
397 << (edge.isInitialization() ? "yes" : "no")
398 << " incr:" << edge.getIncrement() << " cinc: "
399 << (edge.isCounterIncrement() ? "yes" : "no");
416 // Sets the target node of this edge. Required to split edges.
421 // Returns whether this edge is in the spanning tree.
426 // Sets whether this edge is in the spanning tree.
431 // Returns whether this edge will be instrumented with a path number
437 // Sets whether this edge will be instrumented with a path number
443 // Returns whether this edge will be instrumented with a path counter
451 // Sets whether this edge will be instrumented with a path counter
457 // Gets the path number increment that this edge will be instrumented
466 // Set whether this edge will be instrumented with a path number
472 // True iff the edge has already been instrumented.
477 // Set whether this edge has been instrumented.
482 // Returns the successor number of this edge in the source.
508 // Returns the Exit->Root edge. This edge is required for creating
519 for( BLEdgeIterator edge = _edges.begin(), end = _edges.end();
520 edge != end; edge++ ) {
521 if( (*edge)->getType() == BallLarusEdge::CALLEDGE_PHONY )
522 callEdges.push_back(*edge);
551 // Updates the state when an edge has been split
559 DEBUG(dbgs() << " Edge split: " << *formerEdge << "\n");
601 for(BLEdgeIterator edge = node->succBegin(), predEnd = node->predEnd();
602 edge != predEnd; edge++) {
603 if(edge == succEnd) {
604 edge = node->predBegin();
609 if ((*edge)->getType() == BallLarusEdge::SPLITEDGE)
612 nextNode = forward? (*edge)->getTarget(): (*edge)->getSource();
615 makeEdgeSpanning((BLInstrumentationEdge*)(*edge));
620 for(BLEdgeIterator edge = _edges.begin(), end = _edges.end();
621 edge != end; edge++) {
622 BLInstrumentationEdge* instEdge = (BLInstrumentationEdge*) (*edge);
624 if(!instEdge->isInSpanningTree() && (*edge)->getType()
651 BallLarusEdge* edge;
655 edge = (*next);
657 if( edge->getType() == BallLarusEdge::BACKEDGE_PHONY ||
658 edge->getType() == BallLarusEdge::SPLITEDGE_PHONY ||
659 edge->getType() == BallLarusEdge::CALLEDGE_PHONY ) {
660 unlinkEdge(edge);
682 for( BLEdgeIterator edge = _edges.begin(), end = _edges.end();
683 edge != end; edge++) {
684 std::string sourceName = (*edge)->getSource()->getName();
685 std::string targetName = (*edge)->getTarget()->getName();
690 long inc = ((BLInstrumentationEdge*)(*edge))->getIncrement();
692 switch( (*edge)->getType() ) {
731 // Allows subclasses to determine which type of Edge is created.
780 // Removes the edge from the appropriate predecessor and successor
782 void BLInstrumentationDag::unlinkEdge(BallLarusEdge* edge) {
783 if(edge == getExitRootEdge())
784 DEBUG(dbgs() << " Removing exit->root edge\n");
786 edge->getSource()->removeSuccEdge(edge);
787 edge->getTarget()->removePredEdge(edge);
790 // Makes an edge part of the spanning tree.
791 void BLInstrumentationDag::makeEdgeSpanning(BLInstrumentationEdge* edge) {
792 edge->setIsInSpanningTree(true);
793 _treeEdges.push_back(edge);
798 BLInstrumentationEdge* edge) {
801 target = edge->getTarget();
814 edge->getIncrement());
819 edge->setIncrement(0);
820 edge->setIsInitialization(false);
825 void BLInstrumentationDag::pushCountersFromEdge(BLInstrumentationEdge* edge) {
828 source = edge->getSource();
830 || edge->isInitialization()) {
842 edge->getIncrement());
847 edge->setIncrement(0);
848 edge->setIsCounterIncrement(false);
901 // edge->getIncrement().
903 BLInstrumentationEdge* edge) {
904 return(createIncrementConstant(edge->getIncrement(), 32));
1069 // Inserts instrumentation for the given edge
1071 // Pre: The edge's source node has pathNumber set if edge is non zero
1074 // Post: Edge's target node has a pathNumber set to the path number Value
1075 // corresponding to the value of the path register after edge's
1079 void PathProfiler::insertInstrumentationStartingAt(BLInstrumentationEdge* edge,
1081 // Mark the edge as instrumented
1082 edge->setHasInstrumentation(true);
1083 DEBUG(dbgs() << "\nInstrumenting edge: " << (*edge) << "\n");
1085 // create a new node for this edge's instrumentation
1086 splitCritical(edge, dag);
1088 BLInstrumentationNode* sourceNode = (BLInstrumentationNode*)edge->getSource();
1089 BLInstrumentationNode* targetNode = (BLInstrumentationNode*)edge->getTarget();
1104 // The target node only has one predecessor, so we can safely insert edge
1118 errs() << "Instrumenting could not split a critical edge.\n";
1119 DEBUG(dbgs() << " Couldn't split edge " << (*edge) << ".\n");
1123 // Insert instrumentation if this is a back or split edge
1124 if( edge->getType() == BallLarusEdge::BACKEDGE ||
1125 edge->getType() == BallLarusEdge::SPLITEDGE ) {
1127 (BLInstrumentationEdge*) edge->getPhonyRoot();
1129 (BLInstrumentationEdge*) edge->getPhonyExit();
1131 assert( top->isInitialization() && " Top phony edge did not"
1133 assert( bottom->isCounterIncrement() && " Bottom phony edge"
1136 // split edge has yet to be initialized
1146 // add information from the bottom edge, if it exists
1172 // Insert instrumentation if this is a normal edge
1178 if( edge->isInitialization() ) { // initialize path number
1179 instrumentNode->setEndingPathNumber(createIncrementConstant(edge));
1180 } else if( edge->getIncrement() ) {// increment path number
1184 createIncrementConstant(edge),
1193 if( edge->isCounterIncrement() ) {
1211 DEBUG(dbgs() << " Edge " << *(BLInstrumentationEdge*)(*next)
1229 // Iterate through each call edge and apply the appropriate hash increment
1232 for( BLEdgeIterator edge = callEdges.begin(),
1233 end = callEdges.end(); edge != end; edge++ ) {
1235 (BLInstrumentationNode*)(*edge)->getSource();
1249 long inc = ((BLInstrumentationEdge*)(*edge))->getIncrement();
1259 ((BLInstrumentationEdge*)(*edge))->getIncrement(), 32);
1400 // If this edge is a critical edge, then inserts a node at this edge.
1401 // This edge becomes the first edge, and a new BallLarusEdge is created.
1402 // Returns true if the edge was split
1403 bool PathProfiler::splitCritical(BLInstrumentationEdge* edge,
1405 unsigned succNum = edge->getSuccessorNumber();
1406 BallLarusNode* sourceNode = edge->getSource();
1407 BallLarusNode* targetNode = edge->getTarget();
1421 dag->splitUpdate(edge, newBlock);