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 1b193b8bb3 [CSSPGO][llvm-profgen] Context-sensitive global pre-inliner
This change sets up a framework in llvm-profgen to estimate inline decision and adjust context-sensitive profile based on that. We call it a global pre-inliner in llvm-profgen.

It will serve two purposes:
  1) Since context profile for not inlined context will be merged into base profile, if we estimate a context will not be inlined, we can merge the context profile in the output to save profile size.
  2) For thinLTO, when a context involving functions from different modules is not inined, we can't merge functions profiles across modules, leading to suboptimal post-inline count quality. By estimating some inline decisions, we would be able to adjust/merge context profiles beforehand as a mitigation.

Compiler inline heuristic uses inline cost which is not available in llvm-profgen. But since inline cost is closely related to size, we could get an estimate through function size from debug info. Because the size we have in llvm-profgen is the final size, it could also be more accurate than the inline cost estimation in the compiler.

This change only has the framework, with a few TODOs left for follow up patches for a complete implementation:
  1) We need to retrieve size for funciton//inlinee from debug info for inlining estimation. Currently we use number of samples in a profile as place holder for size estimation.
  2) Currently the thresholds are using the values used by sample loader inliner. But they need to be tuned since the size here is fully optimized machine code size, instead of inline cost based on not yet fully optimized IR.

Differential Revision: https://reviews.llvm.org/D99146
2021-03-29 09:46:14 -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][llvm-profgen] Context-sensitive global pre-inliner 2021-03-29 09:46:14 -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][llvm-profgen] Context-sensitive global pre-inliner 2021-03-29 09:46:14 -07:00
ProfileGenerator.h [CSSPGO][llvm-profgen] Context-sensitive global pre-inliner 2021-03-29 09:46:14 -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