1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/tools/llvm-profgen
Wenlei He 3e6a01ab89 [CSSPGO] Fix dangling context strings and improve profile order consistency and error handling
This patch fixed the following issues along side with some refactoring:

1. Fix bugs where StringRef for context string out live the underlying std::string. We now keep string table in profile generator to hold std::strings. We also do the same for bracketed context strings in profile writer.
2. Make sure profile output strictly follow (total sample, name) order. Previously, there's inconsistency between ProfileMap's key and FunctionSamples's name, leading to inconsistent ordering. This is now fixed by introducing context profile canonicalization. Assertions are also added to make sure ProfileMap's key and FunctionSamples's name are always consistent.
3. Enhanced error handling for profile writing to make sure we bubble up errors properly for both llvm-profgen and llvm-profdata when string table is not populated correctly for extended binary profile.
4. Keep all internal context representation bracket free. This avoids creating new strings for context trimming, merging and preinline. getNameWithContext API is now simplied accordingly.
5. Factor out the code for context trimming and merging into SampleContextTrimmer in SampleProf.cpp. This enables llvm-profdata to use the trimmer when merging profiles. Changes in llvm-profgen will be in separate patch.

Differential Revision: https://reviews.llvm.org/D100090
2021-04-10 12:39:10 -07:00
..
CallContext.h [CSSPGO][llvm-profgen] Instruction symbolization 2020-11-20 14:26:27 -08:00
CMakeLists.txt [CSSPGO][llvm-profgen] Context-sensitive global pre-inliner 2021-03-29 09:46:14 -07:00
CSPreInliner.cpp [CSSPGO] Fix dangling context strings and improve profile order consistency and error handling 2021-04-10 12:39:10 -07:00
CSPreInliner.h [CSSPGO][llvm-profgen] Context-sensitive global pre-inliner 2021-03-29 09:46:14 -07:00
ErrorHandling.h
llvm-profgen.cpp [CSSPGO][llvm-profgen] Renovate perfscript check and command line input validation 2021-02-12 15:18:50 -08:00
PerfReader.cpp [CSSPGO] Add attribute metadata for context profile 2021-03-18 22:00:56 -07:00
PerfReader.h [CSSPGO] Add attribute metadata for context profile 2021-03-18 22:00:56 -07:00
ProfiledBinary.cpp [CSSPGO] Add attribute metadata for context profile 2021-03-18 22:00:56 -07:00
ProfiledBinary.h [CSSPGO] Add attribute metadata for context profile 2021-03-18 22:00:56 -07:00
ProfileGenerator.cpp [CSSPGO] Fix dangling context strings and improve profile order consistency and error handling 2021-04-10 12:39:10 -07:00
ProfileGenerator.h [CSSPGO] Fix dangling context strings and improve profile order consistency and error handling 2021-04-10 12:39:10 -07:00
PseudoProbe.cpp [CSSPGO][llvm-profgen] Fix getCanonicalFnName usage in llvm-profgen 2021-03-15 21:00:42 -07:00
PseudoProbe.h [CSSPGO][llvm-profgen] Compress recursive cycles in calling context 2021-02-03 22:16:07 -08:00