[all-commits] [llvm/llvm-project] 5ce286: [CGProfile] Use callee's PGO name when caller->cal...
Mingming Liu via All-commits
all-commits at lists.llvm.org
Mon Jan 22 10:36:15 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5ce286849a0cc605210031411265c2a84fc6c633
https://github.com/llvm/llvm-project/commit/5ce286849a0cc605210031411265c2a84fc6c633
Author: Mingming Liu <mingmingl at google.com>
Date: 2024-01-22 (Mon, 22 Jan 2024)
Changed paths:
M llvm/include/llvm/Transforms/Instrumentation/CGProfile.h
M llvm/lib/Passes/PassBuilder.cpp
M llvm/lib/Passes/PassBuilderPipelines.cpp
M llvm/lib/Passes/PassRegistry.def
M llvm/lib/Transforms/Instrumentation/CGProfile.cpp
M llvm/test/Instrumentation/cgprofile.ll
Log Message:
-----------
[CGProfile] Use callee's PGO name when caller->callee is an indirect call. (#78610)
- With PGO, indirect call edges are constructed using value profiles, and the profile address is mapped to a function's PGO name. The PGO name is computed using a functions linkage before LTO internalization or global promotion.
- With ThinLTO, local functions [could be
promoted](https://github.com/llvm/llvm-project/blob/2663d2cb9c9361f0b234c40a0f50c7ba0748eb26/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp#L288) to have external linkage; and with
[full](https://github.com/llvm/llvm-project/blob/2663d2cb9c9361f0b234c40a0f50c7ba0748eb26/llvm/lib/LTO/LTO.cpp#L1328)
or
[thin](https://github.com/llvm/llvm-project/blob/2663d2cb9c9361f0b234c40a0f50c7ba0748eb26/llvm/lib/LTO/LTO.cpp#L448)
LTO, global functions could be internalized. Edge construction should use a function's PGO name before its linkage is updated.
More information about the All-commits
mailing list