mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-15 09:33:39 +00:00
Prune function nodes that are no longer referenced due to inlining
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4036 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6727ec64e8
commit
a00397e1ee
@ -253,6 +253,7 @@ DSGraph &BUDataStructures::calculateGraph(Function &F) {
|
|||||||
|
|
||||||
Graph->maskIncompleteMarkers();
|
Graph->maskIncompleteMarkers();
|
||||||
Graph->markIncompleteNodes();
|
Graph->markIncompleteNodes();
|
||||||
|
Graph->removeTriviallyDeadNodes(false);
|
||||||
Graph->removeDeadNodes(/*KeepAllGlobals*/ true, /*KeepCalls*/ true);
|
Graph->removeDeadNodes(/*KeepAllGlobals*/ true, /*KeepCalls*/ true);
|
||||||
|
|
||||||
DEBUG(std::cerr << " [BU] Done inlining: " << F.getName() << " ["
|
DEBUG(std::cerr << " [BU] Done inlining: " << F.getName() << " ["
|
||||||
|
@ -578,7 +578,7 @@ bool DSGraph::isNodeDead(DSNode *N) {
|
|||||||
N->getSize() == 0 &&
|
N->getSize() == 0 &&
|
||||||
N->getReferrers().size() == N->getGlobals().size()) {
|
N->getReferrers().size() == N->getGlobals().size()) {
|
||||||
|
|
||||||
// Remove the globals from the valuemap, so that the referrer count will go
|
// Remove the globals from the ValueMap, so that the referrer count will go
|
||||||
// down to zero.
|
// down to zero.
|
||||||
removeRefsToGlobal(N, ValueMap);
|
removeRefsToGlobal(N, ValueMap);
|
||||||
assert(N->getReferrers().empty() && "Referrers should all be gone now!");
|
assert(N->getReferrers().empty() && "Referrers should all be gone now!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user