AsmPrinter: Stop creating DebugLocs
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 17 Feb 2015 00:02:27 +0000 (00:02 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 17 Feb 2015 00:02:27 +0000 (00:02 +0000)
commitca3b3d5e2c52f592b62d51a6999029dfc9268b63
treead49d3ff4a0047551f0000d33cbb748e17c3184f
parentba51ae6864c22927b67059a56770472b610a790b
AsmPrinter: Stop creating DebugLocs

While looking at a heap profile of a clang LTO bootstrap with -g, I
noticed that 2.2% of memory in an `llvm-lto` of clang is from calling
`DebugLoc::get()` in `collectVariableInfo()` (accounting for ~40% of
memory used for `MDLocation`s).

I suspect this was introduced by r226736, whose goal was to prevent
uniquing of `DebugLoc`s (goal achieved, if so).

There's no reason we need a `DebugLoc` here at all -- it was just being
used for (in)convenient API -- so the fix is to pass the scope and
inlined-at directly to `LexicalScopes::findInlinedScope()`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229459 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/LexicalScopes.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/LexicalScopes.cpp