[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Mon Jun 19 08:42:59 PDT 2006
Changes in directory llvm/lib/Analysis/DataStructure:
DataStructure.cpp updated: 1.246 -> 1.247
---
Log message:
Fix a bug, don't drop indirect call sites, especially if there is nothing known about them yet, and restore a simple version of a removed function
---
Diffs of the changes: (+27 -1)
DataStructure.cpp | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletion(-)
Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.246 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.247
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.246 Wed May 24 12:04:03 2006
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Mon Jun 19 10:42:47 2006
@@ -938,7 +938,10 @@
// two node handles, since "this" may get merged away at intermediate steps.
DSNodeHandle CurNodeH(this, Offset);
DSNodeHandle NHCopy(NH);
- DSNode::MergeNodes(CurNodeH, NHCopy);
+ if (CurNodeH.getOffset() >= NHCopy.getOffset())
+ DSNode::MergeNodes(CurNodeH, NHCopy);
+ else
+ DSNode::MergeNodes(NHCopy, CurNodeH);
}
@@ -1594,6 +1597,13 @@
for (afc_iterator I = Graph.afc_begin(), E = Graph.afc_end(); I!=E; ++I)
if (SCCFinder.PathExistsToClonedNode(*I))
AuxCallToCopy.push_back(&*I);
+ else if (I->isIndirectCall()){
+ //If the call node doesn't have any callees, clone it
+ std::vector< Function *> List;
+ I->getCalleeNode()->addFullFunctionList(List);
+ if (!List.size())
+ AuxCallToCopy.push_back(&*I);
+ }
const DSScalarMap &GSM = Graph.getScalarMap();
for (DSScalarMap::global_iterator GI = GSM.global_begin(),
@@ -2397,3 +2407,19 @@
computeNodeMapping(CalleeSM[*GI], CallerSM[*GI], NodeMap);
}
}
+
+/// updateFromGlobalGraph - This function rematerializes global nodes and
+/// nodes reachable from them from the globals graph into the current graph.
+///
+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) {
+ DSScalarMap::iterator It = GlobalsGraph->ScalarMap.find(*I);
+ if (It != GlobalsGraph->ScalarMap.end())
+ RC.merge(getNodeForValue(*I), It->second);
+ }
+}
More information about the llvm-commits
mailing list