mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
Only clone global nodes between graphs if both graphs have the global.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11928 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6b586df328
commit
0321b68f6b
@ -279,6 +279,9 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
|
|||||||
//
|
//
|
||||||
DSGraph &GI = getDSGraph(*Callee); // Graph to inline
|
DSGraph &GI = getDSGraph(*Callee); // Graph to inline
|
||||||
|
|
||||||
|
if (Callee->getName() == "bc_raise")
|
||||||
|
std::cerr << "HERE!\n";
|
||||||
|
|
||||||
DEBUG(std::cerr << " Inlining graph for " << Callee->getName()
|
DEBUG(std::cerr << " Inlining graph for " << Callee->getName()
|
||||||
<< "[" << GI.getGraphSize() << "+"
|
<< "[" << GI.getGraphSize() << "+"
|
||||||
<< GI.getAuxFunctionCalls().size() << "] into '"
|
<< GI.getAuxFunctionCalls().size() << "] into '"
|
||||||
|
@ -33,10 +33,6 @@ namespace {
|
|||||||
Statistic<> NumDNE ("dsa", "Number of nodes removed by reachability");
|
Statistic<> NumDNE ("dsa", "Number of nodes removed by reachability");
|
||||||
Statistic<> NumTrivialDNE ("dsa", "Number of nodes trivially removed");
|
Statistic<> NumTrivialDNE ("dsa", "Number of nodes trivially removed");
|
||||||
Statistic<> NumTrivialGlobalDNE("dsa", "Number of globals trivially removed");
|
Statistic<> NumTrivialGlobalDNE("dsa", "Number of globals trivially removed");
|
||||||
|
|
||||||
cl::opt<bool>
|
|
||||||
EnableDSNodeGlobalRootsHack("enable-dsa-globalrootshack", cl::Hidden,
|
|
||||||
cl::desc("Make DSA less aggressive when cloning graphs"));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
@ -1239,15 +1235,12 @@ void DSGraph::mergeInGraph(const DSCallSite &CS, Function &F,
|
|||||||
AuxFunctionCalls.push_back(DSCallSite(Graph.AuxFunctionCalls[i], RC));
|
AuxFunctionCalls.push_back(DSCallSite(Graph.AuxFunctionCalls[i], RC));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the user requested it, add the nodes that we need to clone to the
|
// Clone over all globals that appear in the caller and callee graphs.
|
||||||
// RootNodes set.
|
for (DSScalarMap::global_iterator GI = Graph.getScalarMap().global_begin(),
|
||||||
if (!EnableDSNodeGlobalRootsHack)
|
E = Graph.getScalarMap().global_end(); GI != E; ++GI)
|
||||||
// FIXME: Why is this not iterating over the globals in the graph??
|
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(*GI))
|
||||||
for (node_iterator NI = Graph.node_begin(), E = Graph.node_end();
|
if (ScalarMap.count(GV))
|
||||||
NI != E; ++NI)
|
RC.merge(ScalarMap[GV], Graph.getNodeForValue(GV));
|
||||||
if (!(*NI)->getGlobals().empty())
|
|
||||||
RC.getClonedNH(*NI);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
DSNodeHandle RetVal = getReturnNodeFor(F);
|
DSNodeHandle RetVal = getReturnNodeFor(F);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user