[llvm] Development-mode InlineAdvisor
authorMircea Trofin <mtrofin@google.com>
Thu, 9 Jul 2020 01:55:36 +0000 (18:55 -0700)
committerMircea Trofin <mtrofin@google.com>
Mon, 20 Jul 2020 18:01:56 +0000 (11:01 -0700)
commit70f8d0ac8a34d7a611db14d0662737ba1c3a3273
tree7c9b2d0a6c6d8cbcbe9f4ff28dc6619d6bd8e040
parentc6f84ebf84acd94491c99b95e4cf455cc7218d7e
[llvm] Development-mode InlineAdvisor

Summary:
This is the InlineAdvisor used in 'development' mode. It enables two
scenarios:

 - loading models via a command-line parameter, thus allowing for rapid
 training iteration, where models can be used for the next exploration
 phase without requiring recompiling the compiler. This trades off some
 compilation speed for the added flexibility.

 - collecting training logs, in the form of tensorflow.SequenceExample
 protobufs. We generate these as textual protobufs, which simplifies
 generation and testing. The protobufs may then be readily consumed by a
 tensorflow-based training algorithm.

To speed up training, training logs may also be collected from the
'default' training policy. In that case, this InlineAdvisor does not
use a model.

RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-April/140763.html

Reviewers: jdoerfert, davidxl

Subscribers: mgorny, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83733
llvm/include/llvm/Analysis/InlineAdvisor.h
llvm/lib/Analysis/CMakeLists.txt
llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp [new file with mode: 0644]
llvm/lib/Analysis/InlineAdvisor.cpp
llvm/test/Bindings/Go/lit.local.cfg
llvm/test/Transforms/Inline/ML/bounds-checks-rewards.ll [new file with mode: 0644]
llvm/test/Transforms/Inline/ML/development-training-log.ll [new file with mode: 0644]
llvm/test/Transforms/Inline/ML/ml-test-development-mode.ll [new file with mode: 0644]
llvm/test/Transforms/Inline/inlining-advisor-default.ll