diff options
author | Mircea Trofin <mtrofin@google.com> | 2024-09-03 16:14:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-03 16:14:05 -0700 |
commit | 3209766608d14fbb0add96916a28c3f98fed9460 (patch) | |
tree | bc7b2ed03678702f754bcf16a4d207926f429c98 /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | b24a304435632710bb54a0cd9cda1757abb8c160 (diff) | |
download | llvm-3209766608d14fbb0add96916a28c3f98fed9460.zip llvm-3209766608d14fbb0add96916a28c3f98fed9460.tar.gz llvm-3209766608d14fbb0add96916a28c3f98fed9460.tar.bz2 |
[ctx_prof] Add Inlining support (#106154)
Add an overload of `InlineFunction` that updates the contextual profile. If there is no contextual profile, this overload is equivalent to the non-contextual profile variant.
Post-inlining, the update mainly consists of:
- making the PGO instrumentation of the callee "the caller's": the owner function (the "name" parameter of the instrumentation instructions) becomes the caller, and new index values are allocated for each of the callee's indices (this happens for both increment and callsite instrumentation instructions)
- in the contextual profile:
- each context corresponding to the caller has its counters updated to incorporate the counters inherited from the callee at the inlined callsite. Counter values are copied as-is because no scaling is required since the profile is contextual.
- the contexts of the callee (at the inlined callsite) are moved to the caller.
- the callee context at the inlined callsite is deleted.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
0 files changed, 0 insertions, 0 deletions