llvm-project/clang/test
Hongtao Yu 3d89b3cbec [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
..
APINotes [NFC][tests] Replace use of GNUisms in usage of diff 2020-11-08 12:07:51 -05:00
ARCMT [clang][cli] Turn arcmt-* options into a single option 2020-11-18 10:53:41 +01:00
AST [HIP] Support __managed__ attribute 2021-01-22 11:43:58 -05:00
ASTMerge [ASTImporter] Add support for importing GenericSelectionExpr AST nodes. 2020-12-16 15:39:50 -08:00
Analysis [test] Default clang/test to FileCheck --allow-unused-prefixes=false 2021-02-02 11:22:46 -08:00
CXX Revert "DR2064: decltype(E) is only a dependent type if E is type-dependent, not 2021-01-19 12:48:40 -08:00
ClangScanDeps Revert "[clang-scan-deps] Support clang-cl" 2020-12-14 13:32:38 -05:00
CodeCompletion [clang] Enable code completion of designated initializers in Compound Literal Expressions 2020-12-01 12:06:48 +01:00
CodeGen [CSSPGO] Introducing distribution factor for pseudo probe. 2021-02-02 11:55:01 -08:00
CodeGenCUDA [HIP] Support __managed__ attribute 2021-01-22 11:43:58 -05:00
CodeGenCXX [test] Default clang/test to FileCheck --allow-unused-prefixes=false 2021-02-02 11:22:46 -08:00
CodeGenCoroutines [test] Move coro-retcon-unreachable.ll into llvm/test 2021-01-07 14:06:01 -08:00
CodeGenHIP
CodeGenObjC Revert "[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV" 2021-01-25 13:53:38 -08:00
CodeGenObjCXX [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
CodeGenOpenCL [AMDGPU] Set s-memtime-inst feature from clang 2021-02-01 14:20:43 -08:00
CodeGenOpenCLCXX [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
CodeGenSYCL
Coverage
CoverageMapping [Coverage] Fix test failures from commit rG9f2967bcfe2f 2021-01-05 13:35:52 -06:00
Driver [test] Default clang/test to FileCheck --allow-unused-prefixes=false 2021-02-02 11:22:46 -08:00
FixIt
Format [clang-format] PR16518 Add flag to suppress empty line insertion before access modifier 2021-01-25 21:02:41 +01:00
Frontend [test] Use host platform specific error message substitution in lit tests 2021-01-29 07:16:30 -05:00
Headers [test] Add {{.*}} to make tests immune to dso_local/dso_preemptable/(none) differences 2020-12-30 20:52:01 -08:00
Import clang-import-test: Clean up error output for files that cannot be found 2020-12-11 17:07:58 -08:00
Index [ASTReader] Allow controlling separately whether validation should be disabled for a PCH vs a module file 2021-01-21 20:45:54 -08:00
Integration
InterfaceStubs
Layout [Frontend] Add pragma align natural and sort out pragma pack stack effect 2021-01-13 10:53:24 -05:00
Lexer [c++2b] Add tests for feature test macros. 2020-12-18 13:42:23 -08:00
Misc [OpenCL] Refactor of targets OpenCL option settings 2021-01-25 19:50:23 +03:00
Modules [test] Fix unuses FileCheck prefixes in clang/test/Modules 2021-02-01 19:46:23 -08:00
OpenMP [test] Default clang/test to FileCheck --allow-unused-prefixes=false 2021-02-02 11:22:46 -08:00
PCH [clang] Allow LifetimeExtendedTemporary to have no access specifier 2021-01-18 19:19:57 +01:00
Parser Ignore unknown attribute warnings in this test 2021-01-27 15:45:35 -05:00
Preprocessor [RISCV] Update the version number to v0.10 for vector. 2021-01-30 07:20:05 +08:00
Profile [clang] Add -fprofile-prefix-map 2021-01-25 10:14:04 -08:00
Refactor
Rewriter
Sema clang: Fix static_assert in a few contexts in microsoft mode 2021-01-27 18:15:25 -05:00
SemaCUDA [HIP] Support __managed__ attribute 2021-01-22 11:43:58 -05:00
SemaCXX [clang][PATCH][NFC] Correct test case related to review D95482 2021-02-02 07:06:43 -08:00
SemaObjC [clang] Fix message text for `-Wpointer-sign` to account for plain char 2021-01-11 18:41:14 -05:00
SemaObjCXX [Sema] Fix an assertion failure in -Wcompletion-handler 2021-01-25 13:02:02 -05:00
SemaOpenCL [OpenCL] Change extension handling for -fdeclare-opencl-builtins 2021-02-02 11:15:29 +00:00
SemaOpenCLCXX Fixed failing OpenCL test 2021-02-02 16:19:28 +00:00
SemaSYCL Fix missing error for use of 128-bit integer inside SPIR64 device code. 2020-12-07 10:42:32 -08:00
SemaTemplate Revert "Following up on PR48517, fix handling of template arguments that refer" 2021-01-20 15:55:35 +01:00
TableGen
Templight
Tooling [Syntax] Add syntax-tree-dump in clang-check. 2021-01-29 14:10:27 +01:00
Unit
VFS [VFS] Add support to RedirectingFileSystem for mapping a virtual directory to one in the external FS. 2021-02-02 14:56:17 +10:00
clang-rename
utils/update_cc_test_checks [utils] Fix UpdateTestChecks case where 2 runs differ for last label 2020-12-15 07:16:54 -08:00
.clang-format
CMakeLists.txt [clang] Add llvm-strip to test dependencies 2021-01-09 11:57:27 -08:00
TestRunner.sh
cxx-sections.data
lit.cfg.py [test] Default clang/test to FileCheck --allow-unused-prefixes=false 2021-02-02 11:22:46 -08:00
lit.site.cfg.py.in Reland [CMake][NewPM] Move ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER into llvm/ 2020-12-01 14:00:32 -08:00
make_test_dirs.pl