1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Go to file
Hongtao Yu 3594bb4c1b [CSSPGO] Introducing distribution factor for pseudo probe.
Sample re-annotation is required in LTO time to achieve a reasonable post-inline profile quality. However, we have seen that such LTO-time re-annotation degrades profile quality. This is mainly caused by preLTO code duplication that is done by passes such as loop unrolling, jump threading, indirect call promotion etc, where samples corresponding to a source location are aggregated multiple times due to the duplicates. In this change we are introducing a concept of distribution factor for pseudo probes so that samples can be distributed for duplicated probes scaled by a factor. We hope that optimizations duplicating code well-maintain the branch frequency information (BFI) based on which probe distribution factors are calculated. Distribution factors are updated at the end of preLTO pipeline to reflect an estimated portion of the real execution count.

This change also introduces a pseudo probe verifier that can be run after each IR passes to detect duplicated pseudo probes.

A saturated distribution factor stands for 1.0. A pesudo probe will carry a factor with the value ranged from 0.0 to 1.0. A 64-bit integral distribution factor field that represents [0.0, 1.0] is associated to each block probe. Unfortunately this cannot be done for callsite probes due to the size limitation of a 32-bit Dwarf discriminator. A 7-bit distribution factor is used instead.

Changes are also needed to the sample profile inliner to deal with prorated callsite counts. Call sites duplicated by PreLTO passes, when later on inlined in LTO time, should have the callees’s probe prorated based on the Prelink-computed distribution factors. The distribution factors should also be taken into account when computing hotness for inline candidates. Also, Indirect call promotion results in multiple callisites. The original samples should be distributed across them. This is fixed by adjusting the callisites' distribution factors.

Reviewed By: wmi

Differential Revision: https://reviews.llvm.org/D93264
2021-02-02 11:55:01 -08:00
benchmarks
bindings [Go] Fix bindings/go/llvm/IRBindings.cpp 2020-12-16 10:09:58 -08:00
cmake Fix CMake LLVM_TARGETS_TO_BUILD "Native" option to work with JIT 2021-02-02 18:47:15 +00:00
docs [AMDGPU] Clarify calling conv about inactive lanes 2021-02-02 10:15:09 +01:00
examples [Doc][NFC] Fix Kaleidoscope links, typos and add blog posts for MCJIT 2021-01-25 19:59:36 +05:30
include [CSSPGO] Introducing distribution factor for pseudo probe. 2021-02-02 11:55:01 -08:00
lib [CSSPGO] Introducing distribution factor for pseudo probe. 2021-02-02 11:55:01 -08:00
projects llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
resources
runtimes [CMake] Split the target side of runtimes build 2021-01-11 23:39:36 -08:00
test [CSSPGO] Introducing distribution factor for pseudo probe. 2021-02-02 11:55:01 -08:00
tools [yaml2obj/obj2yaml/llvm-readobj] Support SHF_GNU_RETAIN 2021-02-02 09:19:53 -08:00
unittests Ensure that InstructionCost actually implements a total ordering 2021-02-02 11:49:14 -08:00
utils [TableGen] Use range-based for loops (NFC) 2021-02-01 20:55:09 -08:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt Fix CMake LLVM_TARGETS_TO_BUILD "Native" option to work with JIT 2021-02-02 18:47:15 +00:00
CODE_OWNERS.TXT Change XCore code owner. 2021-01-14 12:13:48 +00:00
configure
CREDITS.TXT [NFC] Add contributors names to CREDITS.TXT 2020-10-07 13:22:55 -04:00
LICENSE.TXT
llvm.spec.in
README.txt
RELEASE_TESTERS.TXT

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.