AsmPrinter: Convert DIE::Values to a linked list

Change `DIE::Values` to a singly linked list, where each node is
allocated on a `BumpPtrAllocator`.  In order to support `push_back()`,
the list is circular, and points at the tail element instead of the
head.  I abstracted the core list logic out to `IntrusiveBackList` so
that it can be reused for `DIE::Children`, which also cares about
`push_back()`.

This drops llc memory usage from 799 MB down to 735 MB, about 8%.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240733 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-06-25 23:46:41 +00:00
parent d1ceba0333
commit 73e3fb6ba8
11 changed files with 463 additions and 268 deletions

View File

@ -165,18 +165,17 @@ void DIE::print(raw_ostream &O, unsigned IndentCount) const {
}
IndentCount += 2;
for (unsigned i = 0, N = Values.size(); i < N; ++i) {
unsigned I = 0;
for (const auto &V : Values) {
O << Indent;
if (!isBlock)
O << dwarf::AttributeString(Values[i].getAttribute());
O << dwarf::AttributeString(V.getAttribute());
else
O << "Blk[" << i << "]";
O << "Blk[" << I++ << "]";
O << " "
<< dwarf::FormEncodingString(Values[i].getForm())
<< " ";
Values[i].print(O);
O << " " << dwarf::FormEncodingString(V.getForm()) << " ";
V.print(O);
O << "\n";
}
IndentCount -= 2;