llvm-project/llvm/lib
Hongtao Yu ad2a59f584 [CSSPGO] Introducing dangling pseudo probes.
Dangling probes are the probes associated to an empty block. This usually happens when all real instructions are optimized away from the block. There is a problem with dangling probes during the offline counts processing. The way the sample profiler works is that samples collected on the first physical instruction following a probe will be counted towards the probe. This logically equals to treating the instruction next to a probe as if it is from the same block of the probe. In the dangling probe case, the real instruction following a dangling probe actually starts a new block, and samples collected on the new block may cause issues when counted towards the empty block.

To mitigate this issue, we first try to move around a dangling probe inside its owning block. If there are still native instructions preceding the probe in the same block, we can then use them as a place holder to collect samples for the probe. A pass is added to walk each block backwards looking for probes not followed by any real instruction and moving them before the first real instruction. This is done right before the object emission.

If we are unlucky to find such in-block preceding instructions for a probe, the solution we are taking is to tag such probe as dangling so that the samples reported for them will not be trusted by the compiler. We leave it up to the counts inference algorithm to get such probes a reasonable count. The number `UINT64_MAX` is used to mark sample count as collected for a dangling probe.

Reviewed By: wmi

Differential Revision: https://reviews.llvm.org/D95962
2021-03-03 22:44:41 -08:00
..
Analysis [Analysis] simplify propagation of FMF in recurrences; NFC 2021-03-03 17:28:10 -05:00
AsmParser Encode alignment attribute for `cmpxchg` 2021-02-11 15:17:50 -05:00
BinaryFormat [Debuginfo][DW_OP_implicit_pointer] (1/7) Support for DW_OP_LLVM_implicit_pointer 2021-01-15 14:45:04 +05:30
Bitcode Fix unstable SmallPtrSet iteration issues due to collectUsedGlobalVariables 2021-02-23 16:09:05 -08:00
Bitstream [llvm] Use llvm::append_range (NFC) 2021-01-06 18:27:33 -08:00
CodeGen [CSSPGO] Introducing dangling pseudo probes. 2021-03-03 22:44:41 -08:00
DWARFLinker [llvm] Add assertions for the smart pointers with the possibility to be null in DWARFLinker::loadClangModule 2021-02-27 10:14:39 +03:00
DebugInfo [PDB] Fix unsigned integer overflow 2021-02-26 11:26:53 -05:00
Demangle [Demangle] Support demangling Swift calling convention in MS demangler. 2021-01-27 13:24:54 -08:00
ExecutionEngine [Orc] Fix MSVC error: conversion from 'initializer list' requires a narrowing 2021-03-02 15:34:36 +01:00
Extensions llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
FileCheck [FileCheck] Do not skip end of line in diagnostics 2021-03-03 08:20:39 +00:00
Frontend [OpenMPIRBuilder] Implement collapseLoops. 2021-02-03 19:12:02 -06:00
FuzzMutate [FuzzMutate] Add mutator to modify instruction flags. 2021-01-23 19:05:20 +00:00
Fuzzer
IR Sink routine for replacing a operand bundle to CallBase [NFC] 2021-03-03 12:07:55 -08:00
IRReader static const char *const foo => const char foo[] 2020-12-01 10:33:18 -08:00
InterfaceStub [elfabi] Fix a bug when .dynsym contains no non-local symbol 2021-02-19 11:36:53 -08:00
LTO [IRSymTab] Set FB_used on llvm.compiler.used symbols 2021-03-03 16:22:30 -08:00
LineEditor llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
Linker [llvm-link] fix IRMover returning wrong modified vector type 2021-02-22 11:29:42 +00:00
MC [AIX][TLS] Generate TLS variables in assembly files 2021-03-02 18:22:48 -06:00
MCA [llvm] Use llvm::find (NFC) 2021-01-19 20:19:14 -08:00
Object [IRSymTab] Set FB_used on llvm.compiler.used symbols 2021-03-03 16:22:30 -08:00
ObjectYAML [obj2yaml,yaml2obj] Add NumBlocks to the BBAddrMapEntry yaml field. 2021-02-22 18:08:26 -08:00
Option [clang][cli] NFC: Remove ArgList infrastructure for recording queries 2021-02-25 13:53:24 +01:00
Passes [ThinLTO][NewPM] Clean up dead code under -O0 2021-02-24 17:08:57 -08:00
ProfileData [CSSPGO] Introducing dangling pseudo probes. 2021-03-03 22:44:41 -08:00
Remarks [llvm] Use append_range (NFC) 2021-01-27 23:25:41 -08:00
Support Revert "Use the default seed value for djb hash for StringMap" 2021-03-01 14:00:39 +01:00
TableGen Revert "[TableGen] Improve algorithms for processing template arguments" 2021-02-18 09:26:26 -05:00
Target [AArch64] Add implicit uses for operands when expanding BLR_RVMARKER. 2021-03-03 21:56:05 +00:00
Testing [clangd] Implement semanticTokens modifiers 2021-02-09 16:31:22 +01:00
TextAPI [lld-macho] Change loadReexport to handle the case where a TAPI re-exports to reference documents nested within other TBD. 2021-03-02 12:14:31 -05:00
ToolDrivers llvm-lib: Pull error printing code out of two functions 2021-01-26 19:13:30 -05:00
Transforms [Attributor] Make DepClass a required argument 2021-03-04 00:35:52 -06:00
WindowsManifest llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
XRay [lib/Object, tools] - Make ELFObjectFile::getELFFile return reference. 2020-12-04 16:02:29 +03:00
CMakeLists.txt llvmbuildectomy - support disabled native target 2020-11-13 15:50:13 +01:00