llvm-project/llvm
Wenlei He a5d30421a6 [CSSPGO] Load context profile for external functions in PreLink and populate ThinLTO import list
For ThinLTO's prelink compilation, we need to put external inline candidates into an import list attached to function's entry count metadata. This enables ThinLink to treat such cross module callee as hot in summary index, and later helps postlink to import them for profile guided cross module inlining.

For AutoFDO, the import list is retrieved by traversing the nested inlinee functions. For CSSPGO, since profile is flatterned, a few things need to happen for it to work:

 - When loading input profile in extended binary format, we need to load all child context profile whose parent is in current module, so context trie for current module includes potential cross module inlinee.
 - In order to make the above happen, we need to know whether input profile is CSSPGO profile before start reading function profile, hence a flag for profile summary section is added.
 - When searching for cross module inline candidate, we need to walk through the context trie instead of nested inlinee profile (callsite sample of AutoFDO profile).
 - Now that we have more accurate counts with CSSPGO, we swtiched to use entry count instead of total count to decided if an external callee is potentially beneficial to inline. This make it consistent with how we determine whether call tagert is potential inline candidate.

Differential Revision: https://reviews.llvm.org/D98590
2021-03-15 12:22:15 -07:00
..
benchmarks
bindings
cmake [CMake] Require python 3.6 if enabling LLVM test targets 2021-03-15 09:50:39 -07:00
docs [FileCheck] Add support for hex alternate form in FileCheck 2021-03-12 18:14:17 +00:00
examples [ORC] Fix some comments in the LLJITWithObjectLinkingLayerPlugin example. 2021-03-12 19:13:42 -08:00
include [CSSPGO] Load context profile for external functions in PreLink and populate ThinLTO import list 2021-03-15 12:22:15 -07:00
lib [CSSPGO] Load context profile for external functions in PreLink and populate ThinLTO import list 2021-03-15 12:22:15 -07:00
projects
resources
runtimes [PR48898][CMake] Support MinGW Toolchain tool sin llvm_ExternalProject_Add 2021-03-02 22:45:05 +01:00
test [CSSPGO] Load context profile for external functions in PreLink and populate ThinLTO import list 2021-03-15 12:22:15 -07:00
tools [CSSPGO] Load context profile for external functions in PreLink and populate ThinLTO import list 2021-03-15 12:22:15 -07:00
unittests [AssumeBundles] Add nonnull/align to op bundle if noundef exists 2021-03-16 10:23:42 +09:00
utils [gn build] (semi-manually) port b136a74efc 2021-03-15 12:51:12 -04:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [CMake] Require python 3.6 if enabling LLVM test targets 2021-03-15 09:50:39 -07:00
CODE_OWNERS.TXT [M68k][CODE_OWNERS](0/8) Add code owner for the M68k target 2021-03-08 12:30:56 -08:00
CREDITS.TXT
LICENSE.TXT
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.