1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/lib/Transforms/IPO
Hongtao Yu 66121fdf6a [CSSPGO] Consume pseudo-probe-based AutoFDO profile
This change enables pseudo-probe-based sample counts to be consumed by the sample profile loader under the regular `-fprofile-sample-use` switch with minimal adjustments to the existing sample file formats. After the counts are imported, a probe helper, aka, a `PseudoProbeManager` object, is automatically launched to verify the CFG checksum of every function in the current compilation against the corresponding checksum from the profile. Mismatched checksums will cause a function profile to be slipped. A `SampleProfileProber` pass is scheduled before any of the `SampleProfileLoader` instances so that the CFG checksums as well as probe mappings are available during the profile loading time. The `PseudoProbeManager` object is set up right after the profile reading is done. In the future a CFG-based fuzzy matching could be done in `PseudoProbeManager`.

Samples will be applied only to pseudo probe instructions as well as probed callsites once the checksum verification goes through. Those instructions are processed in the same way that regular instructions would be processed in the line-number-based scenario. In other words, a function is processed in a regular way as if it was reduced to just containing pseudo probes (block probes and callsites).

**Adjustment to profile format **

A CFG checksum field is being added to the existing AutoFDO profile formats. So far only the text format and the extended binary format are supported. For the text format, a new line like
```
!CFGChecksum: 12345
```
is added to the end of the body sample lines. For the extended binary profile format, we introduce a metadata section to store the checksum map from function names to their CFG checksums.

Differential Revision: https://reviews.llvm.org/D92347
2020-12-16 15:57:18 -08:00
..
AlwaysInliner.cpp [coroutine] should disable inline before calling coro split 2020-12-08 08:53:08 -08:00
Annotation2Metadata.cpp Add pass to add !annotate metadata from @llvm.global.annotations. 2020-11-16 14:57:11 +00:00
ArgumentPromotion.cpp
Attributor.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
AttributorAttributes.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
BarrierNoopPass.cpp
BlockExtractor.cpp
CalledValuePropagation.cpp
CMakeLists.txt [CSSPGO] Infrastructure for context-sensitive Sample PGO and Inlining 2020-12-06 11:49:18 -08:00
ConstantMerge.cpp
CrossDSOCFI.cpp
DeadArgumentElimination.cpp
ElimAvailExtern.cpp
ExtractGV.cpp
ForceFunctionAttrs.cpp Revert "[IR] add fn attr for no_stack_protector; prevent inlining on mismatch" 2020-11-17 17:27:14 -08:00
FunctionAttrs.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
FunctionImport.cpp
GlobalDCE.cpp
GlobalOpt.cpp [SVE]Clarify TypeSize comparisons in llvm/lib/Transforms 2020-10-23 09:15:17 +01:00
GlobalSplit.cpp
HotColdSplitting.cpp [Transforms] Use is_contained (NFC) 2020-12-12 09:37:49 -08:00
InferFunctionAttrs.cpp
Inliner.cpp [Transforms] Use is_contained (NFC) 2020-12-12 09:37:49 -08:00
InlineSimple.cpp
Internalize.cpp
IPO.cpp Revert "[IRSim][IROutliner] Adding the extraction basics for the IROutliner." 2020-11-27 19:55:57 -06:00
LoopExtractor.cpp
LowerTypeTests.cpp
MergeFunctions.cpp Migrate deprecated DebugLoc::get to DILocation::get 2020-12-11 12:45:22 -08:00
OpenMPOpt.cpp [OpenMP] Use assumptions during ICV tracking 2020-12-15 16:51:34 -06:00
PartialInlining.cpp [PartialInliner]: Handle code regions in a switch stmt cases 2020-11-02 14:32:45 -05:00
PassManagerBuilder.cpp [AnnotationRemarks] Also generate annotation remarks when using -O0. 2020-12-15 14:46:52 +00:00
PruneEH.cpp
SampleContextTracker.cpp [IPO] Fix operator precedence warning. NFCI. 2020-12-07 18:23:54 +00:00
SampleProfile.cpp [CSSPGO] Consume pseudo-probe-based AutoFDO profile 2020-12-16 15:57:18 -08:00
SampleProfileProbe.cpp [CSSPGO] Consume pseudo-probe-based AutoFDO profile 2020-12-16 15:57:18 -08:00
SCCP.cpp
StripDeadPrototypes.cpp
StripSymbols.cpp
SyntheticCountsPropagation.cpp
ThinLTOBitcodeWriter.cpp
WholeProgramDevirt.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00