[llvm-commits] CVS: poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Nov 2 12:31:16 PST 2004



Changes in directory poolalloc/lib/PoolAllocate:

EquivClassGraphs.cpp updated: 1.16 -> 1.17

---
Log message:

Graphs that are part of equivalence sets can be multi-function SCC's 
themselves.  Make sure to update DSInfo correctly.  This fixes a testcase
reduced from Prolangs-C++/objects


---
Diffs of the changes:  (+8 -3)

Index: poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp
diff -u poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.16 poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.17
--- poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.16	Tue Nov  2 13:29:59 2004
+++ poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp	Tue Nov  2 14:31:06 2004
@@ -214,16 +214,21 @@
         DSGraph &CBUGraph = CBU->getDSGraph(*F); 
         if (!GraphsMerged.insert(&CBUGraph).second)
           continue;
-        assert(FG == 0 && "Remerged a graph?");
         
         // Record the "folded" graph for the function.
-        FG = &MergedG;
+        for (DSGraph::ReturnNodesTy::iterator
+               I = CBUGraph.getReturnNodes().begin(),
+               E = CBUGraph.getReturnNodes().end();
+             I != E; ++I) {
+          assert(DSInfo[I->first] == 0 && "Graph already exists for Fn!");
+          DSInfo[I->first] = &MergedG;
+        }
         
         // Clone this member of the equivalence class into MergedG.
         DSGraph::NodeMapTy NodeMap;    
 
         MergedG.cloneInto(CBUGraph, MergedG.getScalarMap(),
-                           MergedG.getReturnNodes(), NodeMap, 0);
+                          MergedG.getReturnNodes(), NodeMap, 0);
 
         // Merge the return nodes of all functions together.
         MergedG.getReturnNodes()[LF].mergeWith(MergedG.getReturnNodes()[F]);





More information about the llvm-commits mailing list