From: Anand Shukla Date: Mon, 16 Sep 2002 05:24:49 +0000 (+0000) Subject: Incorporated changes in alloca instruction X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=ada50a5c1df1f06687356a3bc4849507ab74c28e;p=oota-llvm.git Incorporated changes in alloca instruction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3732 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp index 6a4e9e246f9..cd341920a55 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp @@ -74,14 +74,9 @@ bool ProfilePaths::runOnFunction(Function &F){ return false; } - //std::cerr<<"Instrumenting\n-----------------\n"; - //std::cerr<().getExitNode(); @@ -120,10 +115,10 @@ bool ProfilePaths::runOnFunction(Function &F){ Graph g(nodes,edges, startNode, exitNode); - //#ifdef DEBUG_PATH_PROFILES - //std::cerr<<"Original graph\n"; - //printGraph(g); - //#endif +#ifdef DEBUG_PATH_PROFILES + std::cerr<<"Original graph\n"; + printGraph(g); +#endif BasicBlock *fr = &F.front(); @@ -132,19 +127,15 @@ bool ProfilePaths::runOnFunction(Function &F){ vector be; std::map nodePriority; //it ranks nodes in depth first order traversal g.getBackEdges(be, nodePriority); - /* - std::cerr<<"Node priority--------------\n"; - for(std::map::iterator MI = nodePriority.begin(), - ME = nodePriority.end(); MI!=ME; ++MI) - std::cerr<first->getElement()->getName()<<"->"<second<<"\n"; - std::cerr<<"End Node priority--------------\n"; - */ - //std::cerr<<"BackEdges-------------\n"; - // for(vector::iterator VI=be.begin(); VI!=be.end(); ++VI){ - //printEdge(*VI); - //cerr<<"\n"; - //} - //std::cerr<<"------\n"; + +#ifdef DEBUG_PATH_PROFILES + std::cerr<<"BackEdges-------------\n"; + for(vector::iterator VI=be.begin(); VI!=be.end(); ++VI){ + printEdge(*VI); + cerr<<"\n"; + } + std::cerr<<"------\n"; +#endif #ifdef DEBUG_PATH_PROFILES cerr<<"Backedges:"< exDummy; addDummyEdges(stDummy, exDummy, g, be); - //std::cerr<<"After adding dummy edges\n"; - //printGraph(g); - +#ifdef DEBUG_PATH_PROFILES + std::cerr<<"After adding dummy edges\n"; + printGraph(g); +#endif + // Now, every edge in the graph is assigned a weight // This weight later adds on to assign path // numbers to different paths in the graph // All paths for now are acyclic, // since no back edges in the graph now // numPaths is the number of acyclic paths in the graph - int numPaths=valueAssignmentToEdges(g, nodePriority); + int numPaths=valueAssignmentToEdges(g, nodePriority, be); if(numPaths<=1 || numPaths >5000) return false; - //std::cerr<<"Numpaths="<