summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/LTO.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ThinLTO: Do not take into account whether a definition has multiple copies ↵Peter Collingbourne2016-07-071-13/+3
| | | | | | | | | | | | | | | | | | | | | | when promoting. We currently do not touch a symbol's linkage in the case where a definition has a single copy. However, this code is effectively unnecessary: either the definition is not exported, in which case the internalize phase sets its linkage to internal, or it is exported, in which case we need to promote linkage to weak. Those two cases are already handled by existing code. I believe that the only real functional change here is in the case where we have a single definition which does not prevail (e.g. because the definition in a native object file prevails). In that case we now lower linkage to available_externally following the existing code path for that case. As a result we can remove the isExported function parameter from the thinLTOResolveWeakForLinkerInIndex function. Differential Revision: http://reviews.llvm.org/D21883 llvm-svn: 274784
* ThinLTO: Remove check for multiple modules before applying weak resolutions.Peter Collingbourne2016-07-071-4/+0
| | | | | | | | | | This check is not only unnecessary, it can produce the wrong result. If we are linking a single module and it has an exported linkonce symbol, we need to promote to weak in order to avoid PR19901-style problems. Differential Revision: http://reviews.llvm.org/D21917 llvm-svn: 274722
* Move instances of std::function.Benjamin Kramer2016-06-121-8/+8
| | | | | | Or replace with llvm::function_ref if it's never stored. NFC intended. llvm-svn: 272513
* [ThinLTO] Resolve LinkOnceAnyTeresa Johnson2016-05-261-15/+6
| | | | | | | | | | | | | | | | | Summary: Ensure we keep prevailing copy of LinkOnceAny by converting it to WeakAny. Rename odr_resolution test to the now more appropriate weak_resolution (weak in the linker sense includes linkonce). Reviewers: joker.eph Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D20634 llvm-svn: 270850
* [ThinLTO] Refactor ODR resolution and internalization (NFC)Teresa Johnson2016-05-251-0/+100
| | | | | | | | | Move the now index-based ODR resolution and internalization routines out of ThinLTOCodeGenerator.cpp and into either LTO.cpp (index-based analysis) or FunctionImport.cpp (index-driven optimizations). This is to enable usage by other linkers. llvm-svn: 270698
* [ThinLTO] Refactor module loader handling into new LTO file (NFC)Teresa Johnson2016-05-231-0/+42
Moved the ModuleLoader and supporting helper loadModuleFromBuffer out of ThinLTOCodeGenerator and into new LTO.h/LTO.cpp files. This is in preparation for a patch that will utilize these in the gold-plugin. Note that there are some other pending patches (D20268 and D20290) that also plan to refactor common interfaces and functionality into this same pair of new files. llvm-svn: 270509
OpenPOWER on IntegriCloud