OSDN Git Service

Define the ThinLTO Pipeline (experimental)
authorMehdi Amini <mehdi.amini@apple.com>
Tue, 16 Feb 2016 23:02:29 +0000 (23:02 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Tue, 16 Feb 2016 23:02:29 +0000 (23:02 +0000)
commitf5146973a3a28fe9d7b107ded79b1f0fdad9656b
tree54fc133ed8c081dda8c556e6e30b04c43b562a9e
parente30029223358442231c51adb5de107fa7c02dd89
Define the ThinLTO Pipeline (experimental)

Summary:
On the contrary to Full LTO, ThinLTO can afford to shift compile time
from the frontend to the linker: both phases are parallel (even if
it is not totally "free": projects like clang are reusing product
from the "compile phase" for multiple link, think about
libLLVMSupport reused for opt, llc, etc.).

This pipeline is based on the proposal in D13443 for full LTO. We
didn't move forward on this proposal because the LTO link was far too
long after that. We believe that we can afford it with ThinLTO.

The ThinLTO pipeline integrates in the regular O2/O3 flow:

 - The compile phase perform the inliner with a somehow lighter
   function simplification. (TODO: tune the inliner thresholds here)
   This is intendend to simplify the IR and get rid of obvious things
   like linkonce_odr that will be inlined.
 - The link phase will run the pipeline from the start, extended with
   some specific passes that leverage the augmented knowledge we have
   during LTO. Especially after the inliner is done, a sequence of
   globalDCE/globalOpt is performed, followed by another run of the
   "function simplification" passes. It is not clear if this part
   of the pipeline will stay as is, as the split model of ThinLTO
   does not allow the same benefit as FullLTO without added tricks.

The measurements on the public test suite as well as on our internal
suite show an overall net improvement. The binary size for the clang
executable is reduced by 5%. We're still tuning it with the bringup
of ThinLTO and it will evolve, but this should provide a good starting
point.

Reviewers: tejohnson

Differential Revision: http://reviews.llvm.org/D17115

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261029 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/IPO/PassManagerBuilder.h
lib/Transforms/IPO/PassManagerBuilder.cpp