summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2003-07-16 21:42:03 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2003-07-16 21:42:03 +0000
commit1da1d32fc742db98a0850164177920f15b998b67 (patch)
treebab82552300506b7bba9bd06ac5b507956ea3288 /lib
parent03e19ddaf70b6e1595d503641928efb62e18df14 (diff)
downloadllvm-1da1d32fc742db98a0850164177920f15b998b67.tar.gz
llvm-1da1d32fc742db98a0850164177920f15b998b67.tar.bz2
llvm-1da1d32fc742db98a0850164177920f15b998b67.tar.xz
Rematerialize nodes from the globals graph into the current graph
after all callees are inlined into the current graph. NOTE: There's also a major bug fix for the BU pass in DataStructure.cpp, which ensures that resolvable indirect calls are not moved out to the globals graph, so that they are eventually inlined (if possible). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/DataStructure/BottomUpClosure.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp
index 94d0512fd2..aff74ac920 100644
--- a/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -283,11 +283,17 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
TempFCs.clear();
- // Recompute the Incomplete markers. If there are any function calls left
- // now that are complete, we must loop!
+ // Re-materialize nodes from the globals graph.
+ // Do not ignore globals inlined from callees -- they are not up-to-date!
+ Graph.getInlinedGlobals().clear();
+ Graph.updateFromGlobalGraph();
+
+ // Recompute the Incomplete markers
Graph.maskIncompleteMarkers();
Graph.markIncompleteNodes(DSGraph::MarkFormalArgs);
- // FIXME: materialize nodes from the globals graph as neccesary...
+
+ // Delete dead nodes. Treat globals that are unreachable but that can
+ // reach live nodes as live.
Graph.removeDeadNodes(DSGraph::KeepUnreachableGlobals);
//Graph.writeGraphToFile(std::cerr, "bu_" + F.getName());