[PATCH] D128143: [MemProf] Update metadata during inlining

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 19 10:19:09 PDT 2022


tejohnson created this revision.
tejohnson added reviewers: snehasish, davidxl.
Herald added a subscriber: hiraditya.
Herald added a project: All.
tejohnson requested review of this revision.
Herald added a project: LLVM.

Update both memprof and callsite metadata to reflect inlined functions.

For callsite metadata this is simply a concatenation of each cloned
call's call stack with that of the inlined callsite's.

For memprof metadata, each profiled memory info block (MIB) is either
moved to the cloned allocation call or left on the original allocation
call depending on whether its context matches the newly refined call
stack context on the cloned call. We also reapply context trimming
optimizations based on the refined set of contexts on each of the calls
(cloned and original).

Depends on D128142 <https://reviews.llvm.org/D128142>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128143

Files:
  llvm/include/llvm/Analysis/MemoryProfileInfo.h
  llvm/include/llvm/Transforms/Utils/Cloning.h
  llvm/lib/Analysis/MemoryProfileInfo.cpp
  llvm/lib/Transforms/Utils/CloneFunction.cpp
  llvm/lib/Transforms/Utils/InlineFunction.cpp
  llvm/test/Transforms/Inline/memprof_inline.ll
  llvm/test/Transforms/Inline/memprof_inline2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128143.438202.patch
Type: text/x-patch
Size: 40823 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220619/02a213b6/attachment-0001.bin>


More information about the llvm-commits mailing list