[all-commits] [llvm/llvm-project] 320976: [ctx_prof] Add Inlining support (#106154)
Mircea Trofin via All-commits
all-commits at lists.llvm.org
Tue Sep 3 16:14:27 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 3209766608d14fbb0add96916a28c3f98fed9460
https://github.com/llvm/llvm-project/commit/3209766608d14fbb0add96916a28c3f98fed9460
Author: Mircea Trofin <mtrofin at google.com>
Date: 2024-09-03 (Tue, 03 Sep 2024)
Changed paths:
M llvm/include/llvm/Analysis/CtxProfAnalysis.h
M llvm/include/llvm/IR/IntrinsicInst.h
M llvm/include/llvm/ProfileData/PGOCtxProfReader.h
M llvm/include/llvm/Transforms/Utils/Cloning.h
M llvm/lib/Analysis/CtxProfAnalysis.cpp
M llvm/lib/Transforms/IPO/ModuleInliner.cpp
M llvm/lib/Transforms/Utils/InlineFunction.cpp
M llvm/test/Analysis/CtxProfAnalysis/full-cycle.ll
A llvm/test/Analysis/CtxProfAnalysis/inline.ll
A llvm/test/Analysis/CtxProfAnalysis/json_equals.py
M llvm/test/Analysis/CtxProfAnalysis/load.ll
M llvm/unittests/Transforms/Utils/CallPromotionUtilsTest.cpp
Log Message:
-----------
[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.
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