From c177fec93f6676aa38686e24843f62ec0f8a7643 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Wed, 6 May 2015 21:34:34 +0000 Subject: 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` from the profile entirely. (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) llvm-svn: 236642 --- llvm/lib/MC/MCContext.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/MC/MCContext.cpp') 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]; -- cgit v1.2.3