Commit 3414669
committed
[MemProf] Fixup edges for largest N cold contexts
We build the callsite graph by first adding nodes and edges for all
allocation contexts, then match the interior callsite nodes onto actual
calls (IR or summary), which due to inlining may result in the
generation of new nodes representing the inlined context sequence. We
attempt to update edges correctly during this process, but in the case
of recursion this becomes impossible to always get correct.
Specifically, when creating new inlined sequence nodes for stack ids on
recursive cycles we can't always update correctly, because we have lost
the original ordering of the context.
This PR introduces a mechanism, guarded by -memprof-top-n-important=
flag, to keep track of extra information for the largest N cold
contexts. Another flag -memprof-fixup-important (enabled by default)
will perform more expensive fixup of the edges for those largest N cold
contexts, by saving and walking the original ordered list of stack ids
from the context.1 parent c63cb50 commit 3414669
File tree
3 files changed
+486
-16
lines changed- llvm
- lib/Transforms/IPO
- test
- ThinLTO/X86
- Transforms/MemProfContextDisambiguation
3 files changed
+486
-16
lines changed
0 commit comments