aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/CMakeLists.txt
diff options
context:
space:
mode:
authorHongtao Yu <hoy@fb.com>2020-12-16 12:54:50 -0800
committerHongtao Yu <hoy@fb.com>2020-12-16 15:57:18 -0800
commitac068e014b22548ae1c0dc5ff3dd8821d41f45c0 (patch)
tree22eca06cfe4ca403f7dce19a9c11614bc8696fb1 /llvm/lib/IR/CMakeLists.txt
parent687e80be7fcf75900c354152d8b21500c3b08850 (diff)
downloadllvm-ac068e014b22548ae1c0dc5ff3dd8821d41f45c0.zip
llvm-ac068e014b22548ae1c0dc5ff3dd8821d41f45c0.tar.gz
llvm-ac068e014b22548ae1c0dc5ff3dd8821d41f45c0.tar.bz2
[CSSPGO] Consume pseudo-probe-based AutoFDO profile
This change enables pseudo-probe-based sample counts to be consumed by the sample profile loader under the regular `-fprofile-sample-use` switch with minimal adjustments to the existing sample file formats. After the counts are imported, a probe helper, aka, a `PseudoProbeManager` object, is automatically launched to verify the CFG checksum of every function in the current compilation against the corresponding checksum from the profile. Mismatched checksums will cause a function profile to be slipped. A `SampleProfileProber` pass is scheduled before any of the `SampleProfileLoader` instances so that the CFG checksums as well as probe mappings are available during the profile loading time. The `PseudoProbeManager` object is set up right after the profile reading is done. In the future a CFG-based fuzzy matching could be done in `PseudoProbeManager`. Samples will be applied only to pseudo probe instructions as well as probed callsites once the checksum verification goes through. Those instructions are processed in the same way that regular instructions would be processed in the line-number-based scenario. In other words, a function is processed in a regular way as if it was reduced to just containing pseudo probes (block probes and callsites). **Adjustment to profile format ** A CFG checksum field is being added to the existing AutoFDO profile formats. So far only the text format and the extended binary format are supported. For the text format, a new line like ``` !CFGChecksum: 12345 ``` is added to the end of the body sample lines. For the extended binary profile format, we introduce a metadata section to store the checksum map from function names to their CFG checksums. Differential Revision: https://reviews.llvm.org/D92347
Diffstat (limited to 'llvm/lib/IR/CMakeLists.txt')
-rw-r--r--llvm/lib/IR/CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/IR/CMakeLists.txt b/llvm/lib/IR/CMakeLists.txt
index bb0dc51..ca57012 100644
--- a/llvm/lib/IR/CMakeLists.txt
+++ b/llvm/lib/IR/CMakeLists.txt
@@ -48,6 +48,7 @@ add_llvm_component_library(LLVMCore
PrintPasses.cpp
SafepointIRVerifier.cpp
ProfileSummary.cpp
+ PseudoProbe.cpp
Statepoint.cpp
StructuralHash.cpp
Type.cpp