aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2025-10-31 06:48:02 -0700
committerGitHub <noreply@github.com>2025-10-31 08:48:02 -0500
commitc8e2f433798d81304a3a248e0b15098fc4779896 (patch)
tree3f4f995f169eb77b0ae55a53a22509d03fb39447 /clang/lib/Frontend/CompilerInvocation.cpp
parentdeb54ba0cbab1e9c8d2ab0ea8a6e77dbb22b82d9 (diff)
downloadllvm-c8e2f433798d81304a3a248e0b15098fc4779896.zip
llvm-c8e2f433798d81304a3a248e0b15098fc4779896.tar.gz
llvm-c8e2f433798d81304a3a248e0b15098fc4779896.tar.bz2
[MemProf] Select largest of matching contexts from profile (#165338)
We aren't currently deduplicating contexts that are identical or nearly identical (differing inline frame information) when generating the profile. When we have multiple identical contexts we end up conservatively marking it as non-cold, even if some are much smaller in terms of bytes allocated. This was causing us to lose sight of a very large cold context, because we had a small non-cold one that only differed in the inlining (which we don't consider when matching as the inlining could change or be incomplete at that point in compilation). Likely the smaller one was from binary with much smaller usage and therefore not yet detected as cold. Deduplicate the alloc contexts for a function before applying the profile, selecting the largest one, or conservatively selecting the non-cold one if they are the same size. This caused a minor difference to an existing test (memprof_loop_unroll.ll), which now only gets one message for the duplicate context instead of 2. While here, convert to the text version of the profile.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions