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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17439 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-11-02 20:31:06 +00:00
parent caa35bc0b6
commit f1de30acce

View File

@ -214,16 +214,21 @@ void PA::EquivClassGraphs::buildIndirectFunctionSets(Module &M) {
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]);