[llvm-profdata] Improve profile supplementation
authorRong Xu <xur@google.com>
Wed, 24 Aug 2022 18:54:06 +0000 (11:54 -0700)
committerRong Xu <xur@google.com>
Mon, 29 Aug 2022 23:50:42 +0000 (16:50 -0700)
commitd7ef0c3970c238af40f3d184f900d20fd2308d7f
tree6acff5f2687a94e7477d39d4eff386a8f0aa946b
parente1bb203755bc8f797ca4e3b2160732f9ef9b356a
[llvm-profdata] Improve profile supplementation

Current implementation promotes a non-cold function in the SampleFDO profile
into a hot function in the FDO profile. This is too aggressive. This patch
promotes a hot functions in the SampleFDO profile into a hot function, and a
warm function in SampleFDO into a warm function in FDO.

Differential Revision: https://reviews.llvm.org/D132601
17 files changed:
llvm/include/llvm/ProfileData/InstrProf.h
llvm/lib/ProfileData/InstrProf.cpp
llvm/lib/ProfileData/ProfileSummaryBuilder.cpp
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
llvm/test/Transforms/PGOProfile/Inputs/sample-profile-hot.proftext [moved from llvm/test/Transforms/PGOProfile/Inputs/sample-profile.proftext with 100% similarity]
llvm/test/Transforms/PGOProfile/Inputs/sample-profile-warm.proftext [new file with mode: 0644]
llvm/test/Transforms/PGOProfile/Inputs/suppl-profile.proftext
llvm/test/Transforms/PGOProfile/suppl-profile.ll
llvm/test/tools/llvm-profdata/Inputs/overflow-instr.proftext
llvm/test/tools/llvm-profdata/Inputs/pseudo-count-hot.proftext [new file with mode: 0644]
llvm/test/tools/llvm-profdata/Inputs/pseudo-count-warm.proftext [new file with mode: 0644]
llvm/test/tools/llvm-profdata/overflow-instr.test
llvm/test/tools/llvm-profdata/pseudo_count.test [new file with mode: 0644]
llvm/test/tools/llvm-profdata/suppl-instr-with-sample-static-func.test
llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test
llvm/tools/llvm-profdata/llvm-profdata.cpp
llvm/unittests/ProfileData/InstrProfTest.cpp