summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-05-27 22:31:41 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-05-27 22:31:41 +0000
commit815a6eb55d8e4f27ee85a7b0ff44212b8150824b (patch)
tree077f3e9752a0133a67251f167773e2425ecc4776 /llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
parent3154aa23f31f2f78f251b70f7a9b3dfb54a596cc (diff)
downloadbcm5719-llvm-815a6eb55d8e4f27ee85a7b0ff44212b8150824b.tar.gz
bcm5719-llvm-815a6eb55d8e4f27ee85a7b0ff44212b8150824b.zip
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.) llvm-svn: 238364
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
index 42e7cf7f35c..38ebedc9939 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
@@ -254,24 +254,20 @@ void AsmPrinter::emitCFIInstruction(const MCCFIInstruction &Inst) const {
}
void AsmPrinter::emitDwarfDIE(const DIE &Die) const {
- // Get the abbreviation for this DIE.
- const DIEAbbrev &Abbrev = Die.getAbbrev();
-
// Emit the code (index) for the abbreviation.
if (isVerbose())
- OutStreamer->AddComment("Abbrev [" + Twine(Abbrev.getNumber()) +
- "] 0x" + Twine::utohexstr(Die.getOffset()) +
- ":0x" + Twine::utohexstr(Die.getSize()) + " " +
- dwarf::TagString(Abbrev.getTag()));
- EmitULEB128(Abbrev.getNumber());
+ OutStreamer->AddComment("Abbrev [" + Twine(Die.getAbbrevNumber()) + "] 0x" +
+ Twine::utohexstr(Die.getOffset()) + ":0x" +
+ Twine::utohexstr(Die.getSize()) + " " +
+ dwarf::TagString(Die.getTag()));
+ EmitULEB128(Die.getAbbrevNumber());
const SmallVectorImpl<DIEValue> &Values = Die.getValues();
- const SmallVectorImpl<DIEAbbrevData> &AbbrevData = Abbrev.getData();
// Emit the DIE attribute values.
for (unsigned i = 0, N = Values.size(); i < N; ++i) {
- dwarf::Attribute Attr = AbbrevData[i].getAttribute();
- dwarf::Form Form = AbbrevData[i].getForm();
+ dwarf::Attribute Attr = Values[i].getAttribute();
+ dwarf::Form Form = Values[i].getForm();
assert(Form && "Too many attributes for DIE (check abbreviation)");
if (isVerbose()) {
@@ -286,7 +282,7 @@ void AsmPrinter::emitDwarfDIE(const DIE &Die) const {
}
// Emit the DIE children if any.
- if (Abbrev.hasChildren()) {
+ if (Die.hasChildren()) {
for (auto &Child : Die.getChildren())
emitDwarfDIE(*Child);
OpenPOWER on IntegriCloud