[ThinLTO] Option to invoke ThinLTO backend passes and importing
authorTeresa Johnson <tejohnson@google.com>
Mon, 7 Dec 2015 19:21:34 +0000 (19:21 +0000)
committerTeresa Johnson <tejohnson@google.com>
Mon, 7 Dec 2015 19:21:34 +0000 (19:21 +0000)
commitaff223278c3770ba11c98bc33b53e0ea6ff675ae
tree0e9ed66ab2ea48c517b481670c305eef7af21807
parent5fcbdb717c994ca4215003e8ba349b6f0943e80b
[ThinLTO] Option to invoke ThinLTO backend passes and importing

Summary:
Adds new option -fthinlto-index=<file> to invoke the LTO pipeline
along with function importing via clang using the supplied function
summary index file. This supports invoking the parallel ThinLTO
backend processes in a distributed build environment via clang.

Additionally, this causes the module linker to be invoked on the bitcode
file being compiled to perform any necessary promotion and renaming of
locals that are exported via the function summary index file.

Add a couple tests that confirm we get expected errors when we try to
use the new option on a file that isn't bitcode, or specify an invalid
index file. The tests also confirm that we trigger the expected function
import pass.

Depends on D15024

Reviewers: joker.eph, dexonsmith

Subscribers: joker.eph, davidxl, cfe-commits

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

llvm-svn: 254927
12 files changed:
clang/include/clang/CodeGen/BackendUtil.h
clang/include/clang/Driver/Options.td
clang/include/clang/Driver/Types.h
clang/include/clang/Frontend/CodeGenOptions.h
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/CodeGen/CodeGenAction.cpp
clang/lib/Driver/Tools.cpp
clang/lib/Driver/Types.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CMakeLists.txt
clang/test/CodeGen/thinlto_backend.c [new file with mode: 0644]
clang/test/Driver/thinlto_backend.c [new file with mode: 0644]