diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-05-06 21:34:34 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-05-06 21:34:34 +0000 |
commit | c177fec93f6676aa38686e24843f62ec0f8a7643 (patch) | |
tree | bb42570042f65fbddfcfaca64fb042179555c25f /llvm/lib/MC/MCContext.cpp | |
parent | ea558e0b33f249b34fdcd99ed4bc1c718632273f (diff) | |
download | bcm5719-llvm-c177fec93f6676aa38686e24843f62ec0f8a7643.tar.gz bcm5719-llvm-c177fec93f6676aa38686e24843f62ec0f8a7643.zip |
MC: Skip names of temporary symbols in object streamer
Don't create names for temporary symbols when using an object streamer.
The names never make it to the output anyway. From the starting point
of r236629, my heap profile says this drops peak memory usage from 1100
MB to 1058 MB for CodeGen of `verify-uselistorder`, a savings of almost
4% on peak memory, and removes `StringMap<bool, BumpPtrAllocator...>`
from the profile entirely.
(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)
llvm-svn: 236642
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r-- | llvm/lib/MC/MCContext.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index fd0422daf29..d6f6dbb04fe 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -150,6 +150,9 @@ MCSymbol *MCContext::CreateSymbol(StringRef Name, bool AlwaysAddSuffix) { if (AllowTemporaryLabels) IsTemporary = Name.startswith(MAI->getPrivateGlobalPrefix()); + if (IsTemporary && AlwaysAddSuffix && !UseNamesOnTempLabels) + return new (*this) MCSymbol("", true); + SmallString<128> NewName = Name; bool AddSuffix = AlwaysAddSuffix; unsigned &NextUniqueID = NextID[Name]; |