1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/lib/IR
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
..
AbstractCallSite.cpp
AsmWriter.cpp [NFC][IR][AsmWriter] Fix Wreturn-type gcc warning 2021-01-28 16:42:30 +08:00
Assumptions.cpp [Clang][Attr] Introduce the assume function attribute 2020-12-15 16:51:34 -06:00
AttributeImpl.h Reapply "OpaquePtr: Add type to sret attribute" 2020-10-16 11:05:02 -04:00
Attributes.cpp Support for instrumenting only selected files or functions 2021-01-26 17:13:34 -08:00
AutoUpgrade.cpp Revert "[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV" 2021-01-25 13:53:38 -08:00
BasicBlock.cpp [OpenMPIRBuilder] Implement tileLoops. 2021-01-23 19:39:29 -06:00
CMakeLists.txt [HIP] Support __managed__ attribute 2021-01-22 11:43:58 -05:00
Comdat.cpp
ConstantFold.cpp [Constant] Add containsPoisonElement 2021-01-06 12:10:33 +09:00
ConstantFold.h
ConstantRange.cpp [ConstantRange] Introduce getMinSignedBits() method 2020-09-22 21:37:30 +03:00
Constants.cpp [llvm] Use llvm::all_of (NFC) 2021-01-06 18:27:36 -08:00
ConstantsContext.h
Core.cpp [llvm] Don't include StringSwitch.h where unnecessary (NFC) 2021-01-21 19:59:48 -08:00
DataLayout.cpp [IR] Allow scalable vectors in structs to support intrinsics returning multiple values. 2021-01-17 23:29:51 -08:00
DebugInfo.cpp Migrate deprecated DebugLoc::get to DILocation::get 2020-12-11 12:45:22 -08:00
DebugInfoMetadata.cpp [Debuginfo][DW_OP_implicit_pointer] (1/7) Support for DW_OP_LLVM_implicit_pointer 2021-01-15 14:45:04 +05:30
DebugLoc.cpp [IR] Delete unused ReplaceLast in DebugLoc::appendInlineAt 2021-01-08 23:28:22 -08:00
DiagnosticHandler.cpp
DiagnosticInfo.cpp [Support] Introduce a new InstructionCost class 2020-12-11 08:12:54 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp [DebugInfo] Support Fortran 'use <external module>' statement. 2020-12-18 13:10:57 -05:00
Dominators.cpp [DomTree] Make assert more precise 2020-10-22 22:40:06 +02:00
FPEnv.cpp
Function.cpp Allow nonnull/align attribute to accept poison 2021-01-20 11:31:23 +09:00
Globals.cpp Add a default address space for globals to DataLayout 2020-11-20 15:46:52 +00:00
GVMaterializer.cpp
InlineAsm.cpp
Instruction.cpp Revert "[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV" 2021-01-25 13:53:38 -08:00
Instructions.cpp [IR] CallBase::getBundleOpInfoForOperand - ensure Current iterator is defined. NFCI. 2021-01-04 15:30:15 +00:00
IntrinsicInst.cpp [VP] Build VP SDNodes 2020-12-09 11:36:51 +01:00
IRBuilder.cpp [SVE][LoopVectorize] Add masked load/store and gather/scatter support for SVE 2021-02-02 09:52:39 +00:00
IRPrintingPasses.cpp [NewPM] Support --print-before/after in NPM 2020-12-03 16:52:14 -08:00
LegacyPassManager.cpp [LegacyPM] Update InversedLastUser on the fly. NFC. 2021-01-22 09:48:54 +00:00
LLVMContext.cpp [Remarks][2/2] Expand remarks hotness threshold option support in more tools 2020-11-30 21:55:50 -08:00
LLVMContextImpl.cpp [llvm] Construct SmallVector with iterator ranges (NFC) 2021-01-16 09:40:53 -08:00
LLVMContextImpl.h [X86] Add x86_amx type for intel AMX. 2020-12-30 13:52:13 +08:00
LLVMRemarkStreamer.cpp [Remarks][2/2] Expand remarks hotness threshold option support in more tools 2020-11-30 21:55:50 -08:00
Mangler.cpp [llvm] Use isAlpha/isAlnum (NFC) 2021-01-22 23:25:03 -08:00
MDBuilder.cpp [CSSPGO] Pseudo probe encoding and emission. 2020-12-10 17:29:28 -08:00
Metadata.cpp [Analysis, IR, CodeGen] Use llvm::erase_if (NFC) 2020-12-20 09:19:35 -08:00
MetadataImpl.h
Module.cpp Refactor how -fno-semantic-interposition sets dso_local on default visibility external linkage definitions 2020-12-31 13:59:45 -08:00
ModuleSummaryIndex.cpp [ThinLTO] Add Visibility bits to GlobalValueSummary::GVFlags 2021-01-27 10:43:51 -08:00
Operator.cpp
OptBisect.cpp Make NPM OptBisectInstrumentation use global singleton OptBisect 2020-12-20 13:47:56 -08:00
Pass.cpp [PM] Avoid duplicates in the Used/Preserved/Required sets 2021-01-20 13:55:18 +01:00
PassInstrumentation.cpp [NewPM] Don't error when there's an unrecognized pass name 2021-01-07 22:33:32 -08:00
PassManager.cpp [NewPM] Make pass adaptors less templatey 2020-12-04 08:30:50 -08:00
PassRegistry.cpp [Analysis, IR] Use *Map::lookup (NFC) 2020-12-29 19:23:24 -08:00
PassTimingInfo.cpp [Time-report] Add a flag -ftime-report={per-pass,per-pass-run} to control the pass timing aggregation 2020-12-08 10:13:19 -08:00
PrintPasses.cpp [IR] Use llvm::is_contained (NFC) 2020-12-08 19:06:37 -08:00
ProfileSummary.cpp
PseudoProbe.cpp [CSSPGO] Introducing distribution factor for pseudo probe. 2021-02-02 11:55:01 -08:00
ReplaceConstant.cpp [HIP] Support __managed__ attribute 2021-01-22 11:43:58 -05:00
SafepointIRVerifier.cpp [llvm] Use append_range (NFC) 2021-01-27 23:25:41 -08:00
Statepoint.cpp
StructuralHash.cpp
SymbolTableListTraitsImpl.h
Type.cpp [IR] Allow scalable vectors in structs to support intrinsics returning multiple values. 2021-01-17 23:29:51 -08:00
TypeFinder.cpp
Use.cpp
User.cpp
Value.cpp [NFC][LICM] Minor improvements to debug output 2021-01-11 18:02:49 -08:00
ValueSymbolTable.cpp
Verifier.cpp Revert "[Verifier] enable llvm.experimental.noalias.scope.decl dominance check." 2021-02-01 14:38:33 +01:00