[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Mar 19 20:30:44 PST 2005



Changes in directory llvm/lib/Analysis/DataStructure:

DataStructure.cpp updated: 1.214 -> 1.215
---
Log message:

Remove the ability to keep track of inlined globals, which is always dead.


---
Diffs of the changes:  (+1 -36)

 DataStructure.cpp |   37 +------------------------------------
 1 files changed, 1 insertion(+), 36 deletions(-)


Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.214 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.215
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.214	Sat Mar 19 21:29:54 2005
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp	Sat Mar 19 22:30:30 2005
@@ -922,9 +922,6 @@
     assert(DestGNH.getNode() == NH.getNode() &&"Global mapping inconsistent");
     Dest.getNodeForValue(GV).mergeWith(DSNodeHandle(DestGNH.getNode(),
                                        DestGNH.getOffset()+SrcGNH.getOffset()));
-    
-    if (CloneFlags & DSGraph::UpdateInlinedGlobals)
-      Dest.getInlinedGlobals().insert(GV);
   }
   NH.getNode()->mergeGlobals(SN->getGlobalsList());
 
@@ -1014,9 +1011,6 @@
         assert(DestGNH.getNode()==NH.getNode() &&"Global mapping inconsistent");
         Dest.getNodeForValue(GV).mergeWith(DSNodeHandle(DestGNH.getNode(),
                                       DestGNH.getOffset()+SrcGNH.getOffset()));
-        
-        if (CloneFlags & DSGraph::UpdateInlinedGlobals)
-          Dest.getInlinedGlobals().insert(GV);
       }
       NH.getNode()->mergeGlobals(SN->getGlobalsList());
     }
@@ -1049,9 +1043,6 @@
       assert(SrcGNH.getNode() == SN && "Global mapping inconsistent");
       Dest.getNodeForValue(GV).mergeWith(DSNodeHandle(DestGNH.getNode(),
                                     DestGNH.getOffset()+SrcGNH.getOffset()));
-      
-      if (CloneFlags & DSGraph::UpdateInlinedGlobals)
-        Dest.getInlinedGlobals().insert(GV);
     }
   }
 
@@ -1159,7 +1150,6 @@
 DSGraph::~DSGraph() {
   FunctionCalls.clear();
   AuxFunctionCalls.clear();
-  InlinedGlobals.clear();
   ScalarMap.clear();
   ReturnNodes.clear();
 
@@ -1189,28 +1179,6 @@
     }
 }
 
-/// updateFromGlobalGraph - This function rematerializes global nodes and
-/// nodes reachable from them from the globals graph into the current graph.
-/// It uses the vector InlinedGlobals to avoid cloning and merging globals that
-/// are already up-to-date in the current graph.  In practice, in the TD pass,
-/// this is likely to be a large fraction of the live global nodes in each
-/// function (since most live nodes are likely to have been brought up-to-date
-/// in at _some_ caller or callee).
-/// 
-void DSGraph::updateFromGlobalGraph() {
-  TIME_REGION(X, "updateFromGlobalGraph");
-  ReachabilityCloner RC(*this, *GlobalsGraph, 0);
-
-  // Clone the non-up-to-date global nodes into this graph.
-  for (DSScalarMap::global_iterator I = getScalarMap().global_begin(),
-         E = getScalarMap().global_end(); I != E; ++I)
-    if (InlinedGlobals.count(*I) == 0) { // GNode is not up-to-date
-      DSScalarMap::iterator It = GlobalsGraph->ScalarMap.find(*I);
-      if (It != GlobalsGraph->ScalarMap.end())
-        RC.merge(getNodeForValue(*I), It->second);
-    }
-}
-
 /// addObjectToGraph - This method can be used to add global, stack, and heap
 /// objects to the graph.  This can be used when updating DSGraphs due to the
 /// introduction of new temporary objects.  The new object is not pointed to
@@ -1287,11 +1255,8 @@
                              I->second.getOffset()+MappedNode.getOffset()));
 
     // If this is a global, add the global to this fn or merge if already exists
-    if (GlobalValue* GV = dyn_cast<GlobalValue>(I->first)) {
+    if (GlobalValue* GV = dyn_cast<GlobalValue>(I->first))
       ScalarMap[GV].mergeWith(H);
-      if (CloneFlags & DSGraph::UpdateInlinedGlobals)
-        InlinedGlobals.insert(GV);
-    }
   }
 
   if (!(CloneFlags & DontCloneCallNodes)) {






More information about the llvm-commits mailing list