1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/lib
Adrian Prantl 47833cff03 Teach LiveDebugValues about lexical scopes.
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
2016-09-28 17:51:14 +00:00
..
Analysis [SCEV] Use a SmallPtrSet as a temporary union predicate; NFC 2016-09-28 17:14:58 +00:00
AsmParser [AsmParser] Remove unused partial template specialization. 2016-09-22 22:02:59 +00:00
Bitcode [thinlto] Basic thinlto fdo heuristic 2016-09-26 20:37:32 +00:00
CodeGen Teach LiveDebugValues about lexical scopes. 2016-09-28 17:51:14 +00:00
DebugInfo Revert r282238 "Revert r282235 "[llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section."" 2016-09-23 11:01:53 +00:00
Demangle Avoid using alignas and constexpr. 2016-09-06 20:36:24 +00:00
ExecutionEngine [MCJIT] Fix some inconsistent handling of name mangling inside MCJIT. 2016-09-12 17:19:24 +00:00
Fuzzer [libFuzzer] speedup TracePC::FinalizeTrace 2016-09-28 01:16:24 +00:00
IR [Inliner] Port all opt remarks to new streaming API 2016-09-27 23:47:03 +00:00
IRReader
LibDriver Object: Replace NewArchiveIterator with a simpler NewArchiveMember class. NFCI. 2016-06-29 22:27:42 +00:00
LineEditor
Linker DebugInfo: New metadata representation for global variables. 2016-09-13 01:12:59 +00:00
LTO [thinlto] Basic thinlto fdo heuristic 2016-09-26 20:37:32 +00:00
MC [MC] Support .ds directives in assembler parser 2016-09-23 21:53:36 +00:00
Object [AVR] Handle AVR relocations when handling ELF files 2016-09-28 13:23:42 +00:00
ObjectYAML [macho2yaml] Don't write empty linkedit data 2016-08-17 21:46:04 +00:00
Option Replace "fallthrough" comments with LLVM_FALLTHROUGH 2016-08-17 05:10:15 +00:00
Passes Fix test after renaming -name-anon-functions pass to -name-anon-globals 2016-09-16 17:18:16 +00:00
ProfileData [Coverage] Make sorting criteria for CounterMappingRegions local. 2016-08-31 07:01:17 +00:00
Support Statistic: Bring back printing on exit by default 2016-09-27 19:38:55 +00:00
TableGen Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes. 2016-08-23 17:14:32 +00:00
Target [NVPTX] Added intrinsics for atom.gen.{sys|cta}.* instructions. 2016-09-28 17:25:38 +00:00
Transforms [SystemZ] Implementation of getUnrollingPreferences(). 2016-09-28 09:41:38 +00:00
CMakeLists.txt Try to fix a circular dependency in the modules build. 2016-09-06 20:16:19 +00:00
LLVMBuild.txt Add an c++ itanium demangler to llvm. 2016-09-06 19:16:48 +00:00