llvm/lib/LTO
Mehdi Amini 03669a56fb ThinLTO: special handling for LinkOnce functions
These function can be dropped by the compiler if they are no longer
referenced in the current module. However there is a change that
another module is still referencing them because of the import.

Multiple solutions can be used:

- Always import LinkOnce when a caller is imported. This ensure that
  every module with a call to a LinkOnce has the definition and will
  be able to emit it if it emits the call.
- Turn the LinkOnce into Weak, so that it is always emitted.
- Turn all LinkOnce into available_externally and come back after all
  modules are codegen'ed to emit only one copy of the linkonce, when
  there is still a reference to it.

This patch implement the second option, with am optimization that
only *one* module will turn the LinkOnce into Weak, while the others
will turn it into available_externally, so that there is exactly one
copy emitted for the whole compilation.

http://reviews.llvm.org/D18346

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 21:53:50 +00:00
..
CMakeLists.txt libLTO: add a ThinLTOCodeGenerator on the model of LTOCodeGenerator. 2016-03-09 01:37:22 +00:00
LLVMBuild.txt libLTO: add a ThinLTOCodeGenerator on the model of LTOCodeGenerator. 2016-03-09 01:37:22 +00:00
LTOCodeGenerator.cpp [PM] Port GVN to the new pass manager, wire it up, and teach a couple of 2016-03-11 08:50:55 +00:00
LTOModule.cpp [ThinLTO] Support for reference graph in per-module and combined summary. 2016-03-11 18:52:24 +00:00
ThinLTOCodeGenerator.cpp ThinLTO: special handling for LinkOnce functions 2016-04-01 21:53:50 +00:00