1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 10:32:48 +02:00
llvm-mirror/tools/llvm-profgen
wlei 4683e274de [CSSPGO][llvm-profgen] Compress recursive cycles in calling context
This change compresses the context string by removing cycles due to recursive function for CS profile generation. Removing recursion cycles is a way to normalize the calling context which will be better for the sample aggregation and also make the context promoting deterministic.
Specifically for implementation, we recognize adjacent repeated frames as cycles and deduplicated them through multiple round of iteration.
For example:
Considering a input context string stack:
[“a”, “a”, “b”, “c”, “a”, “b”, “c”, “b”, “c”, “d”]
For first iteration,, it removed all adjacent repeated frames of size 1:
[“a”, “b”, “c”, “a”, “b”, “c”, “b”, “c”, “d”]
For second iteration, it removed all adjacent repeated frames of size 2:
[“a”, “b”, “c”, “a”, “b”, “c”, “d”]
So in the end, we get compressed output:
[“a”, “b”, “c”, “d”]

Compression will be called in two place: one for sample's context key right after unwinding, one is for the eventual context string id in the ProfileGenerator.
Added a switch `compress-recursion` to control the size of duplicated frames, default -1 means no size limit.
Added unit tests and regression test for this.

Differential Revision: https://reviews.llvm.org/D93556
2021-02-03 18:50:14 -08:00
..
CallContext.h [CSSPGO][llvm-profgen] Instruction symbolization 2020-11-20 14:26:27 -08:00
CMakeLists.txt [CSSPGO][llvm-profgen] Pseudo probe decoding and disassembling 2021-01-13 11:02:57 -08:00
ErrorHandling.h
llvm-profgen.cpp llvm-profgen: Parse command line arguments after initializing targets 2020-12-21 15:13:10 -08:00
PerfReader.cpp [CSSPGO][llvm-profgen] Compress recursive cycles in calling context 2021-02-03 18:50:14 -08:00
PerfReader.h [CSSPGO][llvm-profgen] Virtual unwinding with pseudo probe 2021-01-13 11:02:58 -08:00
ProfiledBinary.cpp [CSSPGO][llvm-profgen] Compress recursive cycles in calling context 2021-02-03 18:50:14 -08:00
ProfiledBinary.h [CSSPGO][llvm-profgen] Compress recursive cycles in calling context 2021-02-03 18:50:14 -08:00
ProfileGenerator.cpp [CSSPGO][llvm-profgen] Compress recursive cycles in calling context 2021-02-03 18:50:14 -08:00
ProfileGenerator.h [CSSPGO][llvm-profgen] Compress recursive cycles in calling context 2021-02-03 18:50:14 -08:00
PseudoProbe.cpp [CSSPGO][llvm-profgen] Compress recursive cycles in calling context 2021-02-03 18:50:14 -08:00
PseudoProbe.h [CSSPGO][llvm-profgen] Compress recursive cycles in calling context 2021-02-03 18:50:14 -08:00