[all-commits] [llvm/llvm-project] adf0c8: [memprof] Undrift MemProf profile even when some f...
Kazu Hirata via All-commits
all-commits at lists.llvm.org
Fri Dec 20 15:40:30 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: adf0c817f3eb0afc2c9ccc64c806acc7d6c14cd8
https://github.com/llvm/llvm-project/commit/adf0c817f3eb0afc2c9ccc64c806acc7d6c14cd8
Author: Kazu Hirata <kazu at google.com>
Date: 2024-12-20 (Fri, 20 Dec 2024)
Changed paths:
M llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
M llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
A llvm/test/Transforms/PGOProfile/memprof_undrift_missing_leaf.ll
Log Message:
-----------
[memprof] Undrift MemProf profile even when some frames are missing (#120500)
This patch makes the MemProf undrifting process a little more lenient.
Consider an inlined call hierarchy:
foo -> bar -> ::new
If bar tail-calls ::new, the profile appears to indicate that foo
directly calls ::new. This is a problem because the perceived call
hierarchy in the profile looks different from what we can obtain from
the inline stack in the IR.
Recall that undrifting works by constructing and comparing a list of
direct calls from the profile and that from the IR. This patch
modifies the construction of the latter. Specifically, if foo calls
bar in the IR, but bar is missing the profile, we pretend that foo
directly calls some heap allocation function. We apply this
transformation only in the inline stack leading to some heap
allocation function.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list