forked from OSchip/llvm-project
7f5866c227
This addresses PR26055 LiveDebugValues is very slow. Contrary to the old LiveDebugVariables pass LiveDebugValues currently doesn't look at the lexical scopes before inserting a DBG_VALUE intrinsic. This means that we often propagate DBG_VALUEs much further down than necessary. This is especially noticeable in large C++ functions with many inlined method calls that all use the same "this"-pointer. For example, in the following code it makes no sense to propagate the inlined variable a from the first inlined call to f() into any of the subsequent basic blocks, because the variable will always be out of scope: void sink(int a); void __attribute((always_inline)) f(int a) { sink(a); } void foo(int i) { f(i); if (i) f(i); f(i); } This patch reuses the LexicalScopes infrastructure we have for LiveDebugVariables to take this into account. The effect on compile time and memory consumption is quite noticeable: I tested a benchmark that is a large C++ source with an enormous amount of inlined "this"-pointers that would previously eat >24GiB (most of them for DBG_VALUE intrinsics) and whose compile time was dominated by LiveDebugValues. With this patch applied the memory consumption is 1GiB and 1.7% of the time is spent in LiveDebugValues. https://reviews.llvm.org/D24994 Thanks to Daniel Berlin and Keith Walker for reviewing! llvm-svn: 282611 |
||
---|---|---|
.. | ||
AArch64 | ||
ARM | ||
COFF | ||
Generic | ||
Inputs | ||
Lanai | ||
MIR | ||
Mips | ||
PDB | ||
PowerPC | ||
Sparc | ||
SystemZ | ||
WebAssembly | ||
X86 | ||
arm-relocs.test | ||
debuglineinfo-macho.test | ||
debuglineinfo.test | ||
debugmacinfo.test | ||
dwarfdump-64-bit-dwarf.test | ||
dwarfdump-accel.test | ||
dwarfdump-debug-frame-simple.test | ||
dwarfdump-debug-loc-simple.test | ||
dwarfdump-dump-flags.test | ||
dwarfdump-dump-gdbindex.test | ||
dwarfdump-dwp.test | ||
dwarfdump-invalid.test | ||
dwarfdump-line-dwo.test | ||
dwarfdump-macho-relocs.test | ||
dwarfdump-macho-universal.test | ||
dwarfdump-objc.test | ||
dwarfdump-pubnames.test | ||
dwarfdump-ranges.test | ||
dwarfdump-type-units.test | ||
dwarfdump-zlib.test | ||
dwo.ll | ||
llvm-symbolizer-split-dwarf-empty.test | ||
llvm-symbolizer-zlib.test | ||
llvm-symbolizer.test | ||
macro_link.ll | ||
member-pointers.o | ||
missing-abstract-variable.o | ||
skeletoncu.ll |