AsmPrinter: Store abbreviation data directly in DIE and DIEValue

Stop storing a `DIEAbbrev` in `DIE`, since the data fits neatly inside
the `DIEValue` list.  Besides being a cleaner data structure (avoiding
the parallel arrays), this gives us more freedom to rearrange the
`DIEValue` list.

This fixes the temporary memory regression from 845 MB up to 879 MB, and
drops it further to 829 MB for a net memory decrease of around 1.9%
(incremental decrease around 5.7%).

(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@238364 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-05-27 22:31:41 +00:00
parent 09fe4bf794
commit 611a2f2322
9 changed files with 128 additions and 98 deletions

View File

@@ -51,8 +51,10 @@ void DwarfCompileUnit::addLocalLabelAddress(DIE &Die,
if (Label)
DD->addArangeLabel(SymbolCU(this, Label));
Die.addValue(Attribute, dwarf::DW_FORM_addr,
Label ? DIEValue(DIELabel(Label)) : DIEValue(DIEInteger(0)));
if (Label)
Die.addValue(Attribute, dwarf::DW_FORM_addr, DIELabel(Label));
else
Die.addValue(Attribute, dwarf::DW_FORM_addr, DIEInteger(0));
}
unsigned DwarfCompileUnit::getOrCreateSourceID(StringRef FileName,
@@ -253,9 +255,7 @@ void DwarfCompileUnit::initStmtList() {
}
void DwarfCompileUnit::applyStmtList(DIE &D) {
D.addValue(dwarf::DW_AT_stmt_list,
UnitDie.getAbbrev().getData()[stmtListIndex].getForm(),
UnitDie.getValues()[stmtListIndex]);
D.addValue(UnitDie.getValues()[stmtListIndex]);
}
void DwarfCompileUnit::attachLowHighPC(DIE &D, const MCSymbol *Begin,