Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6 |
|
#
ad635b41 |
| 10-Dec-2024 |
Kazu Hirata <kazu@google.com> |
[memprof] Use more gtest matchers in unit tests (NFC) (#119338)
|
#
624e89bc |
| 09-Dec-2024 |
Kazu Hirata <kazu@google.com> |
[memprof] Use namespace scopes in unit tests (NFC) (#119176)
This patch uses namespace scopes to remove memprof:: in
MemProfUseTest.cpp as in MemProfTest.cpp.
While I am at it, this patch remove
[memprof] Use namespace scopes in unit tests (NFC) (#119176)
This patch uses namespace scopes to remove memprof:: in
MemProfUseTest.cpp as in MemProfTest.cpp.
While I am at it, this patch removes a stale comment about
IndexedAllocationInfo::CallStack, which has been removed.
show more ...
|
Revision tags: llvmorg-19.1.5 |
|
#
81c20243 |
| 20-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[memprof] Remove an unused using directive (#117004)
We've switched to LineLocation from FieldsAre, so we don't need this
"using" directive anymore.
|
#
4b3b74df |
| 20-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[memprof] Use InstrProfWriter::addMemProfData in a unit test (NFC) (#116921)
This patch uses InstrProfWriter::addMemProfData to add the complete
MemProf profile to the writer context.
|
#
4acba069 |
| 20-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[memprof] Use a new constructor of IndexedAllocationInfo (NFC) (#116920)
IndexedAllocationInfo now has a new constructor that allows us to omit
the inline call stack, which is going away soon. Thi
[memprof] Use a new constructor of IndexedAllocationInfo (NFC) (#116920)
IndexedAllocationInfo now has a new constructor that allows us to omit
the inline call stack, which is going away soon. This patch migrates
away from the old constructor.
show more ...
|
#
5bf017ca |
| 20-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[memprof] Use LineLocation in a unit test (NFC) (#116917)
This patch uses LineLocation in preference to FieldsAre to improve the
readability. The change makes the unit test a little more consisten
[memprof] Use LineLocation in a unit test (NFC) (#116917)
This patch uses LineLocation in preference to FieldsAre to improve the
readability. The change makes the unit test a little more consistent
because we already use LineLocation in other tests in the same file.
show more ...
|
#
a2e266b3 |
| 20-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[memprof] Add computeUndriftMap (#116478)
This patch adds computeUndriftMap, a function to compute mappings from
source locations in the MemProf profile to source locations in the IR.
|
Revision tags: llvmorg-19.1.4 |
|
#
95554cbd |
| 13-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[memprof] Teach extractCallsFromIR to recognize heap allocation functions (#115938)
This patch teaches extractCallsFromIR to recognize heap allocation
functions. Specifically, when we encounter a
[memprof] Teach extractCallsFromIR to recognize heap allocation functions (#115938)
This patch teaches extractCallsFromIR to recognize heap allocation
functions. Specifically, when we encounter a callee that is known to
be a heap allocation function like "new", we set the callee GUID to 0.
Note that I am planning to do the same for the caller-callee pairs
extracted from the profile. That is, when I encounter a frame that
does not have a callee, we assume that the frame is calling some heap
allocation function with GUID 0.
Technically, I'm not recognizing enough functions in this patch.
TCMalloc is known to drop certain frames in the call stack immediately
above new. This patch is meant to lay the groundwork, setting up
GetTLI, plumbing it to extractCallsFromIR, and adjusting the unit
tests. I'll address remaining issues in subsequent patches.
show more ...
|
#
c6183244 |
| 09-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[memprof] Teach extractCallsFromIR to look into inline stacks (#115441)
To undrift the profile, we need to extract as many caller-callee pairs
from the IR as we can to maximize the number of call s
[memprof] Teach extractCallsFromIR to look into inline stacks (#115441)
To undrift the profile, we need to extract as many caller-callee pairs
from the IR as we can to maximize the number of call sites in the
profile we can undrift.
Now, since MemProfUsePass runs after early inlining, some functions
have been inlined, and we may no longer have bodies for those
functions in the IR. To cope with this, this patch teaches
extractCallsFromIR to extract caller-calee pairs from inline stacks.
The output format of extractCallsFromIR remains the same. We still
return a map from caller GUIDs to lists of corresponding call sites.
show more ...
|
#
e189d619 |
| 07-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[memprof] Add extractCallsFromIR (#115218)
This patch adds extractCallsFromIR, a function to extract calls from
the IR, which will be used to undrift call site locations in the
MemProf profile.
[memprof] Add extractCallsFromIR (#115218)
This patch adds extractCallsFromIR, a function to extract calls from
the IR, which will be used to undrift call site locations in the
MemProf profile.
In a nutshell, the MemProf undrifting works as follows:
- Extract call site locations from the IR.
- Extract call site locations from the MemProf profile.
- Undrift the call site locations with longestCommonSequence.
This patch implements the first bullet point above. Specifically,
given the IR, the new function returns a map from caller GUIDs to
lists of corresponding call sites. For example:
Given:
foo() {
f1();
f2(); f3();
}
extractCallsFromIR returns:
Caller: foo ->
{{(Line 1, Column 3), Callee: f1},
{(Line 2, Column 3), Callee: f2},
{(Line 2, Column 9), Callee: f3}}
where the line numbers, relative to the beginning of the caller, and
column numbers are sorted in the ascending order. The value side of
the map -- the list of call sites -- can be directly passed to
longestCommonSequence.
To facilitate the review process, I've only implemented basic features
in extractCallsFromIR in this patch.
- The new function extracts calls from the LLVM "call" instructions
only. It does not look into the inline stack.
- It does not recognize or treat heap allocation functions in any
special way.
I will address these missing features in subsequent patches.
show more ...
|