if (&G != SCCGraph) {
{
DSGraph::NodeMapTy NodeMap;
- SCCGraph->cloneInto(G, SCCGraph->getScalarMap(),
- SCCGraph->getReturnNodes(), NodeMap);
+ SCCGraph->cloneInto(G, SCCGraph->getReturnNodes(), NodeMap);
}
// Update the DSInfo map and delete the old graph...
for (DSGraph::retnodes_iterator I = G.retnodes_begin(),
// bother merging it in again.
if (!GI->containsFunction(*I)) {
DSGraph::NodeMapTy NodeMap;
- GI->cloneInto(getDSGraph(**I), GI->getScalarMap(),
- GI->getReturnNodes(), NodeMap);
+ GI->cloneInto(getDSGraph(**I), GI->getReturnNodes(), NodeMap);
++NumBUInlines;
}
ValMap[NG] = ~0U;
DSGraph::NodeMapTy NodeMap;
- FG.cloneInto(*NG, FG.getScalarMap(), FG.getReturnNodes(), NodeMap);
+ FG.cloneInto(*NG, FG.getReturnNodes(), NodeMap);
// Update the DSInfo map and delete the old graph...
for (DSGraph::retnodes_iterator I = NG->retnodes_begin();
: GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) {
PrintAuxCalls = false;
NodeMapTy NodeMap;
- cloneInto(G, ScalarMap, ReturnNodes, NodeMap, CloneFlags);
+ cloneInto(G, ReturnNodes, NodeMap, CloneFlags);
}
DSGraph::DSGraph(const DSGraph &G, NodeMapTy &NodeMap,
EquivalenceClasses<GlobalValue*> &ECs)
: GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) {
PrintAuxCalls = false;
- cloneInto(G, ScalarMap, ReturnNodes, NodeMap);
+ cloneInto(G, ReturnNodes, NodeMap);
}
DSGraph::~DSGraph() {
/// cloneInto - Clone the specified DSGraph into the current graph. The
-/// translated ScalarMap for the old function is filled into the OldValMap
-/// member, and the translated ReturnNodes map is returned into ReturnNodes.
+/// translated ScalarMap for the old function is filled into the ScalarMap
+/// for the graph, and the translated ReturnNodes map is returned into
+/// ReturnNodes.
///
/// The CloneFlags member controls various aspects of the cloning process.
///
-void DSGraph::cloneInto(const DSGraph &G, DSScalarMap &OldValMap,
+void DSGraph::cloneInto(const DSGraph &G,
ReturnNodesTy &OldReturnNodes, NodeMapTy &OldNodeMap,
unsigned CloneFlags) {
TIME_REGION(X, "cloneInto");
for (DSScalarMap::const_iterator I = G.ScalarMap.begin(),
E = G.ScalarMap.end(); I != E; ++I) {
DSNodeHandle &MappedNode = OldNodeMap[I->second.getNode()];
- DSNodeHandle &H = OldValMap[I->first];
+ DSNodeHandle &H = ScalarMap[I->first];
DSNode *MappedNodeN = MappedNode.getNode();
H.mergeWith(DSNodeHandle(MappedNodeN,
I->second.getOffset()+MappedNode.getOffset()));
}
// Clone this member of the equivalence class into MergedG.
- {
- DSGraph::NodeMapTy NodeMap;
- MergedG.cloneInto(CBUGraph, MergedG.getScalarMap(),
- MergedG.getReturnNodes(), NodeMap, 0);
- }
+ DSGraph::NodeMapTy NodeMap;
+ MergedG.cloneInto(CBUGraph, MergedG.getReturnNodes(), NodeMap, 0);
}
// Merge the return nodes of all functions together.
// If the SCC found is not the same as those found in CBU, make sure to
// merge the graphs as appropriate.
DSGraph::NodeMapTy NodeMap;
- FG.cloneInto(*NG, FG.getScalarMap(), FG.getReturnNodes(), NodeMap);
+ FG.cloneInto(*NG, FG.getReturnNodes(), NodeMap);
// Update the DSInfo map and delete the old graph...
for (DSGraph::retnodes_iterator I = NG->retnodes_begin();
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isExternal()) {
DSGraph::NodeMapTy NodeMap;
- ResultGraph->cloneInto(LDS.getDSGraph(*I), ResultGraph->getScalarMap(),
- RetValMap, NodeMap, 0);
+ ResultGraph->cloneInto(LDS.getDSGraph(*I), RetValMap, NodeMap, 0);
}
ResultGraph->removeTriviallyDeadNodes();