1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/lib
Hongtao Yu 45a66978f9 [CSSPGO] Report zero-count probe in profile instead of dangling probes.
Previously dangling samples were represented by INT64_MAX in sample profile while probes never executed were not reported. This was based on an observation that dangling probes were only at a smaller portion than zero-count probes. However, with compiler optimizations, dangling probes end up becoming at large portion of all probes in general and reporting them does not make sense from profile size point of view. This change flips sample reporting by reporting zero-count probes instead. This enabled dangling probe to be represented by none (missing entry in profile). This has a couple benefits:

1. Reducing sample profile size in optimize mode, even when the number of non-executed probes outperform the number of dangling probes, since INT64_MAX takes more space over 0 to encode.

2. Binary size savings. No need to encode dangling probe anymore, since missing probes are treated as dangling in the profile reader.

3. Reducing compiler work to track dangling probes. However, for probes that are real dead and removed, we still need the compiler to identify them so that they can be reported as zero-count, instead of mistreated as dangling probes.

4. Improving counts quality by respecting the counts already collected on the non-dangling copy of a probe. A probe, when duplicated, gets two copies at runtime. If one of them is dangling while the other is not, merging the two probes at profile generation time will cause the real samples collected on the non-dangling one to be discarded. Not reporting the dangling counterpart will keep the real samples.

5. Better readability.

6. Be consistent with non-CS dwarf line number based profile. Zero counts are trusted by the compiler counts inferencer while missing counts will be inferred by the compiler.

Note that the current patch does include any work for #3. There will be follow-up changes.

For #1, I've seen for a large Facebook service, the text profile is reduced by 7%. For extbinary profile, the size of  LBRProfileSection is reduced by 35%.

For #4, I have seen general counts quality for SPEC2017 is improved by 10%.

Reviewed By: wenlei, wlei, wmi

Differential Revision: https://reviews.llvm.org/D104129
2021-06-16 11:45:29 -07:00
..
Analysis [InstSimplify] propagate poison through FP ops 2021-06-16 11:31:58 -04:00
AsmParser [LLParser] Remove outdated deplibs 2021-06-14 12:46:12 +08:00
BinaryFormat [AIX][XCOFF] emit vector info of traceback table. 2021-06-14 11:15:22 -04:00
Bitcode Move some code under NDEBUG from D103135 2021-06-14 11:39:12 -07:00
Bitstream
CodeGen [M68k][GloballSel] Adding initial GlobalISel infrastructure 2021-06-16 10:48:38 -06:00
DebugInfo [Debug-Info][CodeView] Fix GUID string generation for MSVC generated objects. 2021-06-15 06:53:21 +01:00
Demangle [Demangle][Rust] Parse const backreferences 2021-06-08 10:01:50 +02:00
DWARFLinker [MC] Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo 2021-05-23 14:15:23 -07:00
ExecutionEngine [ORC] Switch to WrapperFunction utility for calls to registration functions. 2021-06-16 18:05:58 +10:00
Extensions
FileCheck Fix PR46880: Fail CHECK-NOT with undefined variable 2021-04-20 14:42:46 +01:00
Frontend [OPENMP]Fix PR50129: omp cancel parallel not working as expected. 2021-06-04 08:24:55 -07:00
Fuzzer
FuzzMutate [FuzzMutate] Fix getWeight of InstDeleterIRStrategy 2021-06-08 11:14:33 -07:00
InterfaceStub
IR [OpaquePtr] Verify Opaque pointer in function parameter 2021-06-15 14:57:48 -07:00
IRReader [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
LineEditor
Linker Linker: Avoid scheduling the link of a global value twice due to an alias 2021-04-28 13:22:10 -07:00
LTO [LTO] Support new PM in ThinLTOCodeGenerator. 2021-06-09 10:05:14 +01:00
MC Implement DW_CFA_LLVM_* for Heterogeneous Debugging 2021-06-14 08:51:50 +05:30
MCA Reapply "[MCA] Adding the CustomBehaviour class to llvm-mca". 2021-06-16 16:54:48 +01:00
Object [AIX][XCOFF] emit vector info of traceback table. 2021-06-14 11:15:22 -04:00
ObjectYAML [obj2yaml] Address D104035 review comments 2021-06-16 15:01:54 +01:00
Option
Passes [NewPM] Remove SpeculateAroundPHIs pass 2021-06-15 20:35:55 +03:00
ProfileData [CSSPGO] Report zero-count probe in profile instead of dangling probes. 2021-06-16 11:45:29 -07:00
Remarks [Support] Don't include VirtualFileSystem.h in CommandLine.h 2021-04-21 10:19:01 -04:00
Support Allow signposts to take advantage of deferred string substitution 2021-06-14 16:53:41 -07:00
TableGen DetailedRecordsBackend.cpp - printSectionHeading - avoid std::string creation/copies. 2021-06-13 16:49:40 +01:00
Target RISCVFixupKinds.h: Don’t duplicate function or class name at the beginning of the comment && fix some comments 2021-06-16 10:42:43 -07:00
Testing Fix for error "'Run' overrides a member function but is not marked 2021-06-11 06:56:00 -07:00
TextAPI Reland "[llvm] llvm-tapi-diff" 2021-06-09 21:17:34 -07:00
ToolDrivers [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
Transforms [FuncSpec] Statistics 2021-06-16 09:11:51 +01:00
WindowsManifest
XRay
CMakeLists.txt