aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineLoopUtils.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-03-23 19:50:15 -0700
committerGitHub <noreply@github.com>2024-03-23 19:50:15 -0700
commit74799f424063a2d751e0f9ea698db1f4efd0d8b2 (patch)
tree293b0e30843ddc22326ad5540e2ebdba6a183109 /llvm/lib/CodeGen/MachineLoopUtils.cpp
parent7c9b5228da94a44f5e3948814d896de537d162bb (diff)
downloadllvm-74799f424063a2d751e0f9ea698db1f4efd0d8b2.zip
llvm-74799f424063a2d751e0f9ea698db1f4efd0d8b2.tar.gz
llvm-74799f424063a2d751e0f9ea698db1f4efd0d8b2.tar.bz2
[memprof] Add call stack IDs to IndexedAllocationInfo (#85888)
The indexed MemProf file has a huge amount of redundancy. In a large internal application, 82% of call stacks, stored in IndexedAllocationInfo::CallStack, are duplicates. We should work toward deduplicating call stacks by referring to them with unique IDs with actual call stacks stored in a separate data structure, much like we refer to memprof::Frame with memprof::FrameId. At the same time, we need to facilitate a graceful transition from the current version of the MemProf format to the next. We should be able to read (but not write) the current version of the MemProf file even after we move onto the next one. With those goals in mind, I propose to have an integer ID next to CallStack in IndexedAllocationInfo to refer to a call stack in a succinct manner. We'll gradually increase the areas of the compiler where IDs and call stacks have one-to-one correspondence and eventually remove the existing CallStack field. This patch adds call stack ID, named CSId, to IndexedAllocationInfo and teaches the raw profile reader to compute unique call stack IDs and store them in the new field. It does not introduce any user of the call stack IDs yet, except in verifyFunctionProfileData.
Diffstat (limited to 'llvm/lib/CodeGen/MachineLoopUtils.cpp')
0 files changed, 0 insertions, 0 deletions