[CSSPGO] Use probe inline tree to track zero size fully optimized context for pre...
authorWenlei He <aktoon@gmail.com>
Thu, 19 Aug 2021 04:09:49 +0000 (21:09 -0700)
committerWenlei He <aktoon@gmail.com>
Wed, 25 Aug 2021 16:01:11 +0000 (09:01 -0700)
commita6f15e9a49a1a5bcd1ce7f30b1201d977d8a8ede
tree5ba67422289c091927f6f973b0751db20c6006ed
parent498db6ab4382e93ee4239c3aa3be04dfab1b9dc9
[CSSPGO] Use probe inline tree to track zero size fully optimized context for pre-inliner

This is a follow up diff for BinarySizeContextTracker to track zero size for fully optimized inlinee. When an inlinee is fully optimized away, we won't be able to get its size through symbolizing instructions, hence we will treat the corresponding context size as unknown. However by traversing the inlined probe forest, we know what're original inlinees regardless of optimization. If a context show up in inlined probes, but not during symbolization, we know that it's fully optimized away hence its size is zero instead of unknown. It should provide more accurate size cost estimation for pre-inliner to make better inline decisions in llvm-profgen.

Differential Revision: https://reviews.llvm.org/D108350
llvm/include/llvm/MC/MCPseudoProbe.h
llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
llvm/lib/Transforms/IPO/SampleContextTracker.cpp
llvm/test/tools/llvm-profgen/cs-preinline-cost.test
llvm/tools/llvm-profgen/ProfiledBinary.cpp
llvm/tools/llvm-profgen/ProfiledBinary.h