llvm-project/llvm
modimo ce7f9cdb50 [InlineAdvisor] Allow replay of inline decisions for the CGSCC inliner from optimization remarks
This change leverages the work done in D83743 to replay in the SampleProfile inliner to also be used in the CGSCC inliner. NOTE: currently restricted to non-ML advisors only.

The added switch `-cgscc-inline-replay=<remarks file>` will replay the inlining decisions in that file where the remarks file is generated via `-Rpass=inline`. The aim here is to make it easier to analyze changes that would modify inlining heuristics to be separated from this behavior. Doing so allows easier examination of assembly and runtime behavior compared to the baseline rather than trying to dig through the large churn caused by inlining.

In LTO compilation, since inlining is done twice you can separately specify replay by passing the flag to the FE (`-cgscc-inline-replay=`) and to the linker (`-Wl,cgscc-inline-replay=`) with the remarks generated from their respective places.

Testing on mysqld by comparing the inline decisions between base (generates remarks.txt) and diff (replay using identical input/tools with remarks.txt) and examining the inlining sites with `diff` shows 14,000 mismatches out of 247,341 for a ~94% replay accuracy. I believe this gap can be narrowed further though for the general case we may never achieve full accuracy. For my personal use, this is close enough to be representative: I set the baseline as the one generated by the replay on identical input/toolset and compare that to my modified input/toolset using the same replay.

Testing:
ninja check-llvm
newly added test correctly replays CGSCC inlining decisions

Reviewed By: mtrofin, wenlei

Differential Revision: https://reviews.llvm.org/D94334
2021-01-25 15:38:57 -08:00
..
benchmarks
bindings
cmake Reland [lldb][docs] Use sphinx instead of epydoc to generate LLDB's Python reference 2021-01-17 12:13:01 +01:00
docs [Doc][NFC] Fix Kaleidoscope links, typos and add blog posts for MCJIT 2021-01-25 19:59:36 +05:30
examples [Doc][NFC] Fix Kaleidoscope links, typos and add blog posts for MCJIT 2021-01-25 19:59:36 +05:30
include [InlineAdvisor] Allow replay of inline decisions for the CGSCC inliner from optimization remarks 2021-01-25 15:38:57 -08:00
lib [InlineAdvisor] Allow replay of inline decisions for the CGSCC inliner from optimization remarks 2021-01-25 15:38:57 -08:00
projects
resources
runtimes [CMake] Split the target side of runtimes build 2021-01-11 23:39:36 -08:00
test [InlineAdvisor] Allow replay of inline decisions for the CGSCC inliner from optimization remarks 2021-01-25 15:38:57 -08:00
tools [llvm-dwp] Automatically set the target triple 2021-01-25 11:58:54 +01:00
unittests Support: Remove duplicated code in {File,clang::ModulesDependency}Collector, NFC 2021-01-25 15:09:00 -08:00
utils Revert "[lit] Use os.cpu_count() to cleanup TODO" 2021-01-25 13:32:30 -08:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [CMake] Remove dead code setting policies to NEW 2021-01-19 17:19:36 +02:00
CODE_OWNERS.TXT Change XCore code owner. 2021-01-14 12:13:48 +00: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.