From lattner at cs.uiuc.edu Mon Feb 10 09:57:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Feb 10 09:57:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h Message-ID: <200302101556.JAA13845@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: Graph.h updated: 1.6 -> 1.7 --- Log message: Revert Anand's patch which broke the build --- Diffs of the changes: Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h:1.6 llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h:1.7 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h:1.6 Sun Feb 9 15:15:36 2003 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h Mon Feb 10 09:55:50 2003 @@ -410,7 +410,7 @@ //get the code to be inserted on the edge //This is determined from cond (1-6) - void getCode(Instruction *a, Value *b, Function *M, BasicBlock *BB, + void getCode(Instruction *a, Instruction *b, Function *M, BasicBlock *BB, std::vector &retVec); }; @@ -423,7 +423,7 @@ //Do graph processing: to determine minimal edge increments, //appropriate code insertions etc and insert the code at //appropriate locations -void processGraph(Graph &g, Instruction *rInst, Value *countInst, std::vector &be, std::vector &stDummy, std::vector &exDummy, int n, int MethNo, Value *threshold); +void processGraph(Graph &g, Instruction *rInst, Instruction *countInst, std::vector &be, std::vector &stDummy, std::vector &exDummy, int n, int MethNo, Value *threshold); //print the graph (for debugging) void printGraph(Graph &g); @@ -432,7 +432,7 @@ //void printGraph(const Graph g); //insert a basic block with appropriate code //along a given edge -void insertBB(Edge ed, getEdgeCode *edgeCode, Instruction *rInst, Value *countInst, int n, int Methno, Value *threshold); +void insertBB(Edge ed, getEdgeCode *edgeCode, Instruction *rInst, Instruction *countInst, int n, int Methno, Value *threshold); //Insert the initialization code in the top BB //this includes initializing r, and count @@ -442,7 +442,7 @@ //number of that path //Count is an array, where Count[k] represents //the number of executions of path k -void insertInTopBB(BasicBlock *front, int k, Instruction *rVar, Value *threshold); +void insertInTopBB(BasicBlock *front, int k, Instruction *rVar, Instruction *countVar, Value *threshold); //Add dummy edges corresponding to the back edges //If a->b is a backedge From lattner at cs.uiuc.edu Mon Feb 10 12:18:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Feb 10 12:18:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Steensgaard.cpp Message-ID: <200302101817.MAA18775@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Steensgaard.cpp updated: 1.24 -> 1.25 --- Log message: Fix problem breaking Fhourstones --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.24 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.25 --- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.24 Sun Feb 9 18:14:57 2003 +++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Mon Feb 10 12:16:19 2003 @@ -92,7 +92,8 @@ // Loop over all pointer arguments, resolving them to their provided pointers unsigned PtrArgIdx = 0; - for (Function::aiterator AI = F->abegin(), AE = F->aend(); AI != AE; ++AI) { + for (Function::aiterator AI = F->abegin(), AE = F->aend(); + AI != AE && PtrArgIdx < Call.getNumPtrArgs(); ++AI) { hash_map::iterator I = ValMap.find(AI); if (I != ValMap.end()) // If its a pointer argument... I->second.mergeWith(Call.getPtrArg(PtrArgIdx++)); From lattner at cs.uiuc.edu Mon Feb 10 12:18:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Feb 10 12:18:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp Message-ID: <200302101817.MAA18785@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: TopDownClosure.cpp updated: 1.38 -> 1.39 --- Log message: Rearrange code --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.38 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.39 --- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.38 Sun Feb 9 12:42:43 2003 +++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp Mon Feb 10 12:16:36 2003 @@ -103,6 +103,15 @@ // Get the current functions graph... DSGraph &Graph = getOrCreateDSGraph(F); + // Recompute the Incomplete markers and eliminate unreachable nodes. + Graph.maskIncompleteMarkers(); + // FIXME: Need to check if all callers have been found, or rather if a + // funcpointer escapes! + unsigned Flags = F.hasInternalLinkage() ? + DSGraph::IgnoreFormalArgs : DSGraph::MarkFormalArgs; + Graph.markIncompleteNodes(Flags | DSGraph::IgnoreGlobals); + Graph.removeDeadNodes(DSGraph::RemoveUnreachableGlobals); + const std::vector &CallSites = Graph.getFunctionCalls(); if (CallSites.empty()) { DEBUG(std::cerr << " [TD] No callees for: " << F.getName() << "\n"); @@ -153,7 +162,8 @@ hash_map OldNodeMap; CG.cloneInto(Graph, OldValMap, OldNodeMap, DSGraph::StripModRefBits | - DSGraph::KeepAllocaBit | DSGraph::DontCloneCallNodes); + DSGraph::KeepAllocaBit | DSGraph::DontCloneCallNodes | + DSGraph::DontCloneAuxCallNodes); OldValMap.clear(); // We don't care about the ValMap // Loop over all of the invocation sites of the callee, resolving @@ -194,8 +204,9 @@ OldNodeMap.clear(); // Recompute the Incomplete markers and eliminate unreachable nodes. + CG.removeTriviallyDeadNodes(); CG.maskIncompleteMarkers(); - CG.markIncompleteNodes(DSGraph::MarkFormalArgs); + CG.markIncompleteNodes(DSGraph::MarkFormalArgs |DSGraph::IgnoreGlobals); CG.removeDeadNodes(DSGraph::RemoveUnreachableGlobals); } @@ -212,14 +223,5 @@ calculateGraph(*I->first); } } - - // Recompute the Incomplete markers and eliminate unreachable nodes. - Graph.maskIncompleteMarkers(); - // FIXME: Need to check if all callers have been found, or rather if a - // funcpointer escapes! - unsigned Flags = F.hasInternalLinkage() ? - DSGraph::IgnoreFormalArgs : DSGraph::MarkFormalArgs; - Graph.markIncompleteNodes(Flags | DSGraph::IgnoreGlobals); - Graph.removeDeadNodes(DSGraph::RemoveUnreachableGlobals); } From lattner at cs.uiuc.edu Mon Feb 10 12:18:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Feb 10 12:18:03 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Printer.cpp Message-ID: <200302101817.MAA18797@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Printer.cpp updated: 1.47 -> 1.48 --- Log message: Implement a new "viewGraph" method which can be used to instantly view a graph from gdb --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/Printer.cpp diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.47 llvm/lib/Analysis/DataStructure/Printer.cpp:1.48 --- llvm/lib/Analysis/DataStructure/Printer.cpp:1.47 Wed Feb 5 15:59:56 2003 +++ llvm/lib/Analysis/DataStructure/Printer.cpp Mon Feb 10 12:17:07 2003 @@ -179,6 +179,23 @@ } } +/// viewGraph - Emit a dot graph, run 'dot', run gv on the postscript file, +/// then cleanup. For use from the debugger. +/// +void DSGraph::viewGraph() const { + std::ofstream F("/tmp/tempgraph.dot"); + if (!F.good()) { + std::cerr << "Error opening '/tmp/tempgraph.dot' for temporary graph!\n"; + return; + } + print(F); + if (system("dot -Tps /tmp/tempgraph.dot > /tmp/tempgraph.ps")) + std::cerr << "Error running dot: 'dot' not in path?\n"; + system("gv /tmp/tempgraph.ps"); + system("rm /tmp/tempgraph.dot /tmp/tempgraph.ps"); +} + + template static void printCollection(const Collection &C, std::ostream &O, const Module *M, const std::string &Prefix) { From lattner at cs.uiuc.edu Mon Feb 10 12:19:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Feb 10 12:19:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DSGraph.h Message-ID: <200302101818.MAA18808@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DSGraph.h updated: 1.45 -> 1.46 --- Log message: Implement a new method "viewGraph" which can be used to instantly view a graph from GDB. --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DSGraph.h diff -u llvm/include/llvm/Analysis/DSGraph.h:1.45 llvm/include/llvm/Analysis/DSGraph.h:1.46 --- llvm/include/llvm/Analysis/DSGraph.h:1.45 Sun Feb 9 12:40:25 2003 +++ llvm/include/llvm/Analysis/DSGraph.h Mon Feb 10 12:17:38 2003 @@ -118,8 +118,17 @@ return Nodes.size(); } + /// print - Print a dot graph to the specified ostream... void print(std::ostream &O) const; + + /// dump - call print(std::cerr), for use from the debugger... + /// void dump() const; + + /// viewGraph - Emit a dot graph, run 'dot', run gv on the postscript file, + /// then cleanup. For use from the debugger. + void viewGraph() const; + void writeGraphToFile(std::ostream &O, const std::string &GraphName) const; /// maskNodeTypes - Apply a mask to all of the node types in the graph. This From lattner at cs.uiuc.edu Mon Feb 10 12:20:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Feb 10 12:20:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp Message-ID: <200302101819.MAA18822@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.90 -> 1.91 --- Log message: Fix problem breaking GAP, use hasNoReferrers more --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.90 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.91 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.90 Sun Feb 9 12:41:49 2003 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Mon Feb 10 12:18:18 2003 @@ -86,7 +86,7 @@ (*I)->setOffset(0); // If we have links, merge all of our outgoing links together... - for (unsigned i = 1, e = Links.size(); i < e; ++i) + for (unsigned i = 1; i < Links.size(); ++i) Links[0].mergeWith(Links[i]); Links.resize(1); } @@ -903,8 +903,8 @@ } } - if ((Node->NodeType & ~DSNode::DEAD) == 0 && - Node->getReferrers().empty()) { // This node is dead! + if ((Node->NodeType & ~DSNode::DEAD) == 0 && Node->hasNoReferrers()) { + // This node is dead! delete Node; // Free memory... Nodes.erase(Nodes.begin()+i--); // Remove from node list... } @@ -1066,7 +1066,7 @@ assert(((N->NodeType & DSNode::GlobalNode) == 0 || (Flags & DSGraph::RemoveUnreachableGlobals)) && "Killing a global?"); - while (!N->getReferrers().empty()) // Rewrite referrers + while (!N->hasNoReferrers()) // Rewrite referrers N->getReferrers().back()->setNode(0); delete N; // Usecount is zero } From lattner at cs.uiuc.edu Mon Feb 10 12:21:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Feb 10 12:21:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DSNode.h DSSupport.h Message-ID: <200302101820.MAA18843@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DSNode.h updated: 1.19 -> 1.20 DSSupport.h updated: 1.12 -> 1.13 --- Log message: Move getNode() out of line --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DSNode.h diff -u llvm/include/llvm/Analysis/DSNode.h:1.19 llvm/include/llvm/Analysis/DSNode.h:1.20 --- llvm/include/llvm/Analysis/DSNode.h:1.19 Fri Jan 31 22:51:53 2003 +++ llvm/include/llvm/Analysis/DSNode.h Mon Feb 10 12:19:41 2003 @@ -78,7 +78,7 @@ ~DSNode() { dropAllReferences(); - assert(Referrers.empty() && "Referrers to dead node exist!"); + assert(hasNoReferrers() && "Referrers to dead node exist!"); } // Iterator for graph interface... Defined in DSGraphTraits.h @@ -241,6 +241,10 @@ //===----------------------------------------------------------------------===// // Define inline DSNodeHandle functions that depend on the definition of DSNode // +inline DSNode *DSNodeHandle::getNode() const { + return N; +} + inline void DSNodeHandle::setNode(DSNode *n) { if (N) N->removeReferrer(this); N = n; Index: llvm/include/llvm/Analysis/DSSupport.h diff -u llvm/include/llvm/Analysis/DSSupport.h:1.12 llvm/include/llvm/Analysis/DSSupport.h:1.13 --- llvm/include/llvm/Analysis/DSSupport.h:1.12 Wed Feb 5 15:59:36 2003 +++ llvm/include/llvm/Analysis/DSSupport.h Mon Feb 10 12:19:41 2003 @@ -72,10 +72,10 @@ inline void swap(DSNodeHandle &H); // Allow explicit conversion to DSNode... - DSNode *getNode() const { return N; } + inline DSNode *getNode() const; // Defined inline in DSNode.h unsigned getOffset() const { return Offset; } - inline void setNode(DSNode *N); // Defined inline later... + inline void setNode(DSNode *N); // Defined inline in DSNode.h void setOffset(unsigned O) { Offset = O; } void addEdgeTo(unsigned LinkNo, const DSNodeHandle &N); From lattner at cs.uiuc.edu Mon Feb 10 12:49:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Feb 10 12:49:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp Message-ID: <200302101848.MAA22168@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.91 -> 1.92 --- Log message: Modest speedup which seems to help steens quite a bit on large graphs --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.91 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.92 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.91 Mon Feb 10 12:18:18 2003 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Mon Feb 10 12:47:23 2003 @@ -906,7 +906,8 @@ if ((Node->NodeType & ~DSNode::DEAD) == 0 && Node->hasNoReferrers()) { // This node is dead! delete Node; // Free memory... - Nodes.erase(Nodes.begin()+i--); // Remove from node list... + Nodes[i--] = Nodes.back(); + Nodes.pop_back(); // Remove from node list... } } } From lattner at cs.uiuc.edu Mon Feb 10 16:48:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Feb 10 16:48:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DSGraphTraits.h Message-ID: <200302102247.QAA32474@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DSGraphTraits.h updated: 1.11 -> 1.12 --- Log message: Bugfix for calling dump() after the links vector has been cleared --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DSGraphTraits.h diff -u llvm/include/llvm/Analysis/DSGraphTraits.h:1.11 llvm/include/llvm/Analysis/DSGraphTraits.h:1.12 --- llvm/include/llvm/Analysis/DSGraphTraits.h:1.11 Mon Nov 18 15:42:19 2002 +++ llvm/include/llvm/Analysis/DSGraphTraits.h Mon Feb 10 16:46:47 2003 @@ -25,8 +25,7 @@ DSNodeIterator(NodeTy *N) : Node(N), Offset(0) {} // begin iterator DSNodeIterator(NodeTy *N, bool) // Create end iterator : Node(N) { - Offset = (N->getSize()+((1 << DS::PointerShift)-1)) & - ~((1 << DS::PointerShift)-1); + Offset = N->getNumLinks() << DS::PointerShift; } public: DSNodeIterator(const DSNodeHandle &NH) From lattner at cs.uiuc.edu Tue Feb 11 00:37:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Feb 11 00:37:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DSGraph.h Message-ID: <200302110636.AAA11447@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DSGraph.h updated: 1.46 -> 1.47 --- Log message: Fix uninitialized member problem --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DSGraph.h diff -u llvm/include/llvm/Analysis/DSGraph.h:1.46 llvm/include/llvm/Analysis/DSGraph.h:1.47 --- llvm/include/llvm/Analysis/DSGraph.h:1.46 Mon Feb 10 12:17:38 2003 +++ llvm/include/llvm/Analysis/DSGraph.h Tue Feb 11 00:36:00 2003 @@ -37,7 +37,8 @@ void operator=(const DSGraph &); // DO NOT IMPLEMENT public: - DSGraph() : Func(0), GlobalsGraph(0) {} // Create a new, empty, DSGraph. + // Create a new, empty, DSGraph. + DSGraph() : Func(0), GlobalsGraph(0), PrintAuxCalls(false) {} DSGraph(Function &F, DSGraph *GlobalsGraph); // Compute the local DSGraph // Copy ctor - If you want to capture the node mapping between the source and From lattner at cs.uiuc.edu Tue Feb 11 13:28:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Feb 11 13:28:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Printer.cpp Message-ID: <200302111927.NAA24975@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Printer.cpp updated: 1.48 -> 1.49 --- Log message: Minor tweaks to printing. Close the file before viewing it in viewGraph --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/Printer.cpp diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.48 llvm/lib/Analysis/DataStructure/Printer.cpp:1.49 --- llvm/lib/Analysis/DataStructure/Printer.cpp:1.48 Mon Feb 10 12:17:07 2003 +++ llvm/lib/Analysis/DataStructure/Printer.cpp Tue Feb 11 13:27:27 2003 @@ -47,6 +47,7 @@ if (N->NodeType & DSNode::Incomplete ) OS << "I"; if (N->NodeType & DSNode::Modified ) OS << "M"; if (N->NodeType & DSNode::Read ) OS << "R"; + if (N->NodeType & DSNode::DEAD ) OS << ""; OS << "\n"; } @@ -64,7 +65,7 @@ if (G->hasFunction()) return "Function " + G->getFunction().getName(); else - return "Globals graph"; + return "Global graph"; } static const char *getGraphProperties(const DSGraph *G) { @@ -189,6 +190,7 @@ return; } print(F); + F.close(); if (system("dot -Tps /tmp/tempgraph.dot > /tmp/tempgraph.ps")) std::cerr << "Error running dot: 'dot' not in path?\n"; system("gv /tmp/tempgraph.ps"); From lattner at cs.uiuc.edu Tue Feb 11 17:12:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Feb 11 17:12:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp Local.cpp Steensgaard.cpp TopDownClosure.cpp Message-ID: <200302112311.RAA09688@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.92 -> 1.93 Local.cpp updated: 1.49 -> 1.50 Steensgaard.cpp updated: 1.25 -> 1.26 TopDownClosure.cpp updated: 1.39 -> 1.40 --- Log message: Implement a "union-findy" version of DS-Analysis, which eliminates the Referrers list on DSNodes. --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.92 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.93 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.92 Mon Feb 10 12:47:23 2003 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Tue Feb 11 17:11:43 2003 @@ -28,25 +28,41 @@ // DSNode Implementation //===----------------------------------------------------------------------===// -DSNode::DSNode(enum NodeTy NT, const Type *T) - : Ty(Type::VoidTy), Size(0), NodeType(NT) { +DSNode::DSNode(unsigned NT, const Type *T, DSGraph *G) + : NumReferrers(0), Size(0), ParentGraph(G), Ty(Type::VoidTy), NodeType(NT) { // Add the type entry if it is specified... if (T) mergeTypeInfo(T, 0); + G->getNodes().push_back(this); } // DSNode copy constructor... do not copy over the referrers list! -DSNode::DSNode(const DSNode &N) - : Links(N.Links), Globals(N.Globals), Ty(N.Ty), Size(N.Size), - NodeType(N.NodeType) { +DSNode::DSNode(const DSNode &N, DSGraph *G) + : NumReferrers(0), Size(N.Size), ParentGraph(G), Ty(N.Ty), + Links(N.Links), Globals(N.Globals), NodeType(N.NodeType) { + G->getNodes().push_back(this); } -void DSNode::removeReferrer(DSNodeHandle *H) { - // Search backwards, because we depopulate the list from the back for - // efficiency (because it's a vector). - std::vector::reverse_iterator I = - std::find(Referrers.rbegin(), Referrers.rend(), H); - assert(I != Referrers.rend() && "Referrer not pointing to node!"); - Referrers.erase(I.base()-1); +void DSNode::assertOK() const { + assert((Ty != Type::VoidTy || + Ty == Type::VoidTy && (Size == 0 || + (NodeType & DSNode::Array))) && + "Node not OK!"); +} + +/// forwardNode - Mark this node as being obsolete, and all references to it +/// should be forwarded to the specified node and offset. +/// +void DSNode::forwardNode(DSNode *To, unsigned Offset) { + assert(this != To && "Cannot forward a node to itself!"); + assert(ForwardNH.isNull() && "Already forwarding from this node!"); + if (To->Size <= 1) Offset = 0; + assert((Offset < To->Size || (Offset == To->Size && Offset == 0)) && + "Forwarded offset is wrong!"); + ForwardNH.setNode(To); + ForwardNH.setOffset(Offset); + NodeType = DEAD; + Size = 0; + Ty = Type::VoidTy; } // addGlobal - Add an entry for a global value to the Globals list. This also @@ -70,25 +86,32 @@ /// single byte with a single TypeEntry of "void". /// void DSNode::foldNodeCompletely() { - if (isNodeCompletelyFolded()) return; + assert(!hasNoReferrers() && + "Why would we collapse a node with no referrers?"); + if (isNodeCompletelyFolded()) return; // If this node is already folded... ++NumFolds; - // We are no longer typed at all... - Ty = Type::VoidTy; - NodeType |= Array; - Size = 1; + // Create the node we are going to forward to... + DSNode *DestNode = new DSNode(NodeType|DSNode::Array, 0, ParentGraph); + DestNode->Ty = Type::VoidTy; + DestNode->Size = 1; + DestNode->Globals.swap(Globals); - // Loop over all of our referrers, making them point to our zero bytes of - // space. - for (std::vector::iterator I = Referrers.begin(), - E = Referrers.end(); I != E; ++I) - (*I)->setOffset(0); - - // If we have links, merge all of our outgoing links together... - for (unsigned i = 1; i < Links.size(); ++i) - Links[0].mergeWith(Links[i]); - Links.resize(1); + // Start forwarding to the destination node... + forwardNode(DestNode, 0); + + if (Links.size()) { + DestNode->Links.push_back(Links[0]); + DSNodeHandle NH(DestNode); + + // If we have links, merge all of our outgoing links together... + for (unsigned i = Links.size()-1; i != 0; --i) + NH.getNode()->Links[0].mergeWith(Links[i]); + Links.clear(); + } else { + DestNode->Links.resize(1); + } } /// isNodeCompletelyFolded - Return true if this node has been completely @@ -401,9 +424,8 @@ unsigned NSize = NH.getNode()->getSize(); // Merge the type entries of the two nodes together... - if (NH.getNode()->Ty != Type::VoidTy) { + if (NH.getNode()->Ty != Type::VoidTy) CurNodeH.getNode()->mergeTypeInfo(NH.getNode()->Ty, NOffset); - } assert((CurNodeH.getNode()->NodeType & DSNode::DEAD) == 0); // If we are merging a node with a completely folded node, then both nodes are @@ -412,42 +434,34 @@ if (CurNodeH.getNode()->isNodeCompletelyFolded()) { if (!NH.getNode()->isNodeCompletelyFolded()) { NH.getNode()->foldNodeCompletely(); - assert(NH.getOffset()==0 && "folding did not make offset 0?"); + assert(NH.getNode() && NH.getOffset() == 0 && + "folding did not make offset 0?"); NOffset = NH.getOffset(); NSize = NH.getNode()->getSize(); assert(NOffset == 0 && NSize == 1); } } else if (NH.getNode()->isNodeCompletelyFolded()) { CurNodeH.getNode()->foldNodeCompletely(); - assert(CurNodeH.getOffset()==0 && "folding did not make offset 0?"); + assert(CurNodeH.getNode() && CurNodeH.getOffset() == 0 && + "folding did not make offset 0?"); NOffset = NH.getOffset(); NSize = NH.getNode()->getSize(); assert(NOffset == 0 && NSize == 1); } - if (CurNodeH.getNode() == NH.getNode() || NH.getNode() == 0) return; + DSNode *N = NH.getNode(); + if (CurNodeH.getNode() == N || N == 0) return; assert((CurNodeH.getNode()->NodeType & DSNode::DEAD) == 0); - // Remove all edges pointing at N, causing them to point to 'this' instead. - // Make sure to adjust their offset, not just the node pointer. - // Also, be careful to use the DSNode* rather than NH since NH is one of - // the referrers and once NH refers to CurNodeH.getNode() this will - // become an infinite loop. - DSNode* N = NH.getNode(); - unsigned OldNHOffset = NH.getOffset(); - while (!N->Referrers.empty()) { - DSNodeHandle &Ref = *N->Referrers.back(); - Ref = DSNodeHandle(CurNodeH.getNode(), NOffset+Ref.getOffset()); - } - NH = DSNodeHandle(N, OldNHOffset); // reset NH to point back to where it was - + // Start forwarding to the new node! + CurNodeH.getNode()->NodeType |= N->NodeType; + N->forwardNode(CurNodeH.getNode(), NOffset); assert((CurNodeH.getNode()->NodeType & DSNode::DEAD) == 0); - // Make all of the outgoing links of *NH now be outgoing links of - // this. This can cause recursive merging! - // - for (unsigned i = 0; i < NH.getNode()->getSize(); i += DS::PointerSize) { - DSNodeHandle &Link = NH.getNode()->getLink(i); + // Make all of the outgoing links of N now be outgoing links of CurNodeH. + // + for (unsigned i = 0; i < N->getNumLinks(); ++i) { + DSNodeHandle &Link = N->getLink(i << DS::PointerShift); if (Link.getNode()) { // Compute the offset into the current node at which to // merge this link. In the common case, this is a linear @@ -456,27 +470,22 @@ // recursive merging, we must make sure to merge in all remaining // links at offset zero. unsigned MergeOffset = 0; - if (CurNodeH.getNode()->Size != 1) - MergeOffset = (i+NOffset) % CurNodeH.getNode()->getSize(); - CurNodeH.getNode()->addEdgeTo(MergeOffset, Link); + DSNode *CN = CurNodeH.getNode(); + if (CN->Size != 1) + MergeOffset = ((i << DS::PointerShift)+NOffset) % CN->getSize(); + CN->addEdgeTo(MergeOffset, Link); } } // Now that there are no outgoing edges, all of the Links are dead. - NH.getNode()->Links.clear(); - NH.getNode()->Size = 0; - NH.getNode()->Ty = Type::VoidTy; - - // Merge the node types - CurNodeH.getNode()->NodeType |= NH.getNode()->NodeType; - NH.getNode()->NodeType = DEAD; // NH is now a dead node. + N->Links.clear(); // Merge the globals list... - if (!NH.getNode()->Globals.empty()) { - MergeSortedVectors(CurNodeH.getNode()->Globals, NH.getNode()->Globals); + if (!N->Globals.empty()) { + MergeSortedVectors(CurNodeH.getNode()->Globals, N->Globals); // Delete the globals from the old node... - NH.getNode()->Globals.clear(); + std::vector().swap(N->Globals); } } @@ -606,9 +615,8 @@ clearBits |= DSNode::DEAD; // Clear dead flag... for (unsigned i = 0, e = G.Nodes.size(); i != e; ++i) { DSNode *Old = G.Nodes[i]; - DSNode *New = new DSNode(*Old); + DSNode *New = new DSNode(*Old, this); New->NodeType &= ~clearBits; - Nodes.push_back(New); OldNodeMap[Old] = New; } @@ -625,8 +633,8 @@ E = G.ScalarMap.end(); I != E; ++I) { DSNodeHandle &H = OldValMap[I->first]; DSNodeHandle &MappedNode = OldNodeMap[I->second.getNode()]; - H.setNode(MappedNode.getNode()); H.setOffset(I->second.getOffset()+MappedNode.getOffset()); + H.setNode(MappedNode.getNode()); if (isa(I->first)) { // Is this a global? hash_map::iterator GVI = ScalarMap.find(I->first); @@ -705,6 +713,7 @@ if (AI == F.aend()) break; // Add the link from the argument scalar to the provided value + assert(ScalarMap->count(AI) && "Argument not in scalar map?"); DSNodeHandle &NH = (*ScalarMap)[AI]; assert(NH.getNode() && "Pointer argument without scalarmap entry?"); NH.mergeWith(CS.getPtrArg(i)); @@ -775,7 +784,7 @@ static inline void killIfUselessEdge(DSNodeHandle &Edge) { if (DSNode *N = Edge.getNode()) // Is there an edge? - if (N->getReferrers().size() == 1) // Does it point to a lonely node? + if (N->getNumReferrers() == 1) // Does it point to a lonely node? if ((N->NodeType & ~DSNode::Incomplete) == 0 && // No interesting info? N->getType() == Type::VoidTy && !N->isNodeCompletelyFolded()) Edge.setNode(0); // Kill the edge! @@ -805,7 +814,7 @@ // If the Callee is a useless edge, this must be an unreachable call site, // eliminate it. - if (CS.isIndirectCall() && CS.getCalleeNode()->getReferrers().size() == 1 && + if (CS.isIndirectCall() && CS.getCalleeNode()->getNumReferrers() == 1 && CS.getCalleeNode()->NodeType == 0) { // No useful info? std::cerr << "WARNING: Useless call site found??\n"; CS.swap(Calls.back()); @@ -893,13 +902,26 @@ // have all of these properties and still have incoming edges, due to the // scalar map, so we check those now. // - if (Node->getReferrers().size() == Node->getGlobals().size()) { + if (Node->getNumReferrers() == Node->getGlobals().size()) { std::vector &Globals = Node->getGlobals(); - for (unsigned j = 0, e = Globals.size(); j != e; ++j) - ScalarMap.erase(Globals[j]); - Globals.clear(); + + // Loop through and make sure all of the globals are referring directly + // to the node... + for (unsigned j = 0, e = Globals.size(); j != e; ++j) { + DSNode *N = ScalarMap.find(Globals[j])->second.getNode(); + assert(N == Node && "ScalarMap doesn't match globals list!"); + } + + // Make sure numreferrers still agrees, if so, the node is truely dead. + if (Node->getNumReferrers() == Globals.size()) { + for (unsigned j = 0, e = Globals.size(); j != e; ++j) + ScalarMap.erase(Globals[j]); + + Globals.clear(); + assert(Node->hasNoReferrers() && "Shouldn't have refs now!"); - Node->NodeType = DSNode::DEAD; + Node->NodeType = DSNode::DEAD; + } } } @@ -919,6 +941,7 @@ /// void DSNode::markReachableNodes(hash_set &ReachableNodes) { if (this == 0) return; + assert(getForwardNode() == 0 && "Cannot mark a forwarded node!"); if (ReachableNodes.count(this)) return; // Already marked reachable ReachableNodes.insert(this); // Is reachable now @@ -942,6 +965,7 @@ static bool CanReachAliveNodes(DSNode *N, hash_set &Alive, hash_set &Visited) { if (N == 0) return false; + assert(N->getForwardNode() == 0 && "Cannot mark a forwarded node!"); // If we know that this node is alive, return so! if (Alive.count(N)) return true; @@ -1015,7 +1039,7 @@ do { Visited.clear(); // If any global nodes points to a non-global that is "alive", the global is - // "alive" as well... Remov it from the GlobalNodes list so we only have + // "alive" as well... Remove it from the GlobalNodes list so we only have // unreachable globals in the list. // Iterate = false; @@ -1055,22 +1079,28 @@ // should be moved to the globals graph. Loop over all nodes, eliminating // completely unreachable nodes, and moving visited nodes to the globals graph // + std::vector DeadNodes; + DeadNodes.reserve(Nodes.size()); for (unsigned i = 0; i != Nodes.size(); ++i) if (!Alive.count(Nodes[i])) { DSNode *N = Nodes[i]; - std::swap(Nodes[i--], Nodes.back()); // move node to end of vector - Nodes.pop_back(); // Erase node from alive list. + Nodes[i--] = Nodes.back(); // move node to end of vector + Nodes.pop_back(); // Erase node from alive list. if (!(Flags & DSGraph::RemoveUnreachableGlobals) && // Not in TD pass Visited.count(N)) { // Visited but not alive? GlobalsGraph->Nodes.push_back(N); // Move node to globals graph + N->setParentGraph(GlobalsGraph); } else { // Otherwise, delete the node assert(((N->NodeType & DSNode::GlobalNode) == 0 || (Flags & DSGraph::RemoveUnreachableGlobals)) && "Killing a global?"); - while (!N->hasNoReferrers()) // Rewrite referrers - N->getReferrers().back()->setNode(0); - delete N; // Usecount is zero + //std::cerr << "[" << i+1 << "/" << DeadNodes.size() + // << "] Node is dead: "; N->dump(); + DeadNodes.push_back(N); + N->dropAllReferences(); } + } else { + assert(Nodes[i]->getForwardNode() == 0 && "Alive forwarded node?"); } // Now that the nodes have either been deleted or moved to the globals graph, @@ -1096,7 +1126,8 @@ // Merging leaves behind silly nodes, we remove them to avoid polluting the // globals graph. - GlobalsGraph->removeTriviallyDeadNodes(); + if (!GlobalNodes.empty()) + GlobalsGraph->removeTriviallyDeadNodes(); } else { // If we are in the top-down pass, remove all unreachable globals from the // ScalarMap... @@ -1104,10 +1135,18 @@ ScalarMap.erase(GlobalNodes[i].first); } + // Loop over all of the dead nodes now, deleting them since their referrer + // count is zero. + for (unsigned i = 0, e = DeadNodes.size(); i != e; ++i) + delete DeadNodes[i]; + DEBUG(AssertGraphOK(); GlobalsGraph->AssertGraphOK()); } void DSGraph::AssertGraphOK() const { + for (unsigned i = 0, e = Nodes.size(); i != e; ++i) + Nodes[i]->assertOK(); + return; // FIXME: remove for (hash_map::const_iterator I = ScalarMap.begin(), E = ScalarMap.end(); I != E; ++I) { assert(I->second.getNode() && "Null node in scalarmap!"); @@ -1121,149 +1160,3 @@ AssertCallNodesInGraph(); AssertAuxCallNodesInGraph(); } - - -#if 0 -//===----------------------------------------------------------------------===// -// GlobalDSGraph Implementation -//===----------------------------------------------------------------------===// - -#if 0 -// Bits used in the next function -static const char ExternalTypeBits = DSNode::GlobalNode | DSNode::HeapNode; - -// cloneGlobalInto - Clone the given global node and all its target links -// (and all their llinks, recursively). -// -DSNode *DSGraph::cloneGlobalInto(const DSNode *GNode) { - if (GNode == 0 || GNode->getGlobals().size() == 0) return 0; - - // If a clone has already been created for GNode, return it. - DSNodeHandle& ValMapEntry = ScalarMap[GNode->getGlobals()[0]]; - if (ValMapEntry != 0) - return ValMapEntry; - - // Clone the node and update the ValMap. - DSNode* NewNode = new DSNode(*GNode); - ValMapEntry = NewNode; // j=0 case of loop below! - Nodes.push_back(NewNode); - for (unsigned j = 1, N = NewNode->getGlobals().size(); j < N; ++j) - ScalarMap[NewNode->getGlobals()[j]] = NewNode; - - // Rewrite the links in the new node to point into the current graph. - for (unsigned j = 0, e = GNode->getNumLinks(); j != e; ++j) - NewNode->setLink(j, cloneGlobalInto(GNode->getLink(j))); - - return NewNode; -} - -// GlobalDSGraph::cloneNodeInto - Clone a global node and all its externally -// visible target links (and recursively their such links) into this graph. -// NodeCache maps the node being cloned to its clone in the Globals graph, -// in order to track cycles. -// GlobalsAreFinal is a flag that says whether it is safe to assume that -// an existing global node is complete. This is important to avoid -// reinserting all globals when inserting Calls to functions. -// This is a helper function for cloneGlobals and cloneCalls. -// -DSNode* GlobalDSGraph::cloneNodeInto(DSNode *OldNode, - hash_map &NodeCache, - bool GlobalsAreFinal) { - if (OldNode == 0) return 0; - - // The caller should check this is an external node. Just more efficient... - assert((OldNode->NodeType & ExternalTypeBits) && "Non-external node"); - - // If a clone has already been created for OldNode, return it. - DSNode*& CacheEntry = NodeCache[OldNode]; - if (CacheEntry != 0) - return CacheEntry; - - // The result value... - DSNode* NewNode = 0; - - // If nodes already exist for any of the globals of OldNode, - // merge all such nodes together since they are merged in OldNode. - // If ValueCacheIsFinal==true, look for an existing node that has - // an identical list of globals and return it if it exists. - // - for (unsigned j = 0, N = OldNode->getGlobals().size(); j != N; ++j) - if (DSNode *PrevNode = ScalarMap[OldNode->getGlobals()[j]].getNode()) { - if (NewNode == 0) { - NewNode = PrevNode; // first existing node found - if (GlobalsAreFinal && j == 0) - if (OldNode->getGlobals() == PrevNode->getGlobals()) { - CacheEntry = NewNode; - return NewNode; - } - } - else if (NewNode != PrevNode) { // found another, different from prev - // update ValMap *before* merging PrevNode into NewNode - for (unsigned k = 0, NK = PrevNode->getGlobals().size(); k < NK; ++k) - ScalarMap[PrevNode->getGlobals()[k]] = NewNode; - NewNode->mergeWith(PrevNode); - } - } else if (NewNode != 0) { - ScalarMap[OldNode->getGlobals()[j]] = NewNode; // add the merged node - } - - // If no existing node was found, clone the node and update the ValMap. - if (NewNode == 0) { - NewNode = new DSNode(*OldNode); - Nodes.push_back(NewNode); - for (unsigned j = 0, e = NewNode->getNumLinks(); j != e; ++j) - NewNode->setLink(j, 0); - for (unsigned j = 0, N = NewNode->getGlobals().size(); j < N; ++j) - ScalarMap[NewNode->getGlobals()[j]] = NewNode; - } - else - NewNode->NodeType |= OldNode->NodeType; // Markers may be different! - - // Add the entry to NodeCache - CacheEntry = NewNode; - - // Rewrite the links in the new node to point into the current graph, - // but only for links to external nodes. Set other links to NULL. - for (unsigned j = 0, e = OldNode->getNumLinks(); j != e; ++j) { - DSNode* OldTarget = OldNode->getLink(j); - if (OldTarget && (OldTarget->NodeType & ExternalTypeBits)) { - DSNode* NewLink = this->cloneNodeInto(OldTarget, NodeCache); - if (NewNode->getLink(j)) - NewNode->getLink(j)->mergeWith(NewLink); - else - NewNode->setLink(j, NewLink); - } - } - - // Remove all local markers - NewNode->NodeType &= ~(DSNode::AllocaNode | DSNode::ScalarNode); - - return NewNode; -} - - -// GlobalDSGraph::cloneCalls - Clone function calls and their visible target -// links (and recursively their such links) into this graph. -// -void GlobalDSGraph::cloneCalls(DSGraph& Graph) { - hash_map NodeCache; - std::vector& FromCalls =Graph.FunctionCalls; - - FunctionCalls.reserve(FunctionCalls.size() + FromCalls.size()); - - for (int i = 0, ei = FromCalls.size(); i < ei; ++i) { - DSCallSite& callCopy = FunctionCalls.back(); - callCopy.reserve(FromCalls[i].size()); - for (unsigned j = 0, ej = FromCalls[i].size(); j != ej; ++j) - callCopy.push_back - ((FromCalls[i][j] && (FromCalls[i][j]->NodeType & ExternalTypeBits)) - ? cloneNodeInto(FromCalls[i][j], NodeCache, true) - : 0); - } - - // remove trivially identical function calls - removeIdenticalCalls(FunctionCalls, "Globals Graph"); -} -#endif - -#endif Index: llvm/lib/Analysis/DataStructure/Local.cpp diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.49 llvm/lib/Analysis/DataStructure/Local.cpp:1.50 --- llvm/lib/Analysis/DataStructure/Local.cpp:1.49 Sun Feb 9 17:04:12 2003 +++ llvm/lib/Analysis/DataStructure/Local.cpp Tue Feb 11 17:11:44 2003 @@ -109,8 +109,7 @@ /// the graph. /// DSNode *createNode(DSNode::NodeTy NodeType, const Type *Ty = 0) { - DSNode *N = new DSNode(NodeType, Ty); // Create the node - Nodes.push_back(N); // Add node to nodes list + DSNode *N = new DSNode(NodeType, Ty, &G); // Create the node if (DisableFieldSensitivity) N->foldNodeCompletely(); return N; Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.25 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.26 --- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.25 Mon Feb 10 12:16:19 2003 +++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Tue Feb 11 17:11:44 2003 @@ -193,6 +193,8 @@ ++i; // Skip this call site... } + RetValMap.clear(); + // Update the "incomplete" markers on the nodes, ignoring unknownness due to // incoming arguments... ResultGraph->maskIncompleteMarkers(); Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.39 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.40 --- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.39 Mon Feb 10 12:16:36 2003 +++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp Tue Feb 11 17:11:44 2003 @@ -183,16 +183,10 @@ for (unsigned i = 0, e = NewCS.getNumPtrArgs(); i != e && AI != Callee->aend(); ++i, ++AI) { // Advance the argument iterator to the first pointer argument... - while (!DS::isPointerType(AI->getType())) { + while (AI != Callee->aend() && !DS::isPointerType(AI->getType())) ++AI; -#ifndef NDEBUG - if (AI == Callee->aend()) - std::cerr << "Bad call to Func: " << Callee->getName() << "\n"; -#endif - assert(AI != Callee->aend() && - "# Args provided is not # Args required!"); - } - + if (AI == Callee->aend()) break; + // Add the link from the argument scalar to the provided value DSNodeHandle &NH = CG.getNodeForValue(AI); assert(NH.getNode() && "Pointer argument without scalarmap entry?"); From lattner at cs.uiuc.edu Tue Feb 11 17:13:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Feb 11 17:13:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Message-ID: <200302112312.RAA09712@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysisEvaluator.cpp updated: 1.4 -> 1.5 --- Log message: Rename options --- Diffs of the changes: Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.4 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.5 --- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.4 Sun Feb 9 14:40:13 2003 +++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Tue Feb 11 17:12:09 2003 @@ -19,9 +19,9 @@ #include "Support/CommandLine.h" namespace { - cl::opt PrintNo ("print-no-alias-results", cl::ReallyHidden); - cl::opt PrintMay ("print-may-alias-results", cl::ReallyHidden); - cl::opt PrintMust("print-must-alias-results", cl::ReallyHidden); + cl::opt PrintNo ("print-no-aliases", cl::ReallyHidden); + cl::opt PrintMay ("print-may-aliases", cl::ReallyHidden); + cl::opt PrintMust("print-must-aliases", cl::ReallyHidden); class AAEval : public FunctionPass { unsigned No, May, Must; From lattner at cs.uiuc.edu Tue Feb 11 17:13:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Feb 11 17:13:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DSGraphTraits.h DSNode.h DSSupport.h Message-ID: <200302112312.RAA09701@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DSGraphTraits.h updated: 1.12 -> 1.13 DSNode.h updated: 1.20 -> 1.21 DSSupport.h updated: 1.13 -> 1.14 --- Log message: Implement a "union-findy" version of DS-Analysis, which eliminates the Referrers list on DSNodes. --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DSGraphTraits.h diff -u llvm/include/llvm/Analysis/DSGraphTraits.h:1.12 llvm/include/llvm/Analysis/DSGraphTraits.h:1.13 --- llvm/include/llvm/Analysis/DSGraphTraits.h:1.12 Mon Feb 10 16:46:47 2003 +++ llvm/include/llvm/Analysis/DSGraphTraits.h Tue Feb 11 17:11:51 2003 @@ -23,9 +23,11 @@ typedef DSNodeIterator _Self; DSNodeIterator(NodeTy *N) : Node(N), Offset(0) {} // begin iterator - DSNodeIterator(NodeTy *N, bool) // Create end iterator - : Node(N) { + DSNodeIterator(NodeTy *N, bool) : Node(N) { // Create end iterator Offset = N->getNumLinks() << DS::PointerShift; + if (Offset == 0 && Node->getForwardNode() && + (Node->NodeType & DSNode::DEAD)) // Model Forward link + Offset += DS::PointerSize; } public: DSNodeIterator(const DSNodeHandle &NH) @@ -43,7 +45,10 @@ } pointer operator*() const { - return Node->getLink(Offset).getNode(); + if (Node->NodeType & DSNode::DEAD) + return Node->getForwardNode(); + else + return Node->getLink(Offset).getNode(); } pointer operator->() const { return operator*(); } Index: llvm/include/llvm/Analysis/DSNode.h diff -u llvm/include/llvm/Analysis/DSNode.h:1.20 llvm/include/llvm/Analysis/DSNode.h:1.21 --- llvm/include/llvm/Analysis/DSNode.h:1.20 Mon Feb 10 12:19:41 2003 +++ llvm/include/llvm/Analysis/DSNode.h Tue Feb 11 17:11:51 2003 @@ -19,22 +19,26 @@ /// different types represented in this object. /// class DSNode { - /// Referrers - Keep track of all of the node handles that point to this - /// DSNode. These pointers may need to be updated to point to a different - /// node if this node gets merged with it. - /// - std::vector Referrers; + /// NumReferrers - The number of DSNodeHandles pointing to this node... if + /// this is a forwarding node, then this is the number of node handles which + /// are still forwarding over us. + /// + unsigned NumReferrers; + + /// ForwardNH - This NodeHandle contain the node (and offset into the node) + /// that this node really is. When nodes get folded together, the node to be + /// eliminated has these fields filled in, otherwise ForwardNH.getNode() is + /// null. + DSNodeHandle ForwardNH; - /// Links - Contains one entry for every sizeof(void*) bytes in this memory - /// object. Note that if the node is not a multiple of size(void*) bytes - /// large, that there is an extra entry for the "remainder" of the node as - /// well. For this reason, nodes of 1 byte in size do have one link. + /// Size - The current size of the node. This should be equal to the size of + /// the current type record. /// - std::vector Links; + unsigned Size; - /// Globals - The list of global values that are merged into this node. + /// ParentGraph - The graph this node is currently embedded into. /// - std::vector Globals; + DSGraph *ParentGraph; /// Ty - Keep track of the current outer most type of this object, in addition /// to whether or not it has been indexed like an array or not. If the @@ -42,12 +46,19 @@ /// const Type *Ty; // The type itself... - /// Size - The current size of the node. This should be equal to the size of - /// the current type record. + /// Links - Contains one entry for every sizeof(void*) bytes in this memory + /// object. Note that if the node is not a multiple of size(void*) bytes + /// large, that there is an extra entry for the "remainder" of the node as + /// well. For this reason, nodes of 1 byte in size do have one link. /// - unsigned Size; + std::vector Links; + + /// Globals - The list of global values that are merged into this node. + /// + std::vector Globals; void operator=(const DSNode &); // DO NOT IMPLEMENT + DSNode(const DSNode &); // DO NOT IMPLEMENT public: enum NodeTy { ShadowNode = 0, // Nothing is known about this node... @@ -73,8 +84,8 @@ /// unsigned short NodeType; - DSNode(enum NodeTy NT, const Type *T); - DSNode(const DSNode &); + DSNode(unsigned NodeTy, const Type *T, DSGraph *G); + DSNode(const DSNode &, DSGraph *G); ~DSNode() { dropAllReferences(); @@ -100,13 +111,14 @@ const Type *getType() const { return Ty; } bool isArray() const { return NodeType & Array; } - /// getReferrers - Return a list of the pointers to this node... - /// - const std::vector &getReferrers() const { return Referrers; } - /// hasNoReferrers - Return true if nothing is pointing to this node at all. /// - bool hasNoReferrers() const { return Referrers.empty(); } + bool hasNoReferrers() const { return getNumReferrers() == 0; } + + /// getNumReferrers - This method returns the number of referrers to the + /// current node. Note that if this node is a forwarding node, this will + /// return the number of nodes forwarding over the node! + unsigned getNumReferrers() const { return NumReferrers; } /// isModified - Return true if this node may be modified in this context /// @@ -116,6 +128,18 @@ /// bool isRead() const { return (NodeType & Read) != 0; } + DSGraph *getParentGraph() const { return ParentGraph; } + void setParentGraph(DSGraph *G) { ParentGraph = G; } + + + /// getForwardNode - This method returns the node that this node is forwarded + /// to, if any. + DSNode *getForwardNode() const { return ForwardNH.getNode(); } + void stopForwarding() { + assert(!ForwardNH.isNull() && + "Node isn't forwarding, cannot stopForwarding!"); + ForwardNH.setNode(0); + } /// hasLink - Return true if this memory object has a link in slot #LinkNo /// @@ -209,11 +233,20 @@ const std::vector &getGlobals() const { return Globals; } std::vector &getGlobals() { return Globals; } + /// forwardNode - Mark this node as being obsolete, and all references to it + /// should be forwarded to the specified node and offset. + /// + void forwardNode(DSNode *To, unsigned Offset); + void print(std::ostream &O, const DSGraph *G) const; void dump() const; + void assertOK() const; + void dropAllReferences() { Links.clear(); + if (!ForwardNH.isNull()) + ForwardNH.setNode(0); } /// remapLinks - Change all of the Links in the current node according to the @@ -229,10 +262,6 @@ private: friend class DSNodeHandle; - // addReferrer - Keep the referrer set up to date... - void addReferrer(DSNodeHandle *H) { Referrers.push_back(H); } - void removeReferrer(DSNodeHandle *H); - // static mergeNodes - Helper for mergeWith() static void MergeNodes(DSNodeHandle& CurNodeH, DSNodeHandle& NH); }; @@ -242,19 +271,50 @@ // Define inline DSNodeHandle functions that depend on the definition of DSNode // inline DSNode *DSNodeHandle::getNode() const { + assert((!N || Offset < N->Size || (N->Size == 0 && Offset == 0) || + !N->ForwardNH.isNull()) && "Node handle offset out of range!"); + if (!N || N->ForwardNH.isNull()) + return N; + + // Handle node forwarding here! + DSNode *Next = N->ForwardNH.getNode(); // Cause recursive shrinkage + Offset += N->ForwardNH.getOffset(); + + if (--N->NumReferrers == 0) { + // Removing the last referrer to the node, sever the forwarding link + N->stopForwarding(); + } + + N = Next; + N->NumReferrers++; + if (N->Size <= Offset) { + assert(N->Size <= 1 && "Forwarded to shrunk but not collapsed node?"); + Offset = 0; + } return N; } inline void DSNodeHandle::setNode(DSNode *n) { - if (N) N->removeReferrer(this); + assert(!n || !n->getForwardNode() && "Cannot set node to a forwarded node!"); + if (N) N->NumReferrers--; N = n; - if (N) N->addReferrer(this); + if (N) { + N->NumReferrers++; + if (Offset >= N->Size) { + assert((Offset == 0 || N->Size == 1) && + "Pointer to non-collapsed node with invalid offset!"); + Offset = 0; + } + } assert(!N || ((N->NodeType & DSNode::DEAD) == 0)); + + assert((!N || Offset < N->Size || (N->Size == 0 && Offset == 0) || + !N->ForwardNH.isNull()) && "Node handle offset out of range!"); } inline bool DSNodeHandle::hasLink(unsigned Num) const { assert(N && "DSNodeHandle does not point to a node yet!"); - return N->hasLink(Num+Offset); + return getNode()->hasLink(Num+Offset); } @@ -263,16 +323,16 @@ /// inline const DSNodeHandle &DSNodeHandle::getLink(unsigned Off) const { assert(N && "DSNodeHandle does not point to a node yet!"); - return N->getLink(Offset+Off); + return getNode()->getLink(Offset+Off); } inline DSNodeHandle &DSNodeHandle::getLink(unsigned Off) { assert(N && "DSNodeHandle does not point to a node yet!"); - return N->getLink(Off+Offset); + return getNode()->getLink(Off+Offset); } inline void DSNodeHandle::setLink(unsigned Off, const DSNodeHandle &NH) { assert(N && "DSNodeHandle does not point to a node yet!"); - N->setLink(Off+Offset, NH); + getNode()->setLink(Off+Offset, NH); } /// addEdgeTo - Add an edge from the current node to the specified node. This @@ -280,7 +340,7 @@ /// inline void DSNodeHandle::addEdgeTo(unsigned Off, const DSNodeHandle &Node) { assert(N && "DSNodeHandle does not point to a node yet!"); - N->addEdgeTo(Off+Offset, Node); + getNode()->addEdgeTo(Off+Offset, Node); } /// mergeWith - Merge the logical node pointed to by 'this' with the node @@ -288,24 +348,9 @@ /// inline void DSNodeHandle::mergeWith(const DSNodeHandle &Node) { if (N != 0) - N->mergeWith(Node, Offset); + getNode()->mergeWith(Node, Offset); else // No node to merge with, so just point to Node *this = Node; -} - -inline void DSNodeHandle::swap(DSNodeHandle &NH) { - std::swap(Offset, NH.Offset); - if (N != NH.N) { - if (N) { - N->removeReferrer(this); - N->addReferrer(&NH); - } - if (NH.N) { - N->removeReferrer(&NH); - N->addReferrer(this); - } - std::swap(N, NH.N); - } } #endif Index: llvm/include/llvm/Analysis/DSSupport.h diff -u llvm/include/llvm/Analysis/DSSupport.h:1.13 llvm/include/llvm/Analysis/DSSupport.h:1.14 --- llvm/include/llvm/Analysis/DSSupport.h:1.13 Mon Feb 10 12:19:41 2003 +++ llvm/include/llvm/Analysis/DSSupport.h Tue Feb 11 17:11:51 2003 @@ -45,38 +45,54 @@ /// DSNodeHandle (and friends) in one file complicates things. /// class DSNodeHandle { - DSNode *N; - unsigned Offset; + mutable DSNode *N; + mutable unsigned Offset; void operator==(const DSNode *N); // DISALLOW, use to promote N to nodehandle public: // Allow construction, destruction, and assignment... DSNodeHandle(DSNode *n = 0, unsigned offs = 0) : N(0), Offset(offs) { setNode(n); } - DSNodeHandle(const DSNodeHandle &H) : N(0), Offset(H.Offset) { setNode(H.N); } + DSNodeHandle(const DSNodeHandle &H) : N(0), Offset(0) { + setNode(H.getNode()); + Offset = H.Offset; // Must read offset AFTER the getNode() + } ~DSNodeHandle() { setNode((DSNode*)0); } DSNodeHandle &operator=(const DSNodeHandle &H) { - setNode(H.N); Offset = H.Offset; + Offset = 0; setNode(H.getNode()); Offset = H.Offset; return *this; } bool operator<(const DSNodeHandle &H) const { // Allow sorting - return N < H.N || (N == H.N && Offset < H.Offset); + return getNode() < H.getNode() || (N == H.N && Offset < H.Offset); } bool operator>(const DSNodeHandle &H) const { return H < *this; } bool operator==(const DSNodeHandle &H) const { // Allow comparison - return N == H.N && Offset == H.Offset; + return getNode() == H.getNode() && Offset == H.Offset; } bool operator!=(const DSNodeHandle &H) const { return !operator==(H); } - inline void swap(DSNodeHandle &H); + inline void swap(DSNodeHandle &NH) { + std::swap(Offset, NH.Offset); + std::swap(N, NH.N); + } + + /// isNull - Check to see if getNode() == 0, without going through the trouble + /// of checking to see if we are forwarding... + bool isNull() const { return N == 0; } // Allow explicit conversion to DSNode... inline DSNode *getNode() const; // Defined inline in DSNode.h unsigned getOffset() const { return Offset; } inline void setNode(DSNode *N); // Defined inline in DSNode.h - void setOffset(unsigned O) { Offset = O; } + void setOffset(unsigned O) { + //assert((!N || Offset < N->Size || (N->Size == 0 && Offset == 0) || + // !N->ForwardNH.isNull()) && "Node handle offset out of range!"); + //assert((!N || O < N->Size || (N->Size == 0 && O == 0) || + // !N->ForwardNH.isNull()) && "Node handle offset out of range!"); + Offset = O; + } void addEdgeTo(unsigned LinkNo, const DSNodeHandle &N); void addEdgeTo(const DSNodeHandle &N) { addEdgeTo(0, N); } @@ -98,7 +114,9 @@ inline void setLink(unsigned Num, const DSNodeHandle &NH); }; -inline void swap(DSNodeHandle &NH1, DSNodeHandle &NH2) { NH1.swap(NH2); } +namespace std { + inline void swap(DSNodeHandle &NH1, DSNodeHandle &NH2) { NH1.swap(NH2); } +} //===----------------------------------------------------------------------===// /// DSCallSite - Representation of a call site via its call instruction, @@ -252,6 +270,7 @@ } }; -inline void swap(DSCallSite &CS1, DSCallSite &CS2) { CS1.swap(CS2); } - +namespace std { + inline void swap(DSCallSite &CS1, DSCallSite &CS2) { CS1.swap(CS2); } +} #endif From lattner at cs.uiuc.edu Tue Feb 11 17:13:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Feb 11 17:13:03 2003 Subject: [llvm-commits] CVS: llvm/test/Libraries/libdummy/dummylib.c Message-ID: <200302112312.RAA09731@apoc.cs.uiuc.edu> Changes in directory llvm/test/Libraries/libdummy: dummylib.c updated: 1.3 -> 1.4 --- Log message: Implement more functions --- Diffs of the changes: Index: llvm/test/Libraries/libdummy/dummylib.c diff -u llvm/test/Libraries/libdummy/dummylib.c:1.3 llvm/test/Libraries/libdummy/dummylib.c:1.4 --- llvm/test/Libraries/libdummy/dummylib.c:1.3 Mon Feb 3 13:12:38 2003 +++ llvm/test/Libraries/libdummy/dummylib.c Tue Feb 11 17:12:23 2003 @@ -4,6 +4,11 @@ #include #include +// Varargs function definitions +int ioctl(int d, int request) {return 0; } +int printf(const char *X) {return 0; } + + int gettimeofday(struct timeval *tv, void *tz) { return 0; } void *xmalloc(size_t X) { return malloc(X); } @@ -37,7 +42,7 @@ size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream) { return 0; } int fseek(FILE *stream, long offset, int whence) { return 0; } int feof(FILE *stream) { return 0; } -int fputs(const char *s, FILE *stream) { return 0; } +int fputs(const char *s, char *stream) { return 0; } int ferror(FILE *F) { return 0; } FILE *fdopen(int fildes, const char *mode) { return 0;} int ungetc(int c, FILE *stream) { return 0; } From lattner at cs.uiuc.edu Tue Feb 11 17:13:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Feb 11 17:13:04 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile Message-ID: <200302112312.RAA09742@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile updated: 1.10 -> 1.11 --- Log message: Tighten up dependancies --- Diffs of the changes: Index: llvm/test/Programs/Makefile diff -u llvm/test/Programs/Makefile:1.10 llvm/test/Programs/Makefile:1.11 --- llvm/test/Programs/Makefile:1.10 Tue Jan 21 16:31:18 2003 +++ llvm/test/Programs/Makefile Tue Feb 11 17:12:38 2003 @@ -15,6 +15,7 @@ # ifdef TEST TestMakefile := $(wildcard $(LEVEL)/test/Programs/TEST.$(TEST).Makefile) +TestReport := $(wildcard $(LEVEL)/test/Programs/TEST.$(TEST).report) ifneq ($(TestMakefile),) -include $(TestMakefile) endif @@ -24,14 +25,14 @@ # Rules for building a report from 'make report TEST=' # -report.$(TEST).raw.out: $(REPORT_DEPENDENCIES) +report.$(TEST).raw.out: $(REPORT_DEPENDENCIES) $(TestMakefile) gmake TEST=$(TEST) 2>&1 | tee $@ -report.$(TEST).txt: report.$(TEST).raw.out +report.$(TEST).txt: report.$(TEST).raw.out $(TestReport) ./GenerateReport.pl TEST.$(TEST).report < $< > $@ -report.$(TEST).html: report.$(TEST).raw.out +report.$(TEST).html: report.$(TEST).raw.out $(TestReport) ./GenerateReport.pl -html TEST.$(TEST).report < $< > $@ report: report.$(TEST).txt From lattner at cs.uiuc.edu Tue Feb 11 17:14:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Feb 11 17:14:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.dsgraph.Makefile TEST.dsgraph.report Message-ID: <200302112313.RAA09755@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.dsgraph.Makefile updated: 1.7 -> 1.8 TEST.dsgraph.report updated: 1.2 -> 1.3 --- Log message: Add info about steensgaards implementation --- Diffs of the changes: Index: llvm/test/Programs/TEST.dsgraph.Makefile diff -u llvm/test/Programs/TEST.dsgraph.Makefile:1.7 llvm/test/Programs/TEST.dsgraph.Makefile:1.8 --- llvm/test/Programs/TEST.dsgraph.Makefile:1.7 Sat Feb 8 14:43:46 2003 +++ llvm/test/Programs/TEST.dsgraph.Makefile Tue Feb 11 17:13:04 2003 @@ -14,8 +14,9 @@ ANALYZE_OPTS := -stats -time-passes -only-print-main-ds -dsstats -instcount $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \ -Output/%.$(TEST).report.txt: Output/%.lib.bc $(LANALYZE) +Output/%.$(TEST).report.txt: Output/%.lib.bc $(LANALYZE) $(LOPT) -(time -p $(LANALYZE) -$(PASS)datastructure $(ANALYZE_OPTS) $<)> $@ 2>&1 + -($(LOPT) -steens-aa -time-passes > /dev/null < $<) >> $@ 2>&1 $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \ test.$(TEST).%: Output/%.$(TEST).report.txt @@ -27,4 +28,5 @@ # Define REPORT_DEPENDENCIES so that the report is regenerated if analyze or # dummylib is updated. # -REPORT_DEPENDENCIES := $(DUMMYLIB) $(LANALYZE) +REPORT_DEPENDENCIES := $(DUMMYLIB) $(LANALYZE) $(LOPT) + Index: llvm/test/Programs/TEST.dsgraph.report diff -u llvm/test/Programs/TEST.dsgraph.report:1.2 llvm/test/Programs/TEST.dsgraph.report:1.3 --- llvm/test/Programs/TEST.dsgraph.report:1.2 Fri Jan 17 17:25:08 2003 +++ llvm/test/Programs/TEST.dsgraph.report Tue Feb 11 17:13:04 2003 @@ -34,6 +34,7 @@ ["BUTim:", '([0-9.]+) \([^)]+\)[ 0-9]+Bottom'], ["TDTim:", '([0-9.]+) \([^)]+\)[ 0-9]+Top'], ["SumTm:", sub { return SumCols(@_, 3); }], + ["SteTm:", '([0-9.]+) \([^)]+\)[ 0-9]+Steensgaard'], [], # Sizes ["LcSize:" , '([0-9]+) Local'], From lattner at cs.uiuc.edu Wed Feb 12 12:44:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Feb 12 12:44:01 2003 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200302121843.MAA24483@apoc.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.74 -> 1.75 --- Log message: Add a new -no-output option, useful for -aa-eval tests. --- Diffs of the changes: Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.74 llvm/tools/opt/opt.cpp:1.75 --- llvm/tools/opt/opt.cpp:1.74 Tue Oct 29 14:48:09 2002 +++ llvm/tools/opt/opt.cpp Wed Feb 12 12:43:33 2003 @@ -48,6 +48,9 @@ PrintEachXForm("p", cl::desc("Print module after each transformation")); static cl::opt +NoOutput("no-output", cl::desc("Do not write result bytecode file"), cl::Hidden); + +static cl::opt Quiet("q", cl::desc("Don't print 'program modified' message")); static cl::alias @@ -128,7 +131,8 @@ Passes.add(createVerifierPass()); // Write bytecode out to disk or cout as the last step... - Passes.add(new WriteBytecodePass(Out, Out != &std::cout)); + if (!NoOutput) + Passes.add(new WriteBytecodePass(Out, Out != &std::cout)); // Now that we have all of the passes ready, run them. if (Passes.run(*M.get()) && !Quiet) From lattner at cs.uiuc.edu Wed Feb 12 12:46:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Feb 12 12:46:01 2003 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200302121845.MAA24554@apoc.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.75 -> 1.76 --- Log message: Add new -no-verify option --- Diffs of the changes: Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.75 llvm/tools/opt/opt.cpp:1.76 --- llvm/tools/opt/opt.cpp:1.75 Wed Feb 12 12:43:33 2003 +++ llvm/tools/opt/opt.cpp Wed Feb 12 12:45:08 2003 @@ -51,6 +51,9 @@ NoOutput("no-output", cl::desc("Do not write result bytecode file"), cl::Hidden); static cl::opt +NoVerify("no-verify", cl::desc("Do not verify result module"), cl::Hidden); + +static cl::opt Quiet("q", cl::desc("Don't print 'program modified' message")); static cl::alias @@ -128,7 +131,8 @@ } // Check that the module is well formed on completion of optimization - Passes.add(createVerifierPass()); + if (!NoVerify) + Passes.add(createVerifierPass()); // Write bytecode out to disk or cout as the last step... if (!NoOutput) From lattner at cs.uiuc.edu Wed Feb 12 12:57:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Feb 12 12:57:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/llubenchmark.c Message-ID: <200302121856.MAA27173@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource: llubenchmark.c (r1.1) removed --- Log message: Benchmark is already in the multisource dir --- Diffs of the changes: From lattner at cs.uiuc.edu Wed Feb 12 13:03:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Feb 12 13:03:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Timer.cpp Message-ID: <200302121902.NAA29982@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: Timer.cpp updated: 1.12 -> 1.13 --- Log message: Don't output times in "scientific" notation --- Diffs of the changes: Index: llvm/lib/Support/Timer.cpp diff -u llvm/lib/Support/Timer.cpp:1.12 llvm/lib/Support/Timer.cpp:1.13 --- llvm/lib/Support/Timer.cpp:1.12 Wed Feb 5 15:44:28 2003 +++ llvm/lib/Support/Timer.cpp Wed Feb 12 13:02:13 2003 @@ -221,8 +221,9 @@ std::cerr << "===" << std::string(73, '-') << "===\n" << std::string(Padding, ' ') << Name << "\n" << "===" << std::string(73, '-') - << "===\n Total Execution Time: " << Total.getProcessTime() - << " seconds (" << Total.getWallTime() + << "===\n Total Execution Time: " << std::fixed + << Total.getProcessTime() + << " seconds (" << Total.getWallTime() << std::scientific << " wall clock)\n\n"; if (Total.UserTime) From lattner at cs.uiuc.edu Wed Feb 12 13:35:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Feb 12 13:35:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.aa.Makefile TEST.aa.report Message-ID: <200302121934.NAA30525@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.aa.Makefile added (r1.1) TEST.aa.report added (r1.1) --- Log message: Alias analysis precision/time comparison tests --- Diffs of the changes: From jstanley at cs.uiuc.edu Wed Feb 12 14:46:01 2003 From: jstanley at cs.uiuc.edu (Joel Stanley) Date: Wed Feb 12 14:46:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200302122045.OAA04242@tank.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.76 -> 1.77 --- Log message: Fixed alloca declaration problem on sun. --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.76 llvm/lib/CWriter/Writer.cpp:1.77 --- llvm/lib/CWriter/Writer.cpp:1.76 Wed Nov 20 12:32:03 2002 +++ llvm/lib/CWriter/Writer.cpp Wed Feb 12 14:45:00 2003 @@ -504,6 +504,17 @@ return Changed; } +static void generateAllocaDecl(ostream& Out) +{ + // On SunOS, we need to insert the alloca macro & proto for the builtin. + Out << "#ifdef sun\n" + << "extern void *__builtin_alloca(unsigned long);\n" + << "#define alloca(x) __builtin_alloca(x)\n" + << "#else\n" + << "#include \n" + << "#endif\n\n"; +} + void CWriter::printModule(Module *M) { // Calculate which global values have names that will collide when we throw // away type information. @@ -528,18 +539,18 @@ //Out << "#include \n"; // get declaration for alloca - Out << "/* Provide Declarations */\n" - << "#include \n\n" - - // Provide a definition for null if one does not already exist, - // and for `bool' if not compiling with a C++ compiler. - << "#ifndef NULL\n#define NULL 0\n#endif\n\n" + Out << "/* Provide Declarations */\n"; + generateAllocaDecl(Out); + + // Provide a definition for null if one does not already exist, + // and for `bool' if not compiling with a C++ compiler. + Out << "#ifndef NULL\n#define NULL 0\n#endif\n\n" << "#ifndef __cplusplus\ntypedef unsigned char bool;\n#endif\n" - + << "\n\n/* Support for floating point constants */\n" << "typedef unsigned long long ConstantDoubleTy;\n" << "typedef unsigned int ConstantFloatTy;\n" - + << "\n\n/* Global Declarations */\n"; // First output all the declarations for the program, because C requires From lattner at cs.uiuc.edu Wed Feb 12 14:46:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Feb 12 14:46:03 2003 Subject: [llvm-commits] CVS: llvm/Makefile.common Message-ID: <200302122045.OAA10816@apoc.cs.uiuc.edu> Changes in directory llvm: Makefile.common updated: 1.76 -> 1.77 --- Log message: Add -fomit-frame-pointer when optimizing --- Diffs of the changes: Index: llvm/Makefile.common diff -u llvm/Makefile.common:1.76 llvm/Makefile.common:1.77 --- llvm/Makefile.common:1.76 Fri Jan 31 13:00:26 2003 +++ llvm/Makefile.common Wed Feb 12 14:45:45 2003 @@ -157,13 +157,13 @@ # Compile a cpp file, don't link... Compile := $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts) CompileG := $(Compile) -g -D_DEBUG -CompileO := $(Compile) -O3 -DNDEBUG -finline-functions -felide-constructors -fshort-enums ## DISABLE -freg-struct-return because of gcc3.2 bug +CompileO := $(Compile) -O3 -DNDEBUG -finline-functions -felide-constructors -fshort-enums -fomit-frame-pointer CompileP := $(CompileO) $(PROFILE) # Compile a c file, don't link... CompileC := $(CC) -c $(CPPFLAGS) $(CCFLAGS) $(CompileCommonOpts) CompileCG := $(CompileC) -g -D_DEBUG -CompileCO := $(CompileC) -O3 -DNDEBUG -finline-functions -fshort-enums ## DISABLE -freg-struct-return because of gcc3.2 bug +CompileCO := $(CompileC) -O3 -DNDEBUG -finline-functions -fshort-enums -fomit-frame-pointer CompileCP := $(CompileCO) $(PROFILE) From lattner at cs.uiuc.edu Wed Feb 12 15:46:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Feb 12 15:46:00 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2003-02-12-NonlocalGoto.c Message-ID: <200302122145.PAA11319@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2003-02-12-NonlocalGoto.c added (r1.1) --- Log message: New testcase, for something we may never really want to support :) --- Diffs of the changes: From lattner at cs.uiuc.edu Wed Feb 12 23:09:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Feb 12 23:09:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Timer.cpp Message-ID: <200302130508.XAA15966@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: Timer.cpp updated: 1.13 -> 1.14 --- Log message: Remove gunk that was supposed to make space evaluation more precise, but never worked. --- Diffs of the changes: Index: llvm/lib/Support/Timer.cpp diff -u llvm/lib/Support/Timer.cpp:1.13 llvm/lib/Support/Timer.cpp:1.14 --- llvm/lib/Support/Timer.cpp:1.13 Wed Feb 12 13:02:13 2003 +++ llvm/lib/Support/Timer.cpp Wed Feb 12 23:07:53 2003 @@ -23,12 +23,6 @@ cl::Hidden); } -// getNumBytesToNotCount - This function is supposed to return the number of -// bytes that are to be considered not allocated, even though malloc thinks they -// are allocated. -// -static unsigned getNumBytesToNotCount(); - static TimerGroup *DefaultTimerGroup = 0; static TimerGroup *getDefaultTimerGroup() { if (DefaultTimerGroup) return DefaultTimerGroup; @@ -75,7 +69,7 @@ static long getMemUsage() { if (TrackSpace) { struct mallinfo MI = mallinfo(); - return MI.uordblks/*+MI.hblkhd-getNumBytesToNotCount()*/; + return MI.uordblks/*+MI.hblkhd*/; } else { return 0; } @@ -256,61 +250,4 @@ delete DefaultTimerGroup; DefaultTimerGroup = 0; } -} - - - -#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2) && (__GNUC_PATCHLEVEL__ == 0) -// If we have GCC 3.2.0, we can calculate pool allocation bookkeeping info -#define HAVE_POOL -extern "C" { - // Taken from GCC 3.2's stl_alloc.h file: - enum {_ALIGN = 8, _MAX_BYTES = 128, NFREE = _MAX_BYTES / _ALIGN}; - struct FreeList { FreeList *Next; }; - - FreeList *_ZNSt24__default_alloc_templateILb1ELi0EE12_S_free_listE[NFREE]; - char *_ZNSt24__default_alloc_templateILb1ELi0EE13_S_start_freeE; - char *_ZNSt24__default_alloc_templateILb1ELi0EE11_S_end_freeE; - size_t _ZNSt24__default_alloc_templateILb1ELi0EE12_S_heap_sizeE; - - // Make the symbols possible to use... - FreeList* (&TheFreeList)[NFREE] = _ZNSt24__default_alloc_templateILb1ELi0EE12_S_free_listE; - char * &StartFree = _ZNSt24__default_alloc_templateILb1ELi0EE13_S_start_freeE; - char * &EndFree = _ZNSt24__default_alloc_templateILb1ELi0EE11_S_end_freeE; - size_t &HeapSize = _ZNSt24__default_alloc_templateILb1ELi0EE12_S_heap_sizeE; -} -#endif - -// getNumBytesToNotCount - This function is supposed to return the number of -// bytes that are to be considered not allocated, even though malloc thinks they -// are allocated. -// -static unsigned getNumBytesToNotCount() { -#ifdef HAVE_POOL - // If we have GCC 3.2.0, we can subtract off pool allocation bookkeeping info - - // Size of the free slab section... - unsigned FreePoolMem = (unsigned)(EndFree-StartFree); - - // Walk all of the free lists, adding memory to the free counter whenever we - // have a free bucket. - for (unsigned i = 0; i != NFREE; ++i) { - unsigned NumEntries = 0; - for (FreeList *FL = TheFreeList[i]; FL; ++NumEntries, FL = FL->Next) - /*empty*/ ; - -#if 0 - if (NumEntries) - std::cerr << " For Size[" << (i+1)*_ALIGN << "]: " << NumEntries - << " Free entries\n"; -#endif - FreePoolMem += NumEntries*(i+1)*_ALIGN; - } - return FreePoolMem; - -#else -#warning "Don't know how to avoid pool allocation accounting overhead for this" -#warning " compiler: Space usage numbers (with -time-passes) may be off!" - return 0; -#endif } From lattner at cs.uiuc.edu Thu Feb 13 10:26:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 10:26:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Timer.cpp Message-ID: <200302131625.KAA26271@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: Timer.cpp updated: 1.14 -> 1.15 --- Log message: Make more compatible with GCC 2.96 --- Diffs of the changes: Index: llvm/lib/Support/Timer.cpp diff -u llvm/lib/Support/Timer.cpp:1.14 llvm/lib/Support/Timer.cpp:1.15 --- llvm/lib/Support/Timer.cpp:1.14 Wed Feb 12 23:07:53 2003 +++ llvm/lib/Support/Timer.cpp Thu Feb 13 10:25:28 2003 @@ -215,10 +215,11 @@ std::cerr << "===" << std::string(73, '-') << "===\n" << std::string(Padding, ' ') << Name << "\n" << "===" << std::string(73, '-') - << "===\n Total Execution Time: " << std::fixed - << Total.getProcessTime() - << " seconds (" << Total.getWallTime() << std::scientific - << " wall clock)\n\n"; + << "===\n Total Execution Time: "; + + // Hack for GCC 2.96... :( it doesn't support manipulators! + fprintf(stderr, "%.4f seconds (%.4f wall clock)\n\n", + Total.getProcessTime(), Total.getWallTime()); if (Total.UserTime) std::cerr << " ---User Time---"; From lattner at cs.uiuc.edu Thu Feb 13 10:57:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 10:57:00 2003 Subject: [llvm-commits] CVS: llvm/Makefile.common Message-ID: <200302131656.KAA28095@apoc.cs.uiuc.edu> Changes in directory llvm: Makefile.common updated: 1.77 -> 1.78 --- Log message: Fix profile builds --- Diffs of the changes: Index: llvm/Makefile.common diff -u llvm/Makefile.common:1.77 llvm/Makefile.common:1.78 --- llvm/Makefile.common:1.77 Wed Feb 12 14:45:45 2003 +++ llvm/Makefile.common Thu Feb 13 10:56:30 2003 @@ -153,18 +153,19 @@ # -Wno-unused-parameter CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused -I$(LEVEL)/include +CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions -fshort-enums # Compile a cpp file, don't link... Compile := $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts) CompileG := $(Compile) -g -D_DEBUG -CompileO := $(Compile) -O3 -DNDEBUG -finline-functions -felide-constructors -fshort-enums -fomit-frame-pointer -CompileP := $(CompileO) $(PROFILE) +CompileO := $(Compile) $(CompileOptimizeOpts) -felide-constructors -fomit-frame-pointer +CompileP := $(Compile) $(CompileOptimizeOpts) -felide-constructors $(PROFILE) # Compile a c file, don't link... CompileC := $(CC) -c $(CPPFLAGS) $(CCFLAGS) $(CompileCommonOpts) CompileCG := $(CompileC) -g -D_DEBUG -CompileCO := $(CompileC) -O3 -DNDEBUG -finline-functions -fshort-enums -fomit-frame-pointer -CompileCP := $(CompileCO) $(PROFILE) +CompileCO := $(CompileC) $(CompileOptimizeOpts) -felide-constructors -fomit-frame-pointer +CompileCP := $(CompileC) $(CompileOptimizeOpts) -felide-constructors $(PROFILE) # Link final executable From lattner at cs.uiuc.edu Thu Feb 13 13:10:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 13:10:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DSNode.h DSSupport.h Message-ID: <200302131909.NAA22751@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: DSNode.h updated: 1.21 -> 1.22 DSSupport.h updated: 1.14 -> 1.15 --- Log message: Move node forwarding code from being inlined to being out-of-line. This brings a 11.6% speedup to steens, and a 3.6 overall speedup to ds-aa --- Diffs of the changes: Index: llvm/include/llvm/Analysis/DSNode.h diff -u llvm/include/llvm/Analysis/DSNode.h:1.21 llvm/include/llvm/Analysis/DSNode.h:1.22 --- llvm/include/llvm/Analysis/DSNode.h:1.21 Tue Feb 11 17:11:51 2003 +++ llvm/include/llvm/Analysis/DSNode.h Thu Feb 13 13:08:57 2003 @@ -276,22 +276,7 @@ if (!N || N->ForwardNH.isNull()) return N; - // Handle node forwarding here! - DSNode *Next = N->ForwardNH.getNode(); // Cause recursive shrinkage - Offset += N->ForwardNH.getOffset(); - - if (--N->NumReferrers == 0) { - // Removing the last referrer to the node, sever the forwarding link - N->stopForwarding(); - } - - N = Next; - N->NumReferrers++; - if (N->Size <= Offset) { - assert(N->Size <= 1 && "Forwarded to shrunk but not collapsed node?"); - Offset = 0; - } - return N; + return HandleForwarding(); } inline void DSNodeHandle::setNode(DSNode *n) { Index: llvm/include/llvm/Analysis/DSSupport.h diff -u llvm/include/llvm/Analysis/DSSupport.h:1.14 llvm/include/llvm/Analysis/DSSupport.h:1.15 --- llvm/include/llvm/Analysis/DSSupport.h:1.14 Tue Feb 11 17:11:51 2003 +++ llvm/include/llvm/Analysis/DSSupport.h Thu Feb 13 13:08:58 2003 @@ -112,6 +112,8 @@ inline DSNodeHandle &getLink(unsigned Num); inline void setLink(unsigned Num, const DSNodeHandle &NH); +private: + DSNode *HandleForwarding() const; }; namespace std { From lattner at cs.uiuc.edu Thu Feb 13 13:10:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 13:10:04 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp Message-ID: <200302131909.NAA22759@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.93 -> 1.94 --- Log message: Move node forwarding code from being inlined to being out-of-line. This brings a 11.6% speedup to steens, and a 3.6 overall speedup to ds-aa --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.93 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.94 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.93 Tue Feb 11 17:11:43 2003 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Thu Feb 13 13:09:00 2003 @@ -24,6 +24,27 @@ } using namespace DS; +DSNode *DSNodeHandle::HandleForwarding() const { + assert(!N->ForwardNH.isNull() && "Can only be invoked if forwarding!"); + + // Handle node forwarding here! + DSNode *Next = N->ForwardNH.getNode(); // Cause recursive shrinkage + Offset += N->ForwardNH.getOffset(); + + if (--N->NumReferrers == 0) { + // Removing the last referrer to the node, sever the forwarding link + N->stopForwarding(); + } + + N = Next; + N->NumReferrers++; + if (N->Size <= Offset) { + assert(N->Size <= 1 && "Forwarded to shrunk but not collapsed node?"); + Offset = 0; + } + return N; +} + //===----------------------------------------------------------------------===// // DSNode Implementation //===----------------------------------------------------------------------===// From lattner at cs.uiuc.edu Thu Feb 13 13:47:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 13:47:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Value.cpp Message-ID: <200302131946.NAA27620@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Value.cpp updated: 1.30 -> 1.31 --- Log message: This speeds up processing LLVM a _lot_, 17% in the case of loading and destroying "vortex" --- Diffs of the changes: Index: llvm/lib/VMCore/Value.cpp diff -u llvm/lib/VMCore/Value.cpp:1.30 llvm/lib/VMCore/Value.cpp:1.31 --- llvm/lib/VMCore/Value.cpp:1.30 Wed Oct 9 18:12:59 2002 +++ llvm/lib/VMCore/Value.cpp Thu Feb 13 13:46:22 2003 @@ -89,7 +89,8 @@ /* empty */; assert(i < Uses.size() && "Use not in uses list!!"); - Uses.erase(Uses.begin()+i); + Uses[i] = Uses.back(); + Uses.pop_back(); } //===----------------------------------------------------------------------===// From lattner at cs.uiuc.edu Thu Feb 13 14:15:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 14:15:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Printer.cpp Message-ID: <200302132014.OAA28276@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Printer.cpp updated: 1.49 -> 1.50 --- Log message: Use the new tailclip property new added to graphviz CVS to make call nodes actually intelligable --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/Printer.cpp diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.49 llvm/lib/Analysis/DataStructure/Printer.cpp:1.50 --- llvm/lib/Analysis/DataStructure/Printer.cpp:1.49 Tue Feb 11 13:27:27 2003 +++ llvm/lib/Analysis/DataStructure/Printer.cpp Thu Feb 13 14:14:40 2003 @@ -69,8 +69,7 @@ } static const char *getGraphProperties(const DSGraph *G) { - return "\tedge [arrowtail=\"dot\"];\n" - "\tsize=\"10,7.5\";\n" + return "\tsize=\"10,7.5\";\n" "\trotate=\"90\";\n"; } @@ -135,21 +134,21 @@ if (DSNode *N = Call.getRetVal().getNode()) { int EdgeDest = Call.getRetVal().getOffset() >> DS::PointerShift; if (EdgeDest == 0) EdgeDest = -1; - GW.emitEdge(&Call, 0, N, EdgeDest, "color=gray63"); + GW.emitEdge(&Call, 0, N, EdgeDest, "color=gray63,tailclip=false"); } // Print out the callee... if (Call.isIndirectCall()) { DSNode *N = Call.getCalleeNode(); assert(N && "Null call site callee node!"); - GW.emitEdge(&Call, 1, N, -1, "color=gray63"); + GW.emitEdge(&Call, 1, N, -1, "color=gray63,tailclip=false"); } for (unsigned j = 0, e = Call.getNumPtrArgs(); j != e; ++j) if (DSNode *N = Call.getPtrArg(j).getNode()) { int EdgeDest = Call.getPtrArg(j).getOffset() >> DS::PointerShift; if (EdgeDest == 0) EdgeDest = -1; - GW.emitEdge(&Call, j+2, N, EdgeDest, "color=gray63"); + GW.emitEdge(&Call, j+2, N, EdgeDest, "color=gray63,tailclip=false"); } } } From lattner at cs.uiuc.edu Thu Feb 13 15:45:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 15:45:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Steensgaard.cpp Message-ID: <200302132144.PAA32336@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Steensgaard.cpp updated: 1.26 -> 1.27 --- Log message: Hax0r around a deficiency in the Pass infrastructure --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.26 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.27 --- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.26 Tue Feb 11 17:11:44 2003 +++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Thu Feb 13 15:44:18 2003 @@ -19,7 +19,10 @@ DSGraph *GlobalsGraph; // FIXME: Eliminate globals graph stuff from DNE public: Steens() : ResultGraph(0) {} - ~Steens() { assert(ResultGraph == 0 && "releaseMemory not called?"); } + ~Steens() { + releaseMyMemory(); + assert(ResultGraph == 0 && "releaseMemory not called?"); + } //------------------------------------------------ // Implement the Pass API @@ -30,7 +33,7 @@ // bool run(Module &M); - virtual void releaseMemory() { delete ResultGraph; ResultGraph = 0; } + virtual void releaseMyMemory() { delete ResultGraph; ResultGraph = 0; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); // Does not transform code... From lattner at cs.uiuc.edu Thu Feb 13 16:12:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:12:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/ Message-ID: <200302132211.QAA32618@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Programs/NoSource added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Feb 13 16:15:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:15:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/Flex/ Message-ID: <200302132214.QAA32668@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource/Flex: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Programs/NoSource/Flex added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Feb 13 16:15:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:15:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/Povray31/ Message-ID: <200302132214.QAA32673@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource/Povray31: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Programs/NoSource/Povray31 added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Feb 13 16:16:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:16:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/Makefile Makefile.nosource Message-ID: <200302132215.QAA32697@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource: Makefile added (r1.1) Makefile.nosource added (r1.1) --- Log message: Initial checkin of NoSource directory --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Feb 13 16:16:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:16:03 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/Flex/Makefile Message-ID: <200302132215.QAA32705@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource/Flex: Makefile added (r1.1) --- Log message: New 'flex' test --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Feb 13 16:16:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:16:04 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/Povray31/Makefile Message-ID: <200302132215.QAA32710@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource/Povray31: Makefile added (r1.1) --- Log message: New 'povray' test --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Feb 13 16:34:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:34:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/m4/ Message-ID: <200302132233.QAA03689@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource/m4: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Programs/NoSource/m4 added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Feb 13 16:34:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:34:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/Larn/ Message-ID: <200302132233.QAA03696@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource/Larn: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Programs/NoSource/Larn added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Feb 13 16:34:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:34:04 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/Makefile.nosource Message-ID: <200302132233.QAA03713@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource: Makefile.nosource updated: 1.1 -> 1.2 --- Log message: New testcases --- Diffs of the changes: Index: llvm/test/Programs/NoSource/Makefile.nosource diff -u llvm/test/Programs/NoSource/Makefile.nosource:1.1 llvm/test/Programs/NoSource/Makefile.nosource:1.2 --- llvm/test/Programs/NoSource/Makefile.nosource:1.1 Thu Feb 13 16:15:14 2003 +++ llvm/test/Programs/NoSource/Makefile.nosource Thu Feb 13 16:33:29 2003 @@ -1,3 +1,4 @@ +USE_PRECOMPILED_BYTECODE := 1 include $(LEVEL)/test/Programs/MultiSource/Makefile.multisrc From lattner at cs.uiuc.edu Thu Feb 13 16:34:05 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:34:05 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/Larn/Makefile Message-ID: <200302132233.QAA03718@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource/Larn: Makefile added (r1.1) --- Log message: New testcases --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Feb 13 16:34:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:34:07 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/m4/Makefile Message-ID: <200302132233.QAA03724@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource/m4: Makefile added (r1.1) --- Log message: New testcases --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Feb 13 16:35:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:35:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/Flex/Makefile Message-ID: <200302132234.QAA03742@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource/Flex: Makefile updated: 1.1 -> 1.2 --- Log message: Eliminate redundancy --- Diffs of the changes: Index: llvm/test/Programs/NoSource/Flex/Makefile diff -u llvm/test/Programs/NoSource/Flex/Makefile:1.1 llvm/test/Programs/NoSource/Flex/Makefile:1.2 --- llvm/test/Programs/NoSource/Flex/Makefile:1.1 Thu Feb 13 16:15:21 2003 +++ llvm/test/Programs/NoSource/Flex/Makefile Thu Feb 13 16:34:06 2003 @@ -1,7 +1,5 @@ LEVEL = ../../../.. PROG = flex -USE_PRECOMPILED_BYTECODE := 1 - include ../Makefile.nosource From lattner at cs.uiuc.edu Thu Feb 13 16:35:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 16:35:03 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/NoSource/Povray31/Makefile Message-ID: <200302132234.QAA03749@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/NoSource/Povray31: Makefile updated: 1.1 -> 1.2 --- Log message: Eliminate redundancy --- Diffs of the changes: Index: llvm/test/Programs/NoSource/Povray31/Makefile diff -u llvm/test/Programs/NoSource/Povray31/Makefile:1.1 llvm/test/Programs/NoSource/Povray31/Makefile:1.2 --- llvm/test/Programs/NoSource/Povray31/Makefile:1.1 Thu Feb 13 16:15:25 2003 +++ llvm/test/Programs/NoSource/Povray31/Makefile Thu Feb 13 16:34:07 2003 @@ -1,7 +1,5 @@ LEVEL = ../../../.. PROG = povray31 -USE_PRECOMPILED_BYTECODE := 1 - include ../Makefile.nosource From lattner at cs.uiuc.edu Thu Feb 13 21:03:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 21:03:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/LevelRaise/2003-02-13-CallRaise.ll Message-ID: <200302140302.VAA05368@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/LevelRaise: 2003-02-13-CallRaise.ll added (r1.1) --- Log message: New testcase distilled from LARN --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Feb 13 21:08:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 21:08:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp Message-ID: <200302140307.VAA05610@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: ExprTypeConvert.cpp updated: 1.68 -> 1.69 --- Log message: Fix bug: LevelRaise/2003-02-13-CallRaise.ll --- Diffs of the changes: Index: llvm/lib/Transforms/ExprTypeConvert.cpp diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.68 llvm/lib/Transforms/ExprTypeConvert.cpp:1.69 --- llvm/lib/Transforms/ExprTypeConvert.cpp:1.68 Thu Jan 30 11:10:41 2003 +++ llvm/lib/Transforms/ExprTypeConvert.cpp Thu Feb 13 21:07:17 2003 @@ -512,6 +512,8 @@ const FunctionType *NewTy = FunctionType::get(Ty, ArgTys, FT->isVarArg()); const PointerType *NewPTy = PointerType::get(NewTy); + if (Ty == Type::VoidTy) + Name = ""; // Make sure not to name calls that now return void! Res = new CallInst(Constant::getNullValue(NewPTy), std::vector(I->op_begin()+1, I->op_end()), @@ -1153,6 +1155,9 @@ const PointerType *NewPTy = cast(NewVal->getType()); const FunctionType *NewTy = cast(NewPTy->getElementType()); const FunctionType::ParamTypes &PTs = NewTy->getParamTypes(); + + if (NewTy->getReturnType() == Type::VoidTy) + Name = ""; // Make sure not to name a void call! // Get an iterator to the call instruction so that we can insert casts for // operands if needbe. Note that we do not require operands to be From lattner at cs.uiuc.edu Thu Feb 13 22:23:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 22:23:00 2003 Subject: [llvm-commits] CVS: llvm/www/docs/GettingStarted.html Message-ID: <200302140422.WAA18445@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: GettingStarted.html updated: 1.7 -> 1.8 --- Log message: Clarify the Makefile.config settings --- Diffs of the changes: Index: llvm/www/docs/GettingStarted.html diff -u llvm/www/docs/GettingStarted.html:1.7 llvm/www/docs/GettingStarted.html:1.8 --- llvm/www/docs/GettingStarted.html:1.7 Thu Sep 19 14:56:53 2002 +++ llvm/www/docs/GettingStarted.html Thu Feb 13 22:22:13 2003 @@ -72,15 +72,17 @@ Here's the short story for getting up and running quickly with LLVM: -
    +
    1. Find the path to the CVS repository containing LLVM (we'll call this CVSROOTDIR).
    2. cd where-you-want-llvm-to-live
    3. cvs -d CVSROOTDIR checkout llvm -
    4. Edit llvm/Makefile.config to set local paths if necessary.
    5. cd llvm +
    6. Edit Makefile.config to set local paths. This includes + setting the install location of the C frontend, and the various paths + to the C and C++ compilers used to build LLVM itself.
    7. gmake -k |& tee gnumake.out    # this is csh or tcsh syntax -
+

See Setting up your environment on tips to simplify working with the LLVM front-end and compiled tools. See the @@ -356,7 +358,7 @@ x.o file (which is an LLVM bytecode file that can be disassembled or manipulated just like any other bytecode file). The command line interface to gccas is designed to be as close as - possible to the system as utility so that the gcc + possible to the system 'as' utility so that the gcc frontend itself did not have to be modified to interface to a "wierd" assembler.

@@ -460,7 +462,7 @@ -Last modified: Thu Sep 19 14:55:19 CDT 2002 +Last modified: Thu Feb 13 22:20:39 CST 2003 From lattner at cs.uiuc.edu Thu Feb 13 22:57:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 22:57:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp Message-ID: <200302140456.WAA12863@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Local.cpp updated: 1.50 -> 1.51 --- Log message: Don't put integer pointers (longs) into the scalar map. This speeds stuff up by 10% on some tests, woot! --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/Local.cpp diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.50 llvm/lib/Analysis/DataStructure/Local.cpp:1.51 --- llvm/lib/Analysis/DataStructure/Local.cpp:1.50 Tue Feb 11 17:11:44 2003 +++ llvm/lib/Analysis/DataStructure/Local.cpp Thu Feb 13 22:55:58 2003 @@ -143,6 +143,16 @@ #ifndef NDEBUG Timer::addPeakMemoryMeasurement(); #endif + + // Remove all integral constants from the scalarmap! + for (hash_map::iterator I = ScalarMap.begin(); + I != ScalarMap.end();) + if (isa(I->first)) { + hash_map::iterator J = I++; + ScalarMap.erase(J); + } else + ++I; + markIncompleteNodes(DSGraph::MarkFormalArgs); // Remove any nodes made dead due to merging... From lattner at cs.uiuc.edu Thu Feb 13 23:35:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 23:35:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp Message-ID: <200302140534.XAA12952@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: DeadTypeElimination.cpp updated: 1.42 -> 1.43 --- Log message: Fix a misunderstanding of the standard associative containers --- Diffs of the changes: Index: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.42 llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.43 --- llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.42 Wed Nov 20 12:34:36 2002 +++ llvm/lib/Transforms/IPO/DeadTypeElimination.cpp Thu Feb 13 23:34:35 2003 @@ -77,15 +77,10 @@ for (SymbolTable::VarMap::iterator PI = Plane.begin(); PI != Plane.end();) // If this entry should be unconditionally removed, or if we detect that // the type is not used, remove it. - // if (ShouldNukeSymtabEntry(*PI) || !UsedTypes.count(cast(PI->second))) { -#if MAP_IS_NOT_BRAINDEAD - PI = Plane.erase(PI); // STD C++ Map should support this! -#else - Plane.erase(PI); // Alas, GCC 2.95.3 doesn't *SIGH* - PI = Plane.begin(); -#endif + SymbolTable::VarMap::iterator PJ = PI++; + Plane.erase(PJ); ++NumKilled; Changed = true; } else { From lattner at cs.uiuc.edu Thu Feb 13 23:35:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Feb 13 23:35:03 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h Message-ID: <200302140534.XAA12959@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: PassManagerT.h updated: 1.35 -> 1.36 --- Log message: Fix a misunderstanding of the standard associative containers --- Diffs of the changes: Index: llvm/lib/VMCore/PassManagerT.h diff -u llvm/lib/VMCore/PassManagerT.h:1.35 llvm/lib/VMCore/PassManagerT.h:1.36 --- llvm/lib/VMCore/PassManagerT.h:1.35 Tue Oct 29 17:05:17 2002 +++ llvm/lib/VMCore/PassManagerT.h Thu Feb 13 23:34:36 2003 @@ -261,13 +261,8 @@ ++I; // This analysis is preserved, leave it in the available set... else { if (!dynamic_cast(I->second)) { -#if MAP_DOESNT_HAVE_BROKEN_ERASE_MEMBER - I = CurrentAnalyses.erase(I); // Analysis not preserved! -#else - // GCC 2.95.3 STL doesn't have correct erase member! - CurrentAnalyses.erase(I); - I = CurrentAnalyses.begin(); -#endif + std::map::iterator J = I++; + CurrentAnalyses.erase(J); // Analysis not preserved! } else { ++I; } From lattner at cs.uiuc.edu Fri Feb 14 00:29:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 00:29:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp Message-ID: <200302140628.AAA17442@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.94 -> 1.95 --- Log message: - Eliminate provably non-pointer nodes from graphs. This helps a lot of testcases, for example: New Time New #Nodes Old Time Old #Nodes 254.gap: 91.1024 21605 91.1397 22657 povray31: 2.7807 8613 3.0152 10338 255.vortex: 1.2034 8153 1.2172 8822 moria: .6756 3150 .7054 3877 300.twolf: .1652 2010 .1851 3270 Typically, testcases which use long and ulong integers a lot get better, f.e. povray above. --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.94 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.95 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.94 Thu Feb 13 13:09:00 2003 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Fri Feb 14 00:28:00 2003 @@ -1039,12 +1039,29 @@ // Mark all nodes reachable by (non-global) scalar nodes as alive... for (hash_map::iterator I = ScalarMap.begin(), - E = ScalarMap.end(); I != E; ++I) - if (!isa(I->first)) - I->second.getNode()->markReachableNodes(Alive); - else { // Keep track of global nodes - GlobalNodes.push_back(std::make_pair(I->first, I->second.getNode())); + E = ScalarMap.end(); I != E; ) + if (isa(I->first)) { // Keep track of global nodes assert(I->second.getNode() && "Null global node?"); + GlobalNodes.push_back(std::make_pair(I->first, I->second.getNode())); + ++I; + } else { + // Check to see if this is a worthless node generated for non-pointer + // values, such as integers. Consider an addition of long types: A+B. + // Assuming we can track all uses of the value in this context, and it is + // NOT used as a pointer, we can delete the node. We will be able to + // detect this situation if the node pointed to ONLY has Unknown bit set + // in the node. In this case, the node is not incomplete, does not point + // to any other nodes (no mod/ref bits set), and is therefore + // uninteresting for data structure analysis. If we run across one of + // these, prune the scalar pointing to it. + // + DSNode *N = I->second.getNode(); + if (N->NodeType == DSNode::UnknownNode && !isa(I->first)) { + ScalarMap.erase(I++); + } else { + I->second.getNode()->markReachableNodes(Alive); + ++I; + } } // The return value is alive as well... From lattner at cs.uiuc.edu Fri Feb 14 13:13:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 13:13:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/FunctionResolution.cpp Message-ID: <200302141912.NAA30810@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: FunctionResolution.cpp updated: 1.20 -> 1.21 --- Log message: Fix a bug that cause a crash resolving questionable function calls --- Diffs of the changes: Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.20 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.21 --- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.20 Thu Jan 30 16:38:44 2003 +++ llvm/lib/Transforms/IPO/FunctionResolution.cpp Fri Feb 14 13:12:29 2003 @@ -49,8 +49,8 @@ // BasicBlock::iterator BBI = CI; unsigned NumArgsToCopy = CI->getNumOperands()-1; - if (CI->getNumOperands()-1 != ParamTys.size() && - !(CI->getNumOperands()-1 > ParamTys.size() && + if (NumArgsToCopy != ParamTys.size() && + !(NumArgsToCopy > ParamTys.size() && Dest->getFunctionType()->isVarArg())) { std::cerr << "WARNING: Call arguments do not match expected number of" << " parameters.\n"; @@ -59,6 +59,8 @@ std::cerr << "Function resolved to: "; WriteAsOperand(std::cerr, Dest); std::cerr << "\n"; + if (NumArgsToCopy > ParamTys.size()) + NumArgsToCopy = ParamTys.size(); } std::vector Params; From lattner at cs.uiuc.edu Fri Feb 14 13:14:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 13:14:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-bc/Output/ Message-ID: <200302141913.NAA30849@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-bc/Output: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Programs/MultiSource/Ptrdist-bc/Output added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Feb 14 13:14:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 13:14:03 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-bc/ Message-ID: <200302141913.NAA30831@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-bc: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Programs/MultiSource/Ptrdist-bc added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Feb 14 13:15:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 13:15:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-bc/COPYING Makefile array.b bc.c bc.y.dist bcdefs.h config.h const.h etest.b execute.c fact.b fix_math.h global.c global.h libmath.b load.c main.c math.h number.c number.h primes.OUT primes.b proto.h sbc.y-backup scan.c scan.l.dist sqrt.b storage.c util.c version.h y.tab.h Message-ID: <200302141914.NAA30869@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-bc: COPYING added (r1.1) Makefile added (r1.1) array.b added (r1.1) bc.c added (r1.1) bc.y.dist added (r1.1) bcdefs.h added (r1.1) config.h added (r1.1) const.h added (r1.1) etest.b added (r1.1) execute.c added (r1.1) fact.b added (r1.1) fix_math.h added (r1.1) global.c added (r1.1) global.h added (r1.1) libmath.b added (r1.1) load.c added (r1.1) main.c added (r1.1) math.h added (r1.1) number.c added (r1.1) number.h added (r1.1) primes.OUT added (r1.1) primes.b added (r1.1) proto.h added (r1.1) sbc.y-backup added (r1.1) scan.c added (r1.1) scan.l.dist added (r1.1) sqrt.b added (r1.1) storage.c added (r1.1) util.c added (r1.1) version.h added (r1.1) y.tab.h added (r1.1) --- Log message: New checkin of BC benchmark that actually compiles! --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Feb 14 13:16:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 13:16:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-bc-disabled/COPYING Makefile array.b bc.c bc.y.dist bcdefs.h config.h const.h etest.b execute.c fact.b fix_math.h global.c global.h libmath.b load.c main.c math.h number.c number.h primes.OUT primes.b proto.h sbc.cpp sbc.h sbc.output sbc.y scan.c scan.l.dist sqrt.b storage.c util.c version.h y.tab.h Message-ID: <200302141915.NAA30891@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-bc-disabled: COPYING (r1.1) removed Makefile (r1.1) removed array.b (r1.1) removed bc.c (r1.1) removed bc.y.dist (r1.1) removed bcdefs.h (r1.1) removed config.h (r1.1) removed const.h (r1.1) removed etest.b (r1.1) removed execute.c (r1.1) removed fact.b (r1.1) removed fix_math.h (r1.1) removed global.c (r1.1) removed global.h (r1.1) removed libmath.b (r1.1) removed load.c (r1.1) removed main.c (r1.1) removed math.h (r1.1) removed number.c (r1.1) removed number.h (r1.1) removed primes.OUT (r1.1) removed primes.b (r1.1) removed proto.h (r1.1) removed sbc.cpp (r1.1) removed sbc.h (r1.1) removed sbc.output (r1.1) removed sbc.y (r1.1) removed scan.c (r1.1) removed scan.l.dist (r1.1) removed sqrt.b (r1.1) removed storage.c (r1.1) removed util.c (r1.1) removed version.h (r1.1) removed y.tab.h (r1.1) removed --- Log message: Remove broken bc install --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Feb 14 13:20:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 13:20:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Makefile.multisrc Message-ID: <200302141919.NAA31057@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource: Makefile.multisrc updated: 1.23 -> 1.24 --- Log message: Remove dead types from raw file to avoid opaque types borking things --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Makefile.multisrc diff -u llvm/test/Programs/MultiSource/Makefile.multisrc:1.23 llvm/test/Programs/MultiSource/Makefile.multisrc:1.24 --- llvm/test/Programs/MultiSource/Makefile.multisrc:1.23 Wed Jan 22 21:52:02 2003 +++ llvm/test/Programs/MultiSource/Makefile.multisrc Fri Feb 14 13:19:19 2003 @@ -47,7 +47,7 @@ # without any libraries linked in... # Output/%.linked.rll: $(LObjects) $(LLINK) $(LOPT) $(LDIS) - $(LLINK) -f $(LObjects) | $(LOPT) -funcresolve | $(LDIS) > $@ + $(LLINK) -f $(LObjects) | $(LOPT) -funcresolve -deadtypeelim | $(LDIS) > $@ endif From lattner at cs.uiuc.edu Fri Feb 14 13:57:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 13:57:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-anagram/ Message-ID: <200302141956.NAA05999@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-anagram: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Programs/MultiSource/Ptrdist-anagram added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Feb 14 13:58:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 13:58:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Ptrdist-anagram/Makefile anagram.c input.OUT input.in words Message-ID: <200302141957.NAA06011@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Ptrdist-anagram: Makefile added (r1.1) anagram.c added (r1.1) input.OUT added (r1.1) input.in added (r1.1) words added (r1.1) --- Log message: initial checkin of ptrdist-anagram --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Feb 14 14:26:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 14:26:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Printer.cpp Message-ID: <200302142025.OAA07222@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Printer.cpp updated: 1.50 -> 1.51 --- Log message: Mark function edges --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/Printer.cpp diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.50 llvm/lib/Analysis/DataStructure/Printer.cpp:1.51 --- llvm/lib/Analysis/DataStructure/Printer.cpp:1.50 Thu Feb 13 14:14:40 2003 +++ llvm/lib/Analysis/DataStructure/Printer.cpp Fri Feb 14 14:25:47 2003 @@ -127,6 +127,8 @@ EdgeSourceCaptions[0] = "r"; if (Call.isDirectCall()) EdgeSourceCaptions[1] = Call.getCalleeFunc()->getName(); + else + EdgeSourceCaptions[1] = "f"; GW.emitSimpleNode(&Call, "shape=record", "call", Call.getNumPtrArgs()+2, &EdgeSourceCaptions); From ashukla at cs.uiuc.edu Fri Feb 14 14:38:01 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:38:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp Message-ID: <200302142037.OAA14325@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: ProfilePaths.cpp updated: 1.24 -> 1.25 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.24 llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.25 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.24 Tue Jan 14 16:33:56 2003 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp Fri Feb 14 14:37:42 2003 @@ -155,6 +155,8 @@ // numPaths is the number of acyclic paths in the graph int numPaths=valueAssignmentToEdges(g, nodePriority, be); + //if(numPaths<=1) return false; + if(numPaths<=1 || numPaths >5000) return false; #ifdef DEBUG_PATH_PROFILES @@ -172,10 +174,17 @@ AllocaInst(Type::IntTy, ConstantUInt::get(Type::UIntTy,1),"R"); - Instruction *countVar=new - AllocaInst(Type::IntTy, - ConstantUInt::get(Type::UIntTy, numPaths), "Count"); - + //Instruction *countVar=new + //AllocaInst(Type::IntTy, + // ConstantUInt::get(Type::UIntTy, numPaths), "Count"); + + //initialize counter array! + std::vector arrayInitialize; + for(int xi=0; xi Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: Graph.cpp updated: 1.8 -> 1.9 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp:1.8 llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp:1.9 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp:1.8 Tue Jan 14 16:33:56 2003 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp Fri Feb 14 14:37:52 2003 @@ -151,7 +151,7 @@ return false; Node *nd2=ed.getSecond(); - nodeList nli = nodes[ed.getFirst()];//getNodeList(ed.getFirst()); + nodeList &nli = nodes[ed.getFirst()];//getNodeList(ed.getFirst()); for(nodeList::iterator NI=nli.begin(), NE=nli.end(); NI!=NE; ++NI) if(*NI->element == *nd2 && ed.getWeight()==NI->weight) @@ -400,7 +400,7 @@ //assign wt(v) to all adjacent vertices v of u //only if v is in vt - Graph::nodeList nl=getNodeList(u); + Graph::nodeList &nl = getNodeList(u); for(nodeList::iterator NI=nl.begin(), NE=nl.end(); NI!=NE; ++NI){ Node *v=NI->element; int weight=-NI->weight; @@ -437,7 +437,7 @@ cerr<<"Graph---------------------\n"; for(vector::iterator LI=lt.begin(), LE=lt.end(); LI!=LE; ++LI){ cerr<<((*LI)->getElement())->getName()<<"->"; - Graph::nodeList nl=getNodeList(*LI); + Graph::nodeList &nl = getNodeList(*LI); for(Graph::nodeList::iterator NI=nl.begin(), NE=nl.end(); NI!=NE; ++NI){ cerr<<":"<<"("<<(NI->element->getElement()) ->getName()<<":"<element->getWeight()<<","<weight<<")"; @@ -483,7 +483,7 @@ vector allNodes=getAllNodes(); for(vector::iterator NI=allNodes.begin(), NE=allNodes.end(); NI!=NE; ++NI) { - nodeList nl=getNodeList(*NI); + nodeList &nl = getNodeList(*NI); for(nodeList::iterator NLI=nl.begin(), NLE=nl.end(); NLI!=NLE; ++NLI){ Edge ed(NLI->element, *NI, NLI->weight); if(!hasEdgeAndWt(ed)){ @@ -502,7 +502,7 @@ vector allNodes=getAllNodes(); for(vector::iterator NI=allNodes.begin(), NE=allNodes.end(); NI!=NE; ++NI) { - nodeList node_list=getNodeList(*NI); + nodeList &node_list = getNodeList(*NI); for(nodeList::iterator NLI=nodes[*NI].begin(), NLE=nodes[*NI].end(); NLI!=NLE; ++NLI) NLI->weight=-NLI->weight; From ashukla at cs.uiuc.edu Fri Feb 14 14:39:03 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:39:03 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp Message-ID: <200302142038.OAA14351@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: GraphAuxillary.cpp updated: 1.14 -> 1.15 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp:1.14 llvm/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp:1.15 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp:1.14 Tue Jan 14 16:33:56 2003 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp Fri Feb 14 14:38:05 2003 @@ -479,7 +479,7 @@ //appropriate locations void processGraph(Graph &g, Instruction *rInst, - Instruction *countInst, + Value *countInst, vector& be, vector& stDummy, vector& exDummy, From ashukla at cs.uiuc.edu Fri Feb 14 14:39:05 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:39:05 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp Message-ID: <200302142038.OAA14360@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: EdgeCode.cpp updated: 1.18 -> 1.19 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.18 llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.19 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.18 Tue Jan 14 16:33:56 2003 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp Fri Feb 14 14:38:10 2003 @@ -25,7 +25,7 @@ static void getTriggerCode(Module *M, BasicBlock *BB, int MethNo, Value *pathNo, - Value *cnt){ + Value *cnt, Instruction *rInst){ vector args; //args.push_back(PointerType::get(Type::SByteTy)); @@ -33,8 +33,15 @@ args.push_back(Type::IntTy); //args.push_back(Type::IntTy); args.push_back(PointerType::get(Type::IntTy)); + args.push_back(PointerType::get(Type::IntTy)); const FunctionType *MTy = FunctionType::get(Type::VoidTy, args, false); + vector tmpVec; + tmpVec.push_back(Constant::getNullValue(Type::LongTy)); + tmpVec.push_back(Constant::getNullValue(Type::LongTy)); + Instruction *Idx = new GetElementPtrInst(cnt, tmpVec, "");//, + BB->getInstList().push_back(Idx); + Function *trigMeth = M->getOrInsertFunction("trigger", MTy); assert(trigMeth && "trigger method could not be inserted!"); @@ -42,7 +49,8 @@ trargs.push_back(ConstantSInt::get(Type::IntTy,MethNo)); trargs.push_back(pathNo); - trargs.push_back(cnt); + trargs.push_back(Idx); + trargs.push_back(rInst); Instruction *callInst=new CallInst(trigMeth, trargs, "");//, BB->begin()); BB->getInstList().push_back(callInst); @@ -52,7 +60,7 @@ //get the code to be inserted on the edge //This is determined from cond (1-6) -void getEdgeCode::getCode(Instruction *rInst, Instruction *countInst, +void getEdgeCode::getCode(Instruction *rInst, Value *countInst, Function *M, BasicBlock *BB, vector &retVec){ @@ -105,9 +113,14 @@ //count[inc]++ case 4:{ - Instruction *Idx = new GetElementPtrInst(countInst, - vector(1,ConstantSInt::get(Type::LongTy, inc)), - "");//, InsertPos); + vector tmpVec; + tmpVec.push_back(Constant::getNullValue(Type::LongTy)); + tmpVec.push_back(ConstantSInt::get(Type::LongTy, inc)); + Instruction *Idx = new GetElementPtrInst(countInst, tmpVec, "");//, + + //Instruction *Idx = new GetElementPtrInst(countInst, + // vector(1,ConstantSInt::get(Type::LongTy, inc)), + // "");//, InsertPos); BB->getInstList().push_back(Idx); Instruction *ldInst=new LoadInst(Idx, "ti1");//, InsertPos); @@ -156,8 +169,10 @@ Type::LongTy,"ctin");//, InsertPos); BB->getInstList().push_back(castInst); - Instruction *Idx = new GetElementPtrInst(countInst, - vector(1,castInst), "");//, + vector tmpVec; + tmpVec.push_back(Constant::getNullValue(Type::LongTy)); + tmpVec.push_back(castInst); + Instruction *Idx = new GetElementPtrInst(countInst, tmpVec, "");//, // InsertPos); BB->getInstList().push_back(Idx); @@ -166,6 +181,7 @@ Value *cons=ConstantSInt::get(Type::IntTy,1); //count[addIndex]++ + //std::cerr<<"Type ldInst:"<getType()<<"\t cons:"<getType()<<"\n"; Instruction *newCount = BinaryOperator::create(Instruction::Add, ldInst, cons,""); BB->getInstList().push_back(newCount); @@ -194,8 +210,14 @@ Instruction *castInst2=new CastInst(ldIndex, Type::LongTy,"ctin"); BB->getInstList().push_back(castInst2); - Instruction *Idx = new GetElementPtrInst(countInst, - vector(1,castInst2), ""); + vector tmpVec; + tmpVec.push_back(Constant::getNullValue(Type::LongTy)); + tmpVec.push_back(castInst2); + Instruction *Idx = new GetElementPtrInst(countInst, tmpVec, "");//, + + //Instruction *Idx = new GetElementPtrInst(countInst, + // vector(1,castInst2), ""); + BB->getInstList().push_back(Idx); Instruction *ldInst=new LoadInst(Idx, "ti2");//, InsertPos); @@ -233,17 +255,16 @@ //the number of executions of path k void insertInTopBB(BasicBlock *front, int k, - Instruction *rVar, - Instruction *countVar, Value *threshold){ + Instruction *rVar, Value *threshold){ //rVar is variable r, - //countVar is array Count, and these are allocatted outside + //countVar is count[] Value *Int0 = ConstantInt::get(Type::IntTy, 0); //now push all instructions in front of the BB BasicBlock::iterator here=front->begin(); front->getInstList().insert(here, rVar); - front->getInstList().insert(here,countVar); + //front->getInstList().insert(here,countVar); //Initialize Count[...] with 0 @@ -258,19 +279,19 @@ new StoreInst(Int0, rVar, here); //insert initialize function for initializing - vector inCountArgs; - inCountArgs.push_back(PointerType::get(Type::IntTy)); - inCountArgs.push_back(Type::IntTy); - - const FunctionType *cFty = FunctionType::get(Type::VoidTy, inCountArgs, - false); - Function *inCountMth = front->getParent()->getParent()->getOrInsertFunction("llvmInitializeCounter", cFty); - assert(inCountMth && "Initialize method could not be inserted!"); - - vector iniArgs; - iniArgs.push_back(countVar); - iniArgs.push_back(ConstantSInt::get(Type::IntTy, k)); - new CallInst(inCountMth, iniArgs, "", here); + //vector inCountArgs; + //inCountArgs.push_back(PointerType::get(Type::IntTy)); + //inCountArgs.push_back(Type::IntTy); + + //const FunctionType *cFty = FunctionType::get(Type::VoidTy, inCountArgs, + // false); +//Function *inCountMth = front->getParent()->getParent()->getOrInsertFunction("llvmInitializeCounter", cFty); +//assert(inCountMth && "Initialize method could not be inserted!"); + +//vector iniArgs; +//iniArgs.push_back(countVar); +//iniArgs.push_back(ConstantSInt::get(Type::IntTy, k)); +//new CallInst(inCountMth, iniArgs, "", here); if(front->getParent()->getName() == "main"){ @@ -296,7 +317,7 @@ void insertBB(Edge ed, getEdgeCode *edgeCode, Instruction *rInst, - Instruction *countInst, + Value *countInst, int numPaths, int Methno, Value *threshold){ BasicBlock* BB1=ed.getFirst()->getElement(); @@ -338,7 +359,7 @@ if(retVec.size()>0){ triggerBB = new BasicBlock("trigger", BB1->getParent()); getTriggerCode(BB1->getParent()->getParent(), triggerBB, Methno, - retVec[1], countInst);//retVec[0]); + retVec[1], countInst, rInst);//retVec[0]); //Instruction *castInst = new CastInst(retVec[0], Type::IntTy, ""); Instruction *etr = new LoadInst(threshold, "threshold"); From ashukla at cs.uiuc.edu Fri Feb 14 14:42:01 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:42:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h Message-ID: <200302142041.OAA14392@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: Graph.h updated: 1.7 -> 1.8 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h:1.7 llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h:1.8 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h:1.7 Mon Feb 10 09:55:50 2003 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/Graph.h Fri Feb 14 14:41:04 2003 @@ -33,7 +33,6 @@ inline bool operator==(Node& nd) const { return element==nd.element; } }; - //Class Edge //Denotes an edge in the graph class Edge{ @@ -410,7 +409,7 @@ //get the code to be inserted on the edge //This is determined from cond (1-6) - void getCode(Instruction *a, Instruction *b, Function *M, BasicBlock *BB, + void getCode(Instruction *a, Value *b, Function *M, BasicBlock *BB, std::vector &retVec); }; @@ -423,7 +422,7 @@ //Do graph processing: to determine minimal edge increments, //appropriate code insertions etc and insert the code at //appropriate locations -void processGraph(Graph &g, Instruction *rInst, Instruction *countInst, std::vector &be, std::vector &stDummy, std::vector &exDummy, int n, int MethNo, Value *threshold); +void processGraph(Graph &g, Instruction *rInst, Value *countInst, std::vector &be, std::vector &stDummy, std::vector &exDummy, int n, int MethNo, Value *threshold); //print the graph (for debugging) void printGraph(Graph &g); @@ -432,7 +431,7 @@ //void printGraph(const Graph g); //insert a basic block with appropriate code //along a given edge -void insertBB(Edge ed, getEdgeCode *edgeCode, Instruction *rInst, Instruction *countInst, int n, int Methno, Value *threshold); +void insertBB(Edge ed, getEdgeCode *edgeCode, Instruction *rInst, Value *countInst, int n, int Methno, Value *threshold); //Insert the initialization code in the top BB //this includes initializing r, and count @@ -442,7 +441,7 @@ //number of that path //Count is an array, where Count[k] represents //the number of executions of path k -void insertInTopBB(BasicBlock *front, int k, Instruction *rVar, Instruction *countVar, Value *threshold); +void insertInTopBB(BasicBlock *front, int k, Instruction *rVar, Value *threshold); //Add dummy edges corresponding to the back edges //If a->b is a backedge From ashukla at cs.uiuc.edu Fri Feb 14 14:43:02 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:43:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp Message-ID: <200302142042.OAA14409@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: RetracePath.cpp updated: 1.2 -> 1.3 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp:1.2 llvm/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp:1.3 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp:1.2 Tue Jan 14 16:33:56 2003 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp Fri Feb 14 14:41:53 2003 @@ -16,12 +16,14 @@ //Routines to get the path trace! -void getPathFrmNode(Node *n, vector &vBB, int pathNo, Graph g, +void getPathFrmNode(Node *n, vector &vBB, int pathNo, Graph &g, vector &stDummy, vector &exDummy, vector &be, double strand){ - Graph::nodeList nlist=g.getNodeList(n); + Graph::nodeList &nlist = g.getNodeList(n); + //printGraph(g); + //std::cerr<<"Path No: "<weight>maxCount && NLI->weight<=pathNo){ maxCount=NLI->weight; @@ -116,7 +118,8 @@ return NULL; } -void getBBtrace(vector &vBB, int pathNo, Function *M){ +void getBBtrace(vector &vBB, int pathNo, Function *M){//, + // vector &instToErase){ //step 1: create graph //Transform the cfg s.t. we have just one exit node @@ -124,8 +127,14 @@ std::vector edges; Node *tmp; Node *exitNode=0, *startNode=0; - static std::map graphMap; + + //Creat cfg just once for each function! + static std::map graphMap; + + //get backedges, exit and start edges for the graphs and store them static std::map > stMap, exMap, beMap; + static std::map pathReg; //path register + if(!graphMap[M]){ BasicBlock *ExitNode = 0; @@ -142,17 +151,39 @@ //The nodes must be uniquely identified: //That is, no two nodes must hav same BB* + //keep a map for trigger basicblocks! + std::map triggerBBs; //First enter just nodes: later enter edges for(Function::iterator BB = M->begin(), BE=M->end(); BB != BE; ++BB){ - if(BB->size()==2){ - const Instruction *inst = BB->getInstList().begin(); - if(isa(inst)){ - Instruction *ii1 = BB->getInstList().begin(); - CallInst *callInst = dyn_cast(ii1); - if(callInst->getCalledFunction()->getName()=="trigger") - continue; + bool cont = false; + + if(BB->size()==3 || BB->size() ==2){ + for(BasicBlock::iterator II = BB->begin(), IE = BB->end(); + II != IE; ++II){ + if(CallInst *callInst = dyn_cast(&*II)){ + //std::cerr<<*callInst; + Function *calledFunction = callInst->getCalledFunction(); + if(calledFunction && calledFunction->getName() == "trigger"){ + triggerBBs[BB] = 9; + cont = true; + //std::cerr<<"Found trigger!\n"; + break; + } + } } } + + if(cont) + continue; + + // const Instruction *inst = BB->getInstList().begin(); + // if(isa(inst)){ + // Instruction *ii1 = BB->getInstList().begin(); + // CallInst *callInst = dyn_cast(ii1); + // if(callInst->getCalledFunction()->getName()=="trigger") + // continue; + // } + Node *nd=new Node(BB); nodes.push_back(nd); if(&*BB==ExitNode) @@ -164,32 +195,55 @@ assert(exitNode!=0 && startNode!=0 && "Start or exit not found!"); for (Function::iterator BB = M->begin(), BE=M->end(); BB != BE; ++BB){ - if(BB->size()==2){ - const Instruction *inst = BB->getInstList().begin(); - if(isa(inst)){ - Instruction *ii1 = BB->getInstList().begin(); - CallInst *callInst = dyn_cast(ii1); - if(callInst->getCalledFunction()->getName()=="trigger") - continue; - } - } - + if(triggerBBs[BB] == 9) + continue; + + //if(BB->size()==3) + //if(CallInst *callInst = dyn_cast(&*BB->getInstList().begin())) + //if(callInst->getCalledFunction()->getName() == "trigger") + //continue; + + // if(BB->size()==2){ + // const Instruction *inst = BB->getInstList().begin(); + // if(isa(inst)){ + // Instruction *ii1 = BB->getInstList().begin(); + // CallInst *callInst = dyn_cast(ii1); + // if(callInst->getCalledFunction()->getName()=="trigger") + // continue; + // } + // } + Node *nd=findBB(nodes, BB); assert(nd && "No node for this edge!"); - + for(BasicBlock::succ_iterator s=succ_begin(&*BB), se=succ_end(&*BB); s!=se; ++s){ - if((*s)->size()==2){ - const Instruction *inst = (*s)->getInstList().begin(); - if(isa(inst)){ - Instruction *ii1 = (*s)->getInstList().begin(); - CallInst *callInst = dyn_cast(ii1); - if(callInst->getCalledFunction()->getName()=="trigger") - continue; - } + + if(triggerBBs[*s] == 9){ + //if(!pathReg[M]){ //Get the path register for this! + //if(BB->size()>8) + // if(LoadInst *ldInst = dyn_cast(&*BB->getInstList().begin())) + // pathReg[M] = ldInst->getPointerOperand(); + //} + continue; } - - Node *nd2=findBB(nodes,*s); + //if((*s)->size()==3) + //if(CallInst *callInst = + // dyn_cast(&*(*s)->getInstList().begin())) + // if(callInst->getCalledFunction()->getName() == "trigger") + // continue; + + // if((*s)->size()==2){ + // const Instruction *inst = (*s)->getInstList().begin(); + // if(isa(inst)){ + // Instruction *ii1 = (*s)->getInstList().begin(); + // CallInst *callInst = dyn_cast(ii1); + // if(callInst->getCalledFunction()->getName()=="trigger") + // continue; + // } + // } + + Node *nd2 = findBB(nodes,*s); assert(nd2 && "No node for this edge!"); Edge ed(nd,nd2,0); edges.push_back(ed); @@ -201,23 +255,45 @@ Graph *g = graphMap[M]; if (M->size() <= 1) return; //uninstrumented - + //step 2: getBackEdges //vector be; std::map nodePriority; g->getBackEdges(beMap[M], nodePriority); - + //step 3: add dummy edges //vector stDummy; //vector exDummy; addDummyEdges(stMap[M], exMap[M], *g, beMap[M]); - + //step 4: value assgn to edges int numPaths = valueAssignmentToEdges(*g, nodePriority, beMap[M]); } - + + //step 5: now travel from root, select max(edge) < pathNo, //and go on until reach the exit - return getPathFrmNode(graphMap[M]->getRoot(), vBB, pathNo, *graphMap[M], - stMap[M], exMap[M], beMap[M], -1); + getPathFrmNode(graphMap[M]->getRoot(), vBB, pathNo, *graphMap[M], + stMap[M], exMap[M], beMap[M], -1); + + + //post process vBB to locate instructions to be erased + /* + if(pathReg[M]){ + for(vector::iterator VBI = vBB.begin(), VBE = vBB.end(); + VBI != VBE; ++VBI){ + for(BasicBlock::iterator BBI = (*VBI)->begin(), BBE = (*VBI)->end(); + BBI != BBE; ++BBI){ + if(LoadInst *ldInst = dyn_cast(&*BBI)){ + if(pathReg[M] == ldInst->getPointerOperand()) + instToErase.push_back(ldInst); + } + else if(StoreInst *stInst = dyn_cast(&*BBI)){ + if(pathReg[M] == stInst->getPointerOperand()) + instToErase.push_back(stInst); + } + } + } + } + */ } From ashukla at cs.uiuc.edu Fri Feb 14 14:44:01 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:44:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Reoptimizer/GetTraceTime.h Message-ID: <200302142043.OAA14426@morpheus.cs.uiuc.edu> Changes in directory llvm/include/llvm/Reoptimizer: GetTraceTime.h updated: 1.1 -> 1.2 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/include/llvm/Reoptimizer/GetTraceTime.h diff -u llvm/include/llvm/Reoptimizer/GetTraceTime.h:1.1 llvm/include/llvm/Reoptimizer/GetTraceTime.h:1.2 --- llvm/include/llvm/Reoptimizer/GetTraceTime.h:1.1 Tue Oct 8 11:30:57 2002 +++ llvm/include/llvm/Reoptimizer/GetTraceTime.h Fri Feb 14 14:42:59 2003 @@ -2,22 +2,31 @@ // // Gets the time taken inside trace execution // This time is printed in the file "llvm_last_run" -// all the entries in this file need to be sumed to get the total time +// all the entries in this file need to be summed to get the total time // spent inside traces. // //===----------------------------------------------------------------------===// #ifndef LLVM_REOPTIMIZER_TRACECACHE_GETTRACETIME_H #define LLVM_REOPTIMIZER_TRACECACHE_GETTRACETIME_H +#include - -#define GET_TRACE_TIME +//#define GET_TRACE_TIME +//#define MAP_TIME +//#define READER_TIME +//#define GET_TRIGGER_TIME +//#define BBTRACE_TIME #ifdef GET_TRACE_TIME - extern "C" void llvm_time_start(); extern "C" void llvm_time_end(); +#endif + +#ifdef GET_TRIGGER_TIME +void llvm_trigger_time_start(); +void llvm_trigger_time_end(); #endif + #endif From ashukla at cs.uiuc.edu Fri Feb 14 14:44:03 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:44:03 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Reoptimizer/InstrUtils.h Message-ID: <200302142043.OAA14442@morpheus.cs.uiuc.edu> Changes in directory llvm/include/llvm/Reoptimizer: InstrUtils.h updated: 1.3 -> 1.4 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/include/llvm/Reoptimizer/InstrUtils.h diff -u llvm/include/llvm/Reoptimizer/InstrUtils.h:1.3 llvm/include/llvm/Reoptimizer/InstrUtils.h:1.4 --- llvm/include/llvm/Reoptimizer/InstrUtils.h:1.3 Sat Sep 21 00:05:32 2002 +++ llvm/include/llvm/Reoptimizer/InstrUtils.h Fri Feb 14 14:43:18 2003 @@ -10,6 +10,8 @@ #include "Support/DataTypes.h" #include +#define NOP 0x01000000 + uint64_t getBranchTarget(unsigned int y, uint64_t oldAdd); unsigned int getBranchInst(unsigned int a, uint64_t to, uint64_t pc); From ashukla at cs.uiuc.edu Fri Feb 14 14:44:05 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:44:05 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Reoptimizer/TraceCache.h Message-ID: <200302142043.OAA14454@morpheus.cs.uiuc.edu> Changes in directory llvm/include/llvm/Reoptimizer: TraceCache.h updated: 1.5 -> 1.6 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/include/llvm/Reoptimizer/TraceCache.h diff -u llvm/include/llvm/Reoptimizer/TraceCache.h:1.5 llvm/include/llvm/Reoptimizer/TraceCache.h:1.6 --- llvm/include/llvm/Reoptimizer/TraceCache.h:1.5 Tue Oct 8 11:31:15 2002 +++ llvm/include/llvm/Reoptimizer/TraceCache.h Fri Feb 14 14:43:26 2003 @@ -58,7 +58,17 @@ bool hasMaxSize(){ return isLimitSet;} bool hasTraceAddr(uint64_t n){ return (traces.find(n)!=traces.end()); } bool hasTraceId(int n) { return (traceId.find(n)!=traceId.end()); } + + bool hasTraceInstructions(uint64_t addr); + std::vector &getTraceInstructions(uint64_t addr); + uint64_t getOriginalAddress(uint64_t n){ + assert(reverseMap.find(n) != reverseMap.end()); + return reverseMap[n]; + } + + unsigned int getAddr(uint64_t addr); + //constructors TraceCache(int limitSize); TraceCache(); @@ -76,6 +86,19 @@ int traceUniqId, std::map &callMap, std::map &branchMap); + + bool addTrace(uint64_t instAddr, + std::vector &trace, + int traceUniqId, + std::map &callMap, + std::map &branchMap); + + bool addTrace(uint64_t instAddr, + std::vector &trace, + int traceUniqId, + std::map &callMap, + std::map &branchMap, + std::vector *exitStubs); //bool addTrace(uint64_t instAddr, unsigned int trace[], int sz, // std::vector &inBranches, From ashukla at cs.uiuc.edu Fri Feb 14 14:44:08 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:44:08 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Reoptimizer/VirtualMem.h Message-ID: <200302142043.OAA14465@morpheus.cs.uiuc.edu> Changes in directory llvm/include/llvm/Reoptimizer: VirtualMem.h updated: 1.5 -> 1.6 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/include/llvm/Reoptimizer/VirtualMem.h diff -u llvm/include/llvm/Reoptimizer/VirtualMem.h:1.5 llvm/include/llvm/Reoptimizer/VirtualMem.h:1.6 --- llvm/include/llvm/Reoptimizer/VirtualMem.h:1.5 Mon Oct 21 08:27:27 2002 +++ llvm/include/llvm/Reoptimizer/VirtualMem.h Fri Feb 14 14:43:33 2003 @@ -19,6 +19,9 @@ #include "llvm/Reoptimizer/GetTraceTime.h" +class TraceCache; +class TraceCache2; + class VirtualMem { int fp; //file pointer @@ -33,6 +36,10 @@ uint64_t getBranchTarget(const std::pair &n); unsigned int readInstrFrmVm(uint64_t frm); + unsigned int readInstrFrmVm(uint64_t frm, TraceCache *tr); + unsigned int readInstrFrmVm(uint64_t frm, TraceCache2 *tr); + unsigned int readInstrFrmVm(uint64_t frm, TraceCache *tr, TraceCache2 *tr2); + void writeInstToVM(uint64_t dest, unsigned newInstr); void writeBranchInstruction(uint64_t location, uint64_t target); @@ -42,6 +49,7 @@ #endif void setBranches(std::map &branchMap, uint64_t startAddr); + void setBranches(std::map &branchMap, uint64_t startAddr); void setCalls(std::map &callMap, uint64_t startAddr); From ashukla at cs.uiuc.edu Fri Feb 14 14:46:02 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:46:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp Message-ID: <200302142045.OAA14496@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/TraceCache: TraceCache.cpp updated: 1.8 -> 1.9 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp diff -u llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp:1.8 llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp:1.9 --- llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp:1.8 Tue Oct 8 11:30:13 2002 +++ llvm/lib/Reoptimizer/TraceCache/TraceCache.cpp Fri Feb 14 14:45:35 2003 @@ -142,6 +142,110 @@ return true; } +bool TraceCache::hasTraceInstructions(uint64_t addr){ + return (traceInstructions.find(addr) != traceInstructions.end()); +} + +unsigned int TraceCache::getAddr(uint64_t addr){ + if(hasTraceInstructions(addr)) + return traceInstructions[addr][0]; + else if(hasTraceInstructions(addr-4)) + return traceInstructions[addr-4][1]; +#ifdef GET_TRACE_TIME + else if(hasTraceInstructions(addr-8)) + return traceInstructions[addr-8][2]; + else if(hasTraceInstructions(addr-12)) + return traceInstructions[addr-12][3]; +#endif + return 0; +} + +std::vector &TraceCache::getTraceInstructions(uint64_t addr){ + assert(traceInstructions.find(addr) != traceInstructions.end()); + + return traceInstructions[addr]; +} + +//Do the following: +//1. Insert a jump at location instrAddr with target as new trace +bool TraceCache::addTrace(uint64_t instAddr, + std::vector &trace, + int traceUniqId, + std::map &callMap, + std::map &branchMap){ + + //remove trace if its already there + if(hasTraceAddr(instAddr)) + removeTrace(instAddr); + + int sz = trace.size(); + + while(isLimitSet && currSize+sz>limit){ + if(currSize == 0) + return false; + + //erase first addr from queue + assert(allocationOrder.size()>0 && "No entries in trace!"); + uint64_t addr = allocationOrder.front(); + allocationOrder.pop_front(); + removeTrace(addr); + } + + uint64_t traceStartAddr = mm->getMemory(trace.size()); + + if(traceStartAddr == 0) return false; //could not allocate space! + + //copy trace to the memory + vm->copyToVM(trace, traceStartAddr); + + traces[instAddr] = traceStartAddr; + traceId[traceUniqId] = traceStartAddr; + reverseTraceId[instAddr] = traceUniqId; + traceSize[instAddr] = sz; + reverseMap[traceStartAddr] = instAddr; + currSize += sz; + + //add instAddr to queue + allocationOrder.push_back(instAddr); + + //copy the first few instructions of the trace in the original code + //and write a jump instruction in its place + traceInstructions[instAddr].push_back(vm->readInstrFrmVm(instAddr)); + traceInstructions[instAddr].push_back(vm->readInstrFrmVm(instAddr+4)); + +#ifdef GET_TRACE_TIME + //two more: to accomodate call instruction and get time! + traceInstructions[instAddr].push_back(vm->readInstrFrmVm(instAddr+8)); + traceInstructions[instAddr].push_back(vm->readInstrFrmVm(instAddr+12)); + + //write call instruction! + vm->writeCallLLVMTime(instAddr); + + //Now write branch instruction with target as + //traceStartAddr at the address instAddr + vm->writeBranchInstruction(instAddr+8, traceStartAddr); +#endif + +#ifndef GET_TRACE_TIME + vm->writeBranchInstruction(instAddr, traceStartAddr); +#endif + + //now set correctly all branches + vm->setBranches(branchMap, traceStartAddr); + + //set correctly all calls + vm->setCalls(callMap, traceStartAddr); + + doFlush(traceStartAddr, traceStartAddr+4*sz); + doFlush(instAddr, instAddr+4); + +#ifdef GET_TRACE_TIME + doFlush(instAddr+8, instAddr+12); +#endif + + return true; +} + void TraceCache::removeTrace(uint64_t n){ //if no trace, do nothing if(traces.find(n) == traces.end()) @@ -154,12 +258,10 @@ "Starting instruction not found!"); int removeSize = traceInstructions[n].size(); + for(int i=0; i < removeSize; i++) - vm->writeInstToVM(n+4*i, (traceInstructions[n])[i]); + vm->writeInstToVM(n+4*i, (traceInstructions[n])[i]); - //vm->writeInstToVM(n, tracesFirstInstruction[n].first); - //vm->writeInstToVM(n+4, tracesFirstInstruction[n].second); - doFlush(n, n+4*(removeSize-1)); //remove n from queue @@ -183,6 +285,86 @@ } +bool TraceCache::addTrace(uint64_t instAddr, + std::vector &trace, + int traceUniqId, + std::map &callMap, + std::map &branchMap, + std::vector *exitStubs){ + + //remove trace if its already there + if(hasTraceAddr(instAddr)) + removeTrace(instAddr); + + int sz = trace.size(); + + while(isLimitSet && currSize+sz>limit){ + if(currSize == 0) + return false; + + //erase first addr from queue + assert(allocationOrder.size()>0 && "No entries in trace!"); + uint64_t addr = allocationOrder.front(); + allocationOrder.pop_front(); + removeTrace(addr); + } + + uint64_t traceStartAddr = mm->getMemory(trace.size()); + + if(traceStartAddr == 0) return false; //could not allocate space! + + //copy trace to the memory + vm->copyToVM(*exitStubs, traceStartAddr); + vm->copyToVM(trace, traceStartAddr+exitStubs->size()*4); + + traces[instAddr] = traceStartAddr; + traceId[traceUniqId] = traceStartAddr; + reverseTraceId[instAddr] = traceUniqId; + traceSize[instAddr] = sz; + reverseMap[traceStartAddr] = instAddr; + currSize += sz; + uint64_t actualTraceStartAddr = traceStartAddr+4*exitStubs->size(); + + //add instAddr to queue + allocationOrder.push_back(instAddr); + + //copy the first few instructions of the trace in the original code + //and write a jump instruction in its place + traceInstructions[instAddr].push_back(vm->readInstrFrmVm(instAddr)); + traceInstructions[instAddr].push_back(vm->readInstrFrmVm(instAddr+4)); + +#ifdef GET_TRACE_TIME + //two more: to accomodate call instruction and get time! + traceInstructions[instAddr].push_back(vm->readInstrFrmVm(instAddr+8)); + traceInstructions[instAddr].push_back(vm->readInstrFrmVm(instAddr+12)); + + //write call instruction! + vm->writeCallLLVMTime(instAddr); + + //Now write branch instruction with target as + //traceStartAddr at the address instAddr + vm->writeBranchInstruction(instAddr+8, traceStartAddr); +#endif + +#ifndef GET_TRACE_TIME + vm->writeBranchInstruction(instAddr, traceStartAddr); +#endif + + //now set correctly all branches + vm->setBranches(branchMap, actualTraceStartAddr); + + //set correctly all calls + vm->setCalls(callMap, actualTraceStartAddr); + + doFlush(traceStartAddr, traceStartAddr+4*(sz+exitStubs->size())); + doFlush(instAddr, instAddr+4); + +#ifdef GET_TRACE_TIME + doFlush(instAddr+8, instAddr+12); +#endif + + return true; +} From ashukla at cs.uiuc.edu Fri Feb 14 14:46:04 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:46:04 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/TraceCache/VirtualMem.cpp Message-ID: <200302142045.OAA14506@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/TraceCache: VirtualMem.cpp updated: 1.8 -> 1.9 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/lib/Reoptimizer/TraceCache/VirtualMem.cpp diff -u llvm/lib/Reoptimizer/TraceCache/VirtualMem.cpp:1.8 llvm/lib/Reoptimizer/TraceCache/VirtualMem.cpp:1.9 --- llvm/lib/Reoptimizer/TraceCache/VirtualMem.cpp:1.8 Mon Jan 27 17:41:43 2003 +++ llvm/lib/Reoptimizer/TraceCache/VirtualMem.cpp Fri Feb 14 14:45:42 2003 @@ -6,6 +6,9 @@ #include "llvm/Reoptimizer/VirtualMem.h" #include "llvm/Reoptimizer/InstrUtils.h" +#include "llvm/Reoptimizer/TraceCache.h" +#include "llvm/Reoptimizer/TraceCache2.h" +#include "llvm/Reoptimizer/GetTraceTime.h" VirtualMem::VirtualMem(){ //open file pointer @@ -35,6 +38,52 @@ return instr; } +unsigned int VirtualMem::readInstrFrmVm(uint64_t frm, TraceCache *tr){ + unsigned int instr=0; + + instr = tr->getAddr(frm); + if(instr) + return instr; + + lseek(fp, frm, SEEK_SET); + + read(fp, &instr, 4); + return instr; +} + + + +unsigned int VirtualMem::readInstrFrmVm(uint64_t frm, TraceCache2 *tr){ + unsigned int instr=0; + + instr = tr->getAddr(frm); + if(instr) + return instr; + + lseek(fp, frm, SEEK_SET); + + read(fp, &instr, 4); + return instr; +} + + +unsigned int VirtualMem::readInstrFrmVm(uint64_t frm, TraceCache *tr, TraceCache2 *tr2){ + unsigned int instr=0; + + instr = tr->getAddr(frm); + if(instr) + return instr; + + instr = tr2->getAddr(frm); + if(instr) + return instr; + + lseek(fp, frm, SEEK_SET); + + read(fp, &instr, 4); + return instr; +} + void VirtualMem::writeInstToVM(uint64_t dest, unsigned int newInstr){ lseek(fp, dest, SEEK_SET); write(fp, &newInstr, 4); @@ -128,6 +177,26 @@ } } +void VirtualMem::setBranches(std::map &branchMap, + uint64_t startAddr){ + + for(std::map::iterator MI = branchMap.begin(), + ME = branchMap.end(); MI != ME; ++MI){ + + uint64_t frm = startAddr+ 4*MI->first; + uint64_t to = MI->second; + + unsigned int instr = readInstrFrmVm(frm); + + //check if instr is a branch + assert(isBranchInstr(instr) && "Not a jump instruction"); + + unsigned int newInstr = getBranchInst(instr, to , frm); + + writeInstToVM(frm, newInstr); + } +} + void VirtualMem::setCalls(std::map &callMap, uint64_t startAddr){ @@ -141,8 +210,9 @@ //check if instr is a branch assert(isCallInstr(instr) && "Not a jump instruction"); - uint64_t callTarget = getCallTarget(instr, MI->second); - unsigned int newInstr = getCallInstr(callTarget, frm); + //uint64_t callTarget = getCallTarget(instr, MI->second); + // unsigned int newInstr = getCallInstr(callTarget, frm); + unsigned int newInstr = getCallInstr(MI->second, frm); writeInstToVM(frm, newInstr); //std::cerr<<"New instruction:"<<(void *)newInstr<<"\n"; } From ashukla at cs.uiuc.edu Fri Feb 14 14:47:01 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:47:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp Message-ID: <200302142046.OAA14519@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/TraceCache: MemoryManager.cpp updated: 1.2 -> 1.3 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp diff -u llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp:1.2 llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp:1.3 --- llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp:1.2 Mon Jan 27 17:41:43 2003 +++ llvm/lib/Reoptimizer/TraceCache/MemoryManager.cpp Fri Feb 14 14:45:53 2003 @@ -32,9 +32,9 @@ int dummyFunction(int i); //the function that provides memory! MemoryManager::MemoryManager(){ - memStart = (intptr_t)&dummyFunction; - memEnd = (intptr_t)&dummyFunction+globalMemSize*4; - std::cerr<<"Dummy address :"<<(void *)(intptr_t)memStart<<"\n"; + memStart = (uint64_t)&dummyFunction; + memEnd = (uint64_t)&dummyFunction+globalMemSize*4; + //std::cerr<<"Dummy address :"<<(void *)memStart<<"\n"; freeMemList.push_back(std::make_pair(memStart, memEnd)); } From ashukla at cs.uiuc.edu Fri Feb 14 14:47:04 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:47:04 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp Message-ID: <200302142046.OAA14533@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/TraceCache: InstrUtils.cpp updated: 1.8 -> 1.9 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp diff -u llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.8 llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.9 --- llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.8 Wed Jan 29 15:13:41 2003 +++ llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp Fri Feb 14 14:46:11 2003 @@ -41,12 +41,14 @@ } -bool isNonDepJump(unsigned int y){ - return ((y & 0x01c00000) == 4194304); +bool isNonDepJump(unsigned int y){//int + floating point + return ((y & 0xc1c00000) == 4194304 || (y & 0xc1c00000) == 20971520); + // return ((y & 0x01c00000) == 4194304); } -bool isDepJump(unsigned int y){ - return ((y & 0x01c00000) == 8388608); +bool isDepJump(unsigned int y){ //integer+floatingpoint + return ((y & 0xc1c00000) == 8388608 || (y & 0xc1c00000) == 25165824); + //return ((y & 0x01c00000) == 8388608); } uint64_t getNonDepJmpTarget(unsigned int y, uint64_t oldAdd){ @@ -165,6 +167,8 @@ } void doFlush(uint64_t st_addr, uint64_t end_addr){ + if(st_addr%8 != 0) + st_addr -=4; for(uint64_t i = st_addr; i<=end_addr; i+=8){ asm("flush %0"::"r" (i)); } From ashukla at cs.uiuc.edu Fri Feb 14 14:47:07 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:47:07 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Trigger/Trigger.cpp Message-ID: <200302142046.OAA14547@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Trigger: Trigger.cpp updated: 1.14 -> 1.15 --- Log message: Changes to runtime framework --- Diffs of the changes: Index: llvm/lib/Reoptimizer/Trigger/Trigger.cpp diff -u llvm/lib/Reoptimizer/Trigger/Trigger.cpp:1.14 llvm/lib/Reoptimizer/Trigger/Trigger.cpp:1.15 --- llvm/lib/Reoptimizer/Trigger/Trigger.cpp:1.14 Tue Oct 15 17:14:28 2002 +++ llvm/lib/Reoptimizer/Trigger/Trigger.cpp Fri Feb 14 14:46:29 2003 @@ -16,9 +16,7 @@ #include "llvm/Module.h" #include "llvm/iTerminators.h" #include "llvm/Support/CFG.h" -#include - -#include +#include "TriggerAuxillary.h" #include #include @@ -31,96 +29,18 @@ int reopt_threshold; -#ifdef GET_TRACE_TIME - -static struct timeval llvm_trace_time; -static struct timeval llvm_trigger_time; - -extern "C" void llvm_time_start(){ - gettimeofday(&llvm_trace_time, (void *)0); -} - -extern "C" void llvm_time_end(){ - static std::ofstream f_out("llvm_last_run"); - - struct timeval time_end; - gettimeofday(&time_end, (void *)0); - - long time = (time_end.tv_sec - llvm_trace_time.tv_sec)*1000000 + - (time_end.tv_usec - llvm_trace_time.tv_usec); - - f_out< &funcList){ + Module *M; +#ifdef READER_TIME + cpc_count_usr_events(1); #endif - - -void getBBtrace(vector &vBB, int pathNo, Function *M); - -void getBranchExitCode(vector &instVec, - map &branchMap, - map &targetMap, - map &callMap); - -extern "C" void llvmInitializeCounter(int *cnt, int k){ - for(int i=0; i &vBB, int pn){ - std::cerr<<"Path no:"<::iterator VVI = vBB.begin(), VVE = vBB.end(); - VVI!=VVE; ++VVI) - std::cerr<<*VVI; - std::cerr<<"End of path----\n"; -} - - - - -extern "C" void trigger(int mn, int pn, int *cnt){ - static bool initialized = false; //so module is read just once - static Module *M; - static std::vector funcList; //map of functions - - //std::cerr<<"Meth: "<begin(), ME=M->end(); MI!=ME; MI++){ @@ -133,26 +53,30 @@ mmn++; funcList.push_back(F); } - } + return M; +} - assert(M && "Module unparsed!"); - assert(funcList[mn] && "Function not parsed!"); - - - std::vector vBB; +bool isThrashing(TraceCache *tr, uint64_t startAddr){ + //Keep count of thrashing, so as to avoid it! + static std::map thrashing; + + if(tr->hasTraceAddr(startAddr) && thrashing[startAddr]<4){ + thrashing[startAddr] += 1; + tr->removeTrace(startAddr); + } + else if(thrashing[startAddr] > 3){ + return true; + } + return false; +} - getBBtrace(vBB, pn, funcList[mn]); - - //return;//just measure time to retrace! - if(vBB[0] == &funcList[mn]->front() || +bool isWellFormedLoop(vector &vBB, Function *f){ + if(vBB[0] == &f->front() || isa(vBB[vBB.size()-1]->getTerminator())){ - //std::cerr<<"Found a path starting with root!\n"; -#ifdef GET_TRACE_TIME - llvm_trigger_time_end(); -#endif - return; + //Found a path starting with root + return false; } //check if loop is not formed @@ -161,45 +85,112 @@ if(Bcheck->isConditional()){ if((vBB[0] != Bcheck->getSuccessor(0)) && (vBB[0] != Bcheck->getSuccessor(1))){ - std::cerr<<"llvm:: Not a loop!\n"; -#ifdef GET_TRACE_TIME - llvm_trigger_time_end(); -#endif - return; + //std::cerr<<"llvm:: Not a loop!\n"; + return false; } } else{ if(vBB[0] != Bcheck->getSuccessor(0)){ - std::cerr<<"llvm:: Not a loop!\n"; -#ifdef GET_TRACE_TIME - llvm_trigger_time_end(); -#endif - return; + //std::cerr<<"llvm:: Not a loop!\n"; + return false; } } - + return true; +} + +extern "C" void trigger(int mn, int pn, int *cnt, int *reg){ + static bool initialized = false; //so module is read just once + static std::vector funcList; //map of functions + static Module *M; + static VirtualMem *vm = new VirtualMem(); static TraceCache *tr = new TraceCache(); - std::pair firtBBLimits = getBasicBlockInfo(*(vBB.begin())); +#ifdef GET_TRIGGER_TIME + llvm_trigger_time_start(); +#endif + + if(!initialized){ + M = initModules(funcList); + initialized = true; + } + + assert(M && "Module unparsed!"); + + assert(funcList[mn] && "Function not parsed!"); + + + ///Do analysis over module + vector instToRemv; + + findAllRegs(funcList[mn], instToRemv); + + std::map addrToRm; + //addrToRm[0x000000] = 1; + + for(std::vector::iterator IRI = instToRemv.begin(), IRE = + instToRemv.end(); IRI != IRE; ++IRI){ + std::vector vaddr = getLLVMInstrInfo(*IRI); + for(std::vector::iterator VRR = vaddr.begin(), VRRE = vaddr.end(); + VRR != VRRE; ++VRR){ + if(!isBranchInstr(vm->readInstrFrmVm(*VRR, tr))) + addrToRm[*VRR] = 3; + } + } + + std::vector vBB; //trace of BBs + // std::vector instToErase; + + +#ifdef BBTRACE_TIME + cpc_count_usr_events(1); +#endif + getBBtrace(vBB, pn, funcList[mn]);//, instToErase); +#ifdef BBTRACE_TIME + cpc_count_usr_events(0); +#endif + + + if(!isWellFormedLoop(vBB, funcList[mn])){ + cnt[pn] = -99999999; +#ifdef GET_TRIGGER_TIME + llvm_trigger_time_end(); +#endif + return; + } + +#ifdef MAP_TIME + cpc_count_usr_events(1); +#endif + std::pair firtBBLimits = + getBasicBlockInfo(*(vBB.begin())); +#ifdef MAP_TIME + cpc_count_usr_events(0); +#endif uint64_t startAddr = firtBBLimits.first; assert(startAddr && "startAddr should have been defined!"); //return if SAME trace already there! if(tr->hasTraceAddr(startAddr) && tr->hasTraceId(pn)){ - std::cerr<<"Trace exists!!!\n"; -#ifdef GET_TRACE_TIME + //std::cerr<<"Trace exists!!!\n"; +#ifdef GET_TRIGGER_TIME llvm_trigger_time_end(); #endif + cnt[pn] = -9999999; return; } - if(tr->hasTraceAddr(startAddr)){ - std::cerr<<"llvm:: Removing old trace!\n"; - tr->removeTrace(startAddr); + + if(isThrashing(tr, startAddr)){ +#ifdef GET_TRIGGER_TIME + llvm_trigger_time_end(); +#endif + cnt[pn] = -9999999; + return; } - + + //the trace of instructions vector trace; @@ -216,259 +207,214 @@ //Now iterate ove trace of BBs, and insert them into the cache + + int branchIndex = 0; + map *> exitStubs; + vector *stubVec = new vector(); for(vector::iterator VBI = vBB.begin(), VBE = vBB.end(); VBI!=VBE; ++VBI){ //Take the first instr of the basic block, and insert //all instructions uptil the end of basic block in the trace +#ifdef MAP_TIME + cpc_count_usr_events(1); +#endif std::pair bbInst = getBasicBlockInfo(*VBI); +#ifdef MAP_TIME + cpc_count_usr_events(0); +#endif - //set various flags - bool isCondBranch = false; - bool hasNextBB = false; - bool hasTrueIndex = false; - - //see if terminator is a conditional branch - TerminatorInst *TI = (*VBI)->getTerminator(); - if(isa(TI)){ - BranchInst *BI = cast(TI); - if(BI->isConditional()){ - isCondBranch = true; - - //see if next BB is in vBB - if(VBI != vBB.end()-1 && BI->getSuccessor(0) == *(VBI+1) ){ - hasNextBB = true; - hasTrueIndex = true; - } - else if(VBI != vBB.end()-1 && BI->getSuccessor(1) == *(VBI+1) ) - hasNextBB = true; - } - else{//is unconditional branch - assert(BI->isUnconditional() && "Ought to be unconditional branch!"); - if(VBI != vBB.end()-1 && BI->getSuccessor(0) == *(VBI+1) ){ - hasNextBB = true; - } - } - } - - if(VBI != vBB.end()-1){//so its NOT last BB - assert(hasNextBB && "Next BB not in sequence!"); - } - - //Now, the last inst corresponding to the BB MAY or MAY NOT be included - //in the returned addresses. So leave last two instructions - //Now if unconditional branch, then read until last 2, - //if unconditional branch - //then read until last 4 - int skipIndex = (isCondBranch ? 4:2); - - std::cerr<<"llvm:: From->to\t"<<(void *)bbInst.first<<"->"<<(void *)(bbInst.second-4*skipIndex)<<"\n"; - - for(uint64_t addr = bbInst.first, endAddr = bbInst.second; - addr<=endAddr-4*skipIndex; addr+=4, instIndex++){ - unsigned inst = vm->readInstrFrmVm(addr); - - trace.push_back(inst); - //handle call instructions later! - if(isCallInstr(inst)){ - callMap[instIndex] = addr; - //std::cerr<<(void *)inst; - //std::cerr<<"\t\tcall is index:"<readInstrFrmVm(bbInst.second-12); - unsigned int br1, ds1, br2, ds2; - uint64_t addrbr1, addrbr2; - if(isBranchInstr(instrCheck)){ - br1 = instrCheck; - addrbr1 = bbInst.second-12; - ds1 = vm->readInstrFrmVm(bbInst.second-8); - br2 = vm->readInstrFrmVm(bbInst.second-4); - addrbr2 = bbInst.second-4; - ds2 = vm->readInstrFrmVm(bbInst.second); - } - else{ - trace.push_back(instrCheck); - - if(isCallInstr(instrCheck)){ - callMap[instIndex] = bbInst.second - 12; - } - - instIndex++; - - br1 = vm->readInstrFrmVm(bbInst.second-8); - addrbr1 = bbInst.second-8; - ds1 = vm->readInstrFrmVm(bbInst.second-4); - br2 = vm->readInstrFrmVm(bbInst.second); - addrbr2 = bbInst.second; - ds2 = vm->readInstrFrmVm(bbInst.second+4); + for(uint64_t addr = bbStart; addr <= bbEnd; addr+=4){ + unsigned instr = vm->readInstrFrmVm(addr, tr); + + if(addrToRm.find(addr) != addrToRm.end()){ + if(!isCallInstr(instr)) + stubVec->push_back(instr); + continue; } - assert(isBranchInstr(br1) && isBranchInstr(br2) && "Not a branch!"); - - if(hasNextBB){ - //eliminate one of the branches! - std::vector::iterator VBNext = VBI+1; - std::pair bbDest = getBasicBlockInfo(*VBNext); - //get branch br1 and br2 targets to check if any matches bbDest - uint64_t tar1, tar2; - - tar1 = getBranchTarget(br1, addrbr1); - tar2 = getBranchTarget(br2, addrbr2); - - assert( (tar1 == bbDest.first || tar2 == bbDest.first) && - "No destination matched for consecutive BBs"); - - if(tar1 == bbDest.first){ - //check that second branch is ba, or bn - assert( (isBranchAlways(br2) || isBranchNever(br2) ) && - "Branch 2 should have been branch always, or branch never!"); - - //so invert branch condition, make it second branch, - //and eliminate first branch! - - //take the target of br2 and inverted condition of br1 - unsigned int invertedBranch = vm->getInvertedBranch(br1); - - //only handling the case when ds2 == nop! - - //insert br2, ds1 in the trace (in that order) - //store branches and PCs for later correction in branchMap - - assert(ds2 == 0x01000000 && - "Can't handle the case when the unconditional branch doesn't have nop in delay slot!"); - - //trace.push_back(ds1); - //instIndex++; - - trace.push_back(invertedBranch); - //branchMap[instIndex] = addrbr2; - targetMap[instIndex] = getBranchTarget(br2, addrbr2); + assert(instr); - trace.push_back(ds1); - instIndex += 2; + bool gotoNextBB = false; + + if(isBranchInstr(instr) && !isBranchNever(instr)){ + if(isBranchAlways(instr)){ + //check that the target of branch is next in trace! + if(VBI != VBE-1){//is not last BB + TerminatorInst *TI = (*VBI)->getTerminator(); + BranchInst *BI = cast(TI); + assert(BI && + getBasicBlockInfo(BI->getSuccessor(0)).first == + getBranchTarget(instr, addr) && "Incorrect trace!"); + //insert delay slot + if(addrToRm.find(addr+4) == addrToRm.end()) + trace.push_back(vm->readInstrFrmVm(addr+4, tr)); + else{ + stubVec->push_back(vm->readInstrFrmVm(addr+4, tr)); + trace.push_back(NOP); + } + + instIndex++; + addr += 4; + } + else{ + //else must be last BB, so just ignore branch and insert a BA to top + TerminatorInst *TI = (*VBI)->getTerminator(); + BranchInst *BI = cast(TI); + assert(BI && + getBasicBlockInfo(BI->getSuccessor(0)).first == startAddr + && "Incorrect trace"); + + //insert a BA going to the top + trace.push_back(getBranchInst(0x10800000, (uint64_t)(&trace[0]), + (uint64_t)(&trace[instIndex]))); + //insert delay slot + if(addrToRm.find(addr+4) == addrToRm.end()) + trace.push_back(vm->readInstrFrmVm(addr+4, tr)); + else{ + stubVec->push_back(vm->readInstrFrmVm(addr+4, tr)); + trace.push_back(NOP); + } + + exitStubs[branchIndex] = stubVec; + branchIndex++; + stubVec = new vector(); + + instIndex += 2; + addr += 4; + } + gotoNextBB = true; } - else{ - //erase second branch - //insert into trace br1, ds1, ds2 - - trace.push_back(br1); - //branchMap[instIndex] = addrbr1; - targetMap[instIndex] = getBranchTarget(br1, addrbr1); - - trace.push_back(ds1); - trace.push_back(ds2); - - instIndex += 3; + else{ //is a conditional branch! + if(VBI != VBE-1){//is not last BB + //check if it points to next BB insequence + //TerminatorInst *TI = (*(VBI+1))->getTerminator(); + //BranchInst *BI = cast(TI); + //assert(BI && "No branch???"); + uint64_t nextBBaddr = getBasicBlockInfo(*(VBI+1)).first; + uint64_t tar = getBranchTarget(instr, addr); + if(tar == nextBBaddr){ + //taken path + //reverse the branch condition, and point it to addr+8 + unsigned int revBr = vm->getInvertedBranch(instr); + targetMap[instIndex] = addr+8; + + trace.push_back(revBr); + if(addrToRm.find(addr+4) == addrToRm.end()) + trace.push_back(vm->readInstrFrmVm(addr+4, tr)); + else{ + stubVec->push_back(vm->readInstrFrmVm(addr+4, tr)); + trace.push_back(NOP); + } + + exitStubs[branchIndex] = stubVec; + branchIndex++; + stubVec = new vector(); + + instIndex += 2; + + addr += 8; + gotoNextBB = true; + } + else{ + //not taken path + //leave the instruction as is, and goto next instruction + targetMap[instIndex] = getBranchTarget(instr, addr); + + trace.push_back(instr); + if(addrToRm.find(addr+4) == addrToRm.end()) + trace.push_back(vm->readInstrFrmVm(addr+4, tr)); + else{ + stubVec->push_back(vm->readInstrFrmVm(addr+4, tr)); + trace.push_back(NOP); + } + + exitStubs[branchIndex] = stubVec; + branchIndex++; + stubVec = new vector(); + + instIndex += 2; + + addr += 8; + } + } + else{ // last BB in seq! + TerminatorInst *TI = (*VBI)->getTerminator(); + BranchInst *BI = cast(TI); + assert(BI && + getBasicBlockInfo(BI->getSuccessor(1)).first == startAddr + && "Incorrect trace"); + + //insert a BA going to the top + trace.push_back(getBranchInst(0x10800000, (uint64_t)(&trace[0]), + (uint64_t)(&trace[instIndex]))); + + + + //exitStubs[branchIndex] = stubVec; + //branchIndex++; + stubVec = new vector(); + + if(addrToRm.find(addr+4) == addrToRm.end()) + trace.push_back(vm->readInstrFrmVm(addr+4, tr)); + else{ + stubVec->push_back(vm->readInstrFrmVm(addr+4, tr)); + trace.push_back(NOP); + } + + vector *tVec = exitStubs[branchIndex-1]; + assert(tVec); + + for(vector::iterator TVI = stubVec->begin(), + TVE = stubVec->end(); TVI != TVE; ++TVI) + tVec->push_back(*TVI); + + instIndex += 2; + + addr += 4; + gotoNextBB = true; + } } } - else{//So it must be last BB in sequence! - - //check that it points to first BB - std::pair bbDest = getBasicBlockInfo(*(vBB.begin())); - - //get branch br1 and br2 targets to check if any matches bbDest - uint64_t tar1, tar2; - - tar1 = getBranchTarget(br1, addrbr1); - tar2 = getBranchTarget(br2, addrbr2); - - assert(tar2 == bbDest.first && "Last BB must point to first BB"); - //remove br1: it ALWAYS goes to target! - - //br1 - // trace.push_back(br1); - //targetMap[instIndex] = getBranchTarget(br1, addrbr1); - //instIndex++; - //br1 --end - - trace.push_back(ds1); - instIndex++; - - //point new branch to the tracehead! - trace.push_back(br2); - unsigned int newBr = getBranchInst(br2, (uint64_t)(&trace[0]), (uint64_t)(&trace[instIndex])); - trace[instIndex] = newBr; - - trace.push_back(ds2); - instIndex += 2; - } - } - //is unconditional branch - else{ - unsigned int instrCheck = vm->readInstrFrmVm(bbInst.second-4); - unsigned int br1, ds1; - uint64_t addrbr1; - if(isBranchInstr(instrCheck)){ - br1 = instrCheck; - addrbr1 = bbInst.second-4; - ds1 = vm->readInstrFrmVm(bbInst.second); - } - else{ - trace.push_back(instrCheck); - - if(isCallInstr(instrCheck)){ - callMap[instIndex] = bbInst.second - 4; - } + + else if(isCallInstr(instr)){ + callMap[instIndex] = getCallTarget(instr, addr); + trace.push_back(instr); instIndex++; - - br1 = vm->readInstrFrmVm(bbInst.second); - addrbr1 = bbInst.second; - ds1 = vm->readInstrFrmVm(bbInst.second+4); } - //std::cerr<<"Branch: "<<(void *)br1<<"\n"; - assert( (isBranchAlways(br1) || isBranchNever(br1) ) && - "Unconditional branch: should be branch always, or branch never!"); - - //now do fancy stuff! - //if branch points to the next BB, then erase it - if(hasNextBB){ - std::pair bbDest = getBasicBlockInfo(*(VBI+1)); - - //get branch br1 target to check if it matches bbDest - uint64_t tar1 = getBranchTarget(br1, addrbr1); - - assert(tar1 == bbDest.first && "The trace is not continuous!"); - - //copy ds1, and tht's all - trace.push_back(ds1); - instIndex++; - } else{ - //Must be last BB. check for coninuity! - std::pair bbDest = - getBasicBlockInfo(*(vBB.begin())); - - uint64_t tar1 = getBranchTarget(br1, addrbr1); - - assert(tar1 == bbDest.first && "Last BB must point to first BB"); - trace.push_back(br1); - //branchMap[instIndex] = addrbr1; - targetMap[instIndex] = getBranchTarget(br1, addrbr1); - trace.push_back(ds1); - - instIndex += 2; + trace.push_back(instr); + instIndex++; } + + if(gotoNextBB) + break; } } //insert exit code! - getBranchExitCode(trace, branchMap, targetMap, callMap); + getBranchExitCode(trace, branchMap, targetMap, callMap, exitStubs); //Now add trace to cache, and we are all set! + vector *vstubs = exitStubs[branchIndex-1]; + /* + if(vstubs){ + if(!tr->addTrace(startAddr, trace, pn, callMap, branchMap, vstubs)) + std::cerr<<" Trace could not be added!!!\n"; + } + else*/ + if(!tr->addTrace(startAddr, trace, pn, callMap, branchMap)) - std::cerr<<"^^^^^^^^^^************** Trace could not be added!!!\n"; + std::cerr<<" Trace could not be added!!!\n"; + -#ifdef GET_TRACE_TIME +#ifdef GET_TRIGGER_TIME llvm_trigger_time_end(); #endif } @@ -477,13 +423,18 @@ void getBranchExitCode(vector &instVec, map &branchMap, map &targetMap, - map &callMap){ + map &callMap, + map *> exitStubs){ //for each branch, insert code! int instIndex = instVec.size(); + int branchIndex = 0; for(map::iterator MI = targetMap.begin(), ME = targetMap.end(); - MI != ME; ++MI){ + MI != ME; ++MI, branchIndex++){ + + assert(exitStubs[branchIndex]); + unsigned int instr = instVec[MI->first]; uint64_t pc = MI->second; @@ -495,13 +446,20 @@ (uint64_t)&instVec[instIndex]); instVec[instIndex] = call_inst; - callMap[instIndex] = (uint64_t)&instVec[instIndex]; + callMap[instIndex] = (uint64_t)&llvm_time_end;//CHANGED! instVec[instIndex]; //end call_inst! #endif + //insert instructions in exit stub + vector *stubVec = exitStubs[branchIndex]; + for(vector::iterator VI = stubVec->begin(), + VE = stubVec->end(); VI != VE; ++VI) + instVec.push_back(*VI); + + //save %io, ad1 unsigned int stx1 = 0xf077a000|0x7f7; //stx %i0, %fp+offset-8 - unsigned int stx2 = 0xf277a000|0x7ef; //stx %i1, offset-16 + unsigned int stx2 = 0xf277a000|0x7ef; //stx %i1, offset-16 //sethi uint64_t target = targetMap[MI->first]; @@ -555,7 +513,7 @@ branchMap.erase(MI->first); branchMap[MI->first] = instIndex; - instIndex += 11; + instIndex += (11 + stubVec->size()); #ifdef GET_TRACE_TIME instIndex++; From ashukla at cs.uiuc.edu Fri Feb 14 14:48:00 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:48:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Trigger/TriggerAuxillary.cpp Message-ID: <200302142047.OAA14567@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Trigger: TriggerAuxillary.cpp added (r1.1) --- Log message: Changes to runtime framework --- Diffs of the changes: From ashukla at cs.uiuc.edu Fri Feb 14 14:48:03 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:48:03 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Trigger/TriggerAuxillary.h Message-ID: <200302142047.OAA14573@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Trigger: TriggerAuxillary.h added (r1.1) --- Log message: Changes to runtime framework --- Diffs of the changes: From ashukla at cs.uiuc.edu Fri Feb 14 14:49:01 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:49:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Trigger/GetTraceTime.cpp Message-ID: <200302142048.OAA14587@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Trigger: GetTraceTime.cpp added (r1.1) --- Log message: Changes to runtime framework --- Diffs of the changes: From ashukla at cs.uiuc.edu Fri Feb 14 14:50:05 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:50:05 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/Ssapre/ Message-ID: <200302142049.OAA14611@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/Ssapre: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/lib/Reoptimizer/Ssapre added to the repository --- Diffs of the changes: From ashukla at cs.uiuc.edu Fri Feb 14 14:59:01 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:59:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/SSAPRE/ Message-ID: <200302142058.OAA14655@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/SSAPRE: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/lib/Reoptimizer/SSAPRE added to the repository --- Diffs of the changes: From ashukla at cs.uiuc.edu Fri Feb 14 14:59:04 2003 From: ashukla at cs.uiuc.edu (Anand Shukla) Date: Fri Feb 14 14:59:04 2003 Subject: [llvm-commits] CVS: llvm/lib/Reoptimizer/SSAPRE/Trigger.cpp Message-ID: <200302142058.OAA14669@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Reoptimizer/SSAPRE: Trigger.cpp added (r1.1) --- Log message: initial vesrion: program to perform SSAPRE --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Feb 14 17:26:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 17:26:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile Message-ID: <200302142325.RAA12407@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile updated: 1.11 -> 1.12 --- Log message: Build the NoSource directory --- Diffs of the changes: Index: llvm/test/Programs/Makefile diff -u llvm/test/Programs/Makefile:1.11 llvm/test/Programs/Makefile:1.12 --- llvm/test/Programs/Makefile:1.11 Tue Feb 11 17:12:38 2003 +++ llvm/test/Programs/Makefile Fri Feb 14 17:25:44 2003 @@ -6,7 +6,7 @@ ##===----------------------------------------------------------------------===## LEVEL = ../.. -PARALLEL_DIRS = SingleSource MultiSource +PARALLEL_DIRS = SingleSource MultiSource NoSource include ${LEVEL}/test/Makefile.tests From lattner at cs.uiuc.edu Fri Feb 14 17:27:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 17:27:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.dummylib Message-ID: <200302142326.RAA12420@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.dummylib updated: 1.1 -> 1.2 --- Log message: Fix linkage --- Diffs of the changes: Index: llvm/test/Programs/Makefile.dummylib diff -u llvm/test/Programs/Makefile.dummylib:1.1 llvm/test/Programs/Makefile.dummylib:1.2 --- llvm/test/Programs/Makefile.dummylib:1.1 Sat Feb 8 14:43:46 2003 +++ llvm/test/Programs/Makefile.dummylib Fri Feb 14 17:26:09 2003 @@ -20,4 +20,4 @@ LINKED_PROGS := $(PROGRAMS_TO_TEST:%=Output/%.lib.bc) $(LINKED_PROGS): Output/%.lib.bc: Output/%.llvm.bc $(DUMMYLIB) - $(LLINK) $< $(DUMMYLIB) | $(LOPT) -internalize -funcresolve -globaldce > $@ + $(LLINK) $< $(DUMMYLIB) | $(LOPT) -funcresolve -internalize -globaldce > $@ From lattner at cs.uiuc.edu Fri Feb 14 17:27:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 17:27:04 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.aa.Makefile Message-ID: <200302142326.RAA12433@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.aa.Makefile updated: 1.1 -> 1.2 --- Log message: MAke things more explicit --- Diffs of the changes: Index: llvm/test/Programs/TEST.aa.Makefile diff -u llvm/test/Programs/TEST.aa.Makefile:1.1 llvm/test/Programs/TEST.aa.Makefile:1.2 --- llvm/test/Programs/TEST.aa.Makefile:1.1 Wed Feb 12 13:34:23 2003 +++ llvm/test/Programs/TEST.aa.Makefile Fri Feb 14 17:26:35 2003 @@ -18,12 +18,15 @@ SUFFIX = -aa-eval -time-passes -no-output -no-verify < $< 2> $@ +$(PROGRAMS_TO_TEST:%=Output/%.aa.basic.txt): \ Output/%.aa.basic.txt: Output/%.lib.bc $(LOPT) -$(LOPT) -basicaa $(SUFFIX) +$(PROGRAMS_TO_TEST:%=Output/%.aa.steens-fi.txt): \ Output/%.aa.steens-fi.txt: Output/%.lib.bc $(LOPT) -$(LOPT) -steens-aa -disable-ds-field-sensitivity $(SUFFIX) +$(PROGRAMS_TO_TEST:%=Output/%.aa.steens.txt): \ Output/%.aa.steens.txt: Output/%.lib.bc $(LOPT) -$(LOPT) -steens-aa $(SUFFIX) @@ -31,9 +34,11 @@ Output/%.aa.andersens.txt: Output/%.lib.bc $(LOPT) $(AND_LIB) -$(LOPT) -load $(AND_LIB) -andersens-aa $(SUFFIX) +$(PROGRAMS_TO_TEST:%=Output/%.aa.ds-fi.txt): \ Output/%.aa.ds-fi.txt: Output/%.lib.bc $(LOPT) -$(LOPT) -ds-aa -disable-ds-field-sensitivity $(SUFFIX) +$(PROGRAMS_TO_TEST:%=Output/%.aa.ds.txt): \ Output/%.aa.ds.txt: Output/%.lib.bc $(LOPT) -$(LOPT) -ds-aa $(SUFFIX) @@ -43,7 +48,7 @@ # Overall tests: just run subordinate tests $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \ Output/%.$(TEST).report.txt: $(addprefix Output/%.aa., $(AA_OUTPUTS)) - @echo > $@ + -$(LDIS) < Output/$*.lib.bc | grep ^declare > $@ @-for output in $(addprefix Output/$*.aa., $(AA_OUTPUTS)); do \ echo -n "$$output:" >> $@; \ grep Summary $$output >> $@; \ From lattner at cs.uiuc.edu Fri Feb 14 17:28:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 17:28:04 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp Message-ID: <200302142327.RAA12449@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.95 -> 1.96 --- Log message: Fix resolution of indirect function calls... whoops --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.95 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.96 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.95 Fri Feb 14 00:28:00 2003 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Fri Feb 14 17:27:18 2003 @@ -799,7 +799,7 @@ // Mark all global nodes as incomplete... if ((Flags & DSGraph::IgnoreGlobals) == 0) for (unsigned i = 0, e = Nodes.size(); i != e; ++i) - if (Nodes[i]->NodeType & DSNode::GlobalNode) + if (Nodes[i]->NodeType & DSNode::GlobalNode && Nodes[i]->getNumLinks()) markIncompleteNode(Nodes[i]); } From lattner at cs.uiuc.edu Fri Feb 14 18:30:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 18:30:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Ptrdist-anagram/Makefile anagram.c input.OUT input.in words Message-ID: <200302150029.SAA15678@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Ptrdist-anagram: Makefile (r1.1) removed anagram.c (r1.1) removed input.OUT (r1.1) removed input.in (r1.1) removed words (r1.1) removed --- Log message: Move to multisource directory --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Feb 14 18:31:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 18:31:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/dry.c fldry.c Message-ID: <200302150030.SAA15702@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource: dry.c added (r1.1) fldry.c added (r1.1) --- Log message: Add dhrystone tests --- Diffs of the changes: From lattner at cs.uiuc.edu Fri Feb 14 18:31:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 18:31:04 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Makefile.multisrc Message-ID: <200302150030.SAA15720@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource: Makefile.multisrc updated: 1.24 -> 1.25 --- Log message: Add LOC accounting ability --- Diffs of the changes: Index: llvm/test/Programs/MultiSource/Makefile.multisrc diff -u llvm/test/Programs/MultiSource/Makefile.multisrc:1.24 llvm/test/Programs/MultiSource/Makefile.multisrc:1.25 --- llvm/test/Programs/MultiSource/Makefile.multisrc:1.24 Fri Feb 14 13:19:19 2003 +++ llvm/test/Programs/MultiSource/Makefile.multisrc Fri Feb 14 18:30:42 2003 @@ -49,6 +49,9 @@ Output/%.linked.rll: $(LObjects) $(LLINK) $(LOPT) $(LDIS) $(LLINK) -f $(LObjects) | $(LOPT) -funcresolve -deadtypeelim | $(LDIS) > $@ +Output/%.LOC.txt: $(Source) + cat $(Source) $(wildcard *.h) | wc -l > $@ + endif Output/%.native: $(NObjects) From lattner at cs.uiuc.edu Fri Feb 14 18:31:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 18:31:07 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Makefile.singlesrc Message-ID: <200302150030.SAA15727@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource: Makefile.singlesrc updated: 1.16 -> 1.17 --- Log message: Add LOC accounting ability --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Makefile.singlesrc diff -u llvm/test/Programs/SingleSource/Makefile.singlesrc:1.16 llvm/test/Programs/SingleSource/Makefile.singlesrc:1.17 --- llvm/test/Programs/SingleSource/Makefile.singlesrc:1.16 Wed Jan 22 21:52:03 2003 +++ llvm/test/Programs/SingleSource/Makefile.singlesrc Fri Feb 14 18:30:44 2003 @@ -24,6 +24,9 @@ ifndef USE_PRECOMPILED_BYTECODE Output/%.linked.rll: Output/%.ll cp -f $< $@ + +Output/%.LOC.txt: %.c + cat $< | wc -l > $@ endif # FIXME: LIBS should be specified, not hardcoded to -lm From lattner at cs.uiuc.edu Fri Feb 14 18:32:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 18:32:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/Makefile.programs Message-ID: <200302150031.SAA15740@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: Makefile.programs updated: 1.34 -> 1.35 --- Log message: Add LOC ability --- Diffs of the changes: Index: llvm/test/Programs/Makefile.programs diff -u llvm/test/Programs/Makefile.programs:1.34 llvm/test/Programs/Makefile.programs:1.35 --- llvm/test/Programs/Makefile.programs:1.34 Wed Jan 22 21:52:00 2003 +++ llvm/test/Programs/Makefile.programs Fri Feb 14 18:31:04 2003 @@ -244,6 +244,9 @@ Output/%.linked.rll: $(SRCDIR)/%.linked.rll Output/.dir cp $< $@ +$(PROGRAMS_TO_TEST:%=Output/%.LOC.txt): \ +Output/%.LOC.txt: $(SRCDIR)/%.LOC.txt Output/.dir + cp $< $@ endif From lattner at cs.uiuc.edu Fri Feb 14 18:32:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 18:32:03 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.dsgraph.Makefile Message-ID: <200302150031.SAA15753@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.dsgraph.Makefile updated: 1.8 -> 1.9 --- Log message: Gather LOC of testcases --- Diffs of the changes: Index: llvm/test/Programs/TEST.dsgraph.Makefile diff -u llvm/test/Programs/TEST.dsgraph.Makefile:1.8 llvm/test/Programs/TEST.dsgraph.Makefile:1.9 --- llvm/test/Programs/TEST.dsgraph.Makefile:1.8 Tue Feb 11 17:13:04 2003 +++ llvm/test/Programs/TEST.dsgraph.Makefile Fri Feb 14 18:31:28 2003 @@ -14,8 +14,10 @@ ANALYZE_OPTS := -stats -time-passes -only-print-main-ds -dsstats -instcount $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \ -Output/%.$(TEST).report.txt: Output/%.lib.bc $(LANALYZE) $(LOPT) - -(time -p $(LANALYZE) -$(PASS)datastructure $(ANALYZE_OPTS) $<)> $@ 2>&1 +Output/%.$(TEST).report.txt: Output/%.lib.bc Output/%.LOC.txt $(LANALYZE) $(LOPT) + @echo -n "LOC: " > $@ + @cat Output/$*.LOC.txt >> $@ + -(time -p $(LANALYZE) -$(PASS)datastructure $(ANALYZE_OPTS) $<)>> $@ 2>&1 -($(LOPT) -steens-aa -time-passes > /dev/null < $<) >> $@ 2>&1 $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \ From lattner at cs.uiuc.edu Fri Feb 14 18:32:06 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 18:32:06 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/GenerateReport.pl Message-ID: <200302150031.SAA15765@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: GenerateReport.pl updated: 1.7 -> 1.8 --- Log message: Add support for Latex output --- Diffs of the changes: Index: llvm/test/Programs/GenerateReport.pl diff -u llvm/test/Programs/GenerateReport.pl:1.7 llvm/test/Programs/GenerateReport.pl:1.8 --- llvm/test/Programs/GenerateReport.pl:1.7 Wed Jan 22 15:11:58 2003 +++ llvm/test/Programs/GenerateReport.pl Fri Feb 14 18:31:49 2003 @@ -3,18 +3,20 @@ # Program: GenerateReport.pl # # Synopsis: Summarize a big log file into a table of values, commonly used for -# testing. This can generate either a plaintext table or HTML table -# depending on whether the -html option is specified. +# testing. This can generate either a plaintext table, HTML table, +# or Latex table, depending on whether the -html or -latex options are +# specified. # # This script reads a report description file to specify the fields # and descriptions for the columns of interest. In reads the raw log # input from stdin and writes the table to stdout. # -# Syntax: GenerateReport.pl [-html] < Input > Output +# Syntax: GenerateReport.pl [-html] [-latex] < Input > Output # # Default values for arguments -$HTML = 0; +my $HTML = 0; +my $LATEX = 0; # Parse arguments... while ($_ = $ARGV[0], /^[-+]/) { @@ -22,7 +24,8 @@ last if /^--$/; # Stop processing arguments on -- # List command line options here... - if (/^-html$/) { $HTML = 1; next; } + if (/^-html$/) { $HTML = 1; next; } + if (/^-latex$/) { $LATEX = 1; next; } print "Unknown option: $_ : ignoring!\n"; } @@ -69,6 +72,7 @@ open(REPORTDESC, $ReportFN) or die "Couldn't open report description '$ReportFN'!"; +my @LatexColumns; # Filled in by report if it supports Latex mode my @Fields = eval ; @@ -175,15 +179,33 @@ } } - # - # Print out the table now... - # - foreach $Value (@Values) { - for ($i = 0; $i < @$Value-1; $i++) { - printf "%-$FieldWidths[$i]s ", $$Value[$i]; + if ($LATEX) { + # + # Print out the latexified table... + # + shift @Values; # Don't print the header... + foreach $Row (@Values) { + my $First = 1; + + for $ColNum (@LatexColumns) { + # Print a seperator... + print " & " if ($First == 0); + $First = 0; + printf "%-$FieldWidths[$ColNum]s", $Row->[$ColNum]; + } + print "\\\\\n"; } - - # Print the assertion message if existant... - print "$$Value[@$Value-1]\n"; - } + } else { + # + # Print out the table in plaintext format now... + # + foreach $Value (@Values) { + for ($i = 0; $i < @$Value-1; $i++) { + printf "%-$FieldWidths[$i]s ", $$Value[$i]; + } + + # Print the assertion message if existant... + print "$$Value[@$Value-1]\n"; + } +} } From lattner at cs.uiuc.edu Fri Feb 14 18:35:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 18:35:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Makefile Message-ID: <200302150034.SAA11861@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource: Makefile updated: 1.4 -> 1.5 --- Log message: Move anagram to multisource suite --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Makefile diff -u llvm/test/Programs/SingleSource/Makefile:1.4 llvm/test/Programs/SingleSource/Makefile:1.5 --- llvm/test/Programs/SingleSource/Makefile:1.4 Thu Jan 16 13:54:41 2003 +++ llvm/test/Programs/SingleSource/Makefile Fri Feb 14 18:34:24 2003 @@ -1,4 +1,4 @@ LEVEL = ../../.. -PARALLEL_DIRS = UnitTests Shootout Ptrdist-anagram +PARALLEL_DIRS = UnitTests Shootout include Makefile.singlesrc From lattner at cs.uiuc.edu Fri Feb 14 18:51:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Feb 14 18:51:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.dsgraph.report Message-ID: <200302150050.SAA12572@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.dsgraph.report updated: 1.3 -> 1.4 --- Log message: Add latex support --- Diffs of the changes: Index: llvm/test/Programs/TEST.dsgraph.report diff -u llvm/test/Programs/TEST.dsgraph.report:1.3 llvm/test/Programs/TEST.dsgraph.report:1.4 --- llvm/test/Programs/TEST.dsgraph.report:1.3 Tue Feb 11 17:13:04 2003 +++ llvm/test/Programs/TEST.dsgraph.report Fri Feb 14 18:50:40 2003 @@ -16,17 +16,42 @@ } # Sort by total analyze time -$SortCol = 2; +$SortCol = 7; # Sort in descending order $SortReverse = 1; +%NameMap = ( + treeadd => 'Olden-treeadd', + bisort => 'Olden-bisort', + mst => 'Olden-mst', + perimeter => 'Olden-perimeter', + health => 'Olden-health', + tsp => 'Olden-tsp', + power => 'Olden-power', + em3d => 'Olden-em3d', + voronoi => 'Olden-voronoi', + bh => 'Olden-bh', + + ks => 'ptrdist-ks', + anagram => 'ptrdist-anagram', + yacr2 => 'ptrdist-yacr2', + ft => 'ptrdist-ft', + bc => 'ptrdist-bc'); + + at LatexColumns = (0, 1, 26, 19, # Program, LOC, #Instrs, MaxSCC + 4, 5, 6, 7, # Execution times + 13, # Memory BU+TD + 16, 17, # Total, Max Nodes + 15); # NumFolded + # These are the columns for the report. The first entry is the header for the # column, the second is the regex to use to match the value. Empty list create # seperators, and closures may be put in for custom processing. ( # Name ["Name:" , '\'([^\']+)\' Program'], + ["LOC:" , 'LOC: *([0-9]+)'], [], # Times ["Anlyz:", '([0-9.]+) \([^)]+\)[ 0-9]+TOTAL'],