mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-21 03:53:04 +02:00
Actually recycle SDNode allocations. SelectionDAG is using
RecyclingAllocator, but this change is needed for the nodes to actually be recycled. This cuts SelectionDAG's memory usage high-water-mark in half in some cases. llvm-svn: 55351
This commit is contained in:
parent
5438048f54
commit
815d50b9e6
@ -523,7 +523,7 @@ void SelectionDAG::RemoveDeadNodes(SmallVectorImpl<SDNode *> &DeadNodes,
|
||||
N->NumOperands = 0;
|
||||
|
||||
// Finally, remove N itself.
|
||||
AllNodes.remove(N);
|
||||
NodeAllocator.Deallocate(AllNodes.remove(N));
|
||||
}
|
||||
}
|
||||
|
||||
@ -551,7 +551,8 @@ void SelectionDAG::DeleteNodeNotInCSEMaps(SDNode *N) {
|
||||
if (N->OperandsNeedDelete)
|
||||
delete[] N->OperandList;
|
||||
|
||||
AllNodes.remove(N);
|
||||
assert(N != AllNodes.begin());
|
||||
NodeAllocator.Deallocate(AllNodes.remove(N));
|
||||
}
|
||||
|
||||
/// RemoveNodeFromCSEMaps - Take the specified node out of the CSE map that
|
||||
@ -777,11 +778,14 @@ SelectionDAG::~SelectionDAG() {
|
||||
}
|
||||
|
||||
void SelectionDAG::allnodes_clear() {
|
||||
assert(&*AllNodes.begin() == &EntryNode);
|
||||
AllNodes.remove(AllNodes.begin());
|
||||
while (!AllNodes.empty()) {
|
||||
SDNode *N = AllNodes.remove(AllNodes.begin());
|
||||
N->SetNextInBucket(0);
|
||||
if (N->OperandsNeedDelete)
|
||||
delete [] N->OperandList;
|
||||
NodeAllocator.Deallocate(N);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user