llvm/lib/LTO
Peter Collingbourne f284f00fe0 LTO: Apply global DCE to ThinLTO modules at LTO opt level 0.
This is necessary because DCE is applied to full LTO modules. Without
this change, a reference from a dead ThinLTO global to a dead full
LTO global will result in an undefined reference at link time.

This problem is only observable when --gc-sections is disabled, or
when targeting COFF, as the COFF port of lld requires all symbols to
have a definition even if all references are dead (this is consistent
with link.exe).

This change also adds an EliminateAvailableExternally pass at -O0. This
is necessary to handle the situation on Windows where a non-prevailing
copy of a linkonce_odr function has an SEH filter function; any
such filters must be DCE'd because they will contain a call to the
llvm.localrecover intrinsic, passing as an argument the address of the
function that the filter belongs to, and llvm.localrecover requires
this function to be defined locally.

Fixes PR35142.

Differential Revision: https://reviews.llvm.org/D39484

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317108 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-01 17:58:39 +00:00
..
Caching.cpp LTO: Improve error reporting when adding a cache entry. 2017-10-03 00:44:21 +00:00
CMakeLists.txt Support: Add a VCSRevision.h header file. 2017-04-13 01:26:12 +00:00
LLVMBuild.txt [lib/LTO] Add a way to run a custom pipeline 2016-09-07 17:46:16 +00:00
LTO.cpp LTO: Apply global DCE to ThinLTO modules at LTO opt level 0. 2017-11-01 17:58:39 +00:00
LTOBackend.cpp [Support] Rename tool_output_file to ToolOutputFile, NFC 2017-09-23 01:03:17 +00:00
LTOCodeGenerator.cpp [SimplifyCFG] use pass options and remove the latesimplifycfg pass 2017-10-28 18:43:07 +00:00
LTOModule.cpp LTOModule::isBitcodeFile() shouldn't assert when returning false. 2017-10-31 16:39:47 +00:00
ThinLTOCodeGenerator.cpp Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
UpdateCompilerUsed.cpp [Analysis] Add LibFunc_ prefix to enums in TargetLibraryInfo. (NFC) 2017-01-23 23:16:46 +00:00