summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LTO.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Move BitcodeCompiler constructor to the .cpp file. NFC.Rui Ueyama2016-04-221-0/+6
| | | | llvm-svn: 267221
* ELF: Move Visibility, IsUsedInRegularObj and MustBeInDynSym flags to Symbol.Peter Collingbourne2016-04-221-2/+2
| | | | | | | | | | | | | | These are properties of a symbol name, rather than a particular instance of a symbol in an object file. We can simplify the code by collecting these properties in Symbol. The MustBeInDynSym flag has been renamed ExportDynamic, as its semantics have been changed to be the same as those of --dynamic-list and --export-dynamic-symbol, which do not cause hidden symbols to be exported. Differential Revision: http://reviews.llvm.org/D19400 llvm-svn: 267183
* Start adding support for internalizing shared libraries.Rafael Espindola2016-04-211-7/+13
| | | | llvm-svn: 267045
* Make CreateTargetMachine as small as possible.Rafael Espindola2016-04-171-12/+13
| | | | | | | It is a pity that we have to create a TargetMachine once per thread, so at least make that code as small as possible. llvm-svn: 266578
* [LTO] Don't crash on a BitcodeFile without DataLayout.Davide Italiano2016-04-161-0/+2
| | | | | | Emit an error instead. llvm-svn: 266504
* [LTO] Implement parallel Codegen for LTO using splitCodeGen.Davide Italiano2016-04-151-19/+40
| | | | | | | | Parallelism level can be chosen using the new --lto-jobs=K option where K is the number of threads used for CodeGen. It currently defaults to 1. llvm-svn: 266484
* [LTO] Switch Module to std::unique_ptr<>.Davide Italiano2016-04-111-5/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D18994 llvm-svn: 266009
* ELF: Implement basic support for module asm in bitcode files.Peter Collingbourne2016-04-111-1/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D18872 llvm-svn: 265956
* Cleanup the handling of MustBeInDynSym and IsUsedInRegularObj.Rafael Espindola2016-04-081-1/+2
| | | | | | | | | | | | | | | | | | Now MustBeInDynSym is only true if the symbol really must be in the dynamic symbol table. IsUsedInRegularObj is only true if the symbol is used in a .o or -u. Not a .so or a .bc. A benefit is that this is now done almost entirilly during symbol resolution. The only exception is copy relocations because of aliases. This includes a small fix in that protected symbols in .so don't force executable symbols to be exported. This also opens the way for implementing internalize for -shared. llvm-svn: 265826
* [LTO] Implement -disable-verify, which disables bitcode verification.Davide Italiano2016-04-031-2/+1
| | | | | | | | | | | | | | | So, there are some cases when the IR Linker produces a broken module (which doesn't pass the verifier) and we end up asserting inside the verifier. I think it's always a bug producing a module which does not pass the verifier but there are some cases in which people can live with the broken module (e.g. if only DebugInfo metadata are broken). The gold plugin has something similar. This commit is motivated by a situation I found in the wild. It seems that somebody else discovered it independently and reported in PR24923. llvm-svn: 265258
* Call cl::ParseCommandLineOptions from the driver.Sean Silva2016-04-021-2/+0
| | | | | | Thanks to Rui for the suggestion; this simplifies things. llvm-svn: 265213
* PR27104: Add -mllvm optionSean Silva2016-04-021-0/+2
| | | | | | The argv[0] is based on the analogous thing in clang. llvm-svn: 265206
* [LTO] Inherit options from Codegen before initializing TargetMachine.Davide Italiano2016-04-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bootstrap of llvm-tblgen (with LTO) and PR27150. Slightly longer explanation follows. Emission of .init_array instead of .ctors is supported only on a subset of the Target LLVM supports. Codegen needs to be conservative and always emit .ctors unless instructed otherwise (based on target). If the dynamic linker sees .init_array it completely ignores what's inside .ctors and therefore some constructors are not called (and this causes llvm-tblgen to crash on startup). Teach LLD/LTO about the Codegen options so we end up always emitting .init_array and avoid this issue. In future, we might end up supporting mix of .ctors and .init_array in different input files if this shows up as a real-world use case. The way gold handles this case is mapping .ctors from input into .init_array in output. There's also another caveat because as far as I understand .ctors run in reverse order so when we do the copy/mapping we need to reverse copy in the output if there's more than one ctor. That's why I'd rather avoid this complicate logic unless there's a real need. An analogous reasoning holds for .dtors/.fini_array. llvm-svn: 265085
* ELF: Add flag for controlling LTO optimization level.Peter Collingbourne2016-03-311-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D18667 llvm-svn: 265053
* [LTO] Add a comment to explain how we handle @llvm.used.Davide Italiano2016-03-291-0/+4
| | | | | | Requested by: Rui Ueyama. llvm-svn: 264809
* [ELF] Drive-by cleanup, make LTO.cpp clang-format clean.Davide Italiano2016-03-291-1/+1
| | | | llvm-svn: 264791
* [LTO] Teach LTO about @llvm.used global.Davide Italiano2016-03-291-1/+7
| | | | | | | If a symbol appears in @llvm.used, the linker is forced to treat the symbol as there's a reference to it. llvm-svn: 264790
* Replace a FIXME with a regular comment.Rui Ueyama2016-03-291-1/+2
| | | | | | | Because it doesn't have to be fixed even though it is probably better to do. llvm-svn: 264772
* Make BitcodeCompiler::compile a non-template function. NFC.Rui Ueyama2016-03-291-11/+2
| | | | llvm-svn: 264770
* [LTO] Don't internalize if --export-dynamic is passed.Davide Italiano2016-03-291-1/+1
| | | | | | We treat that in the same way we treat shared libraries. llvm-svn: 264698
* [LTO] Internalize symbols.Davide Italiano2016-03-281-0/+24
| | | | | | | | | | | IPO doesn't work very well across symbols referenced by others TUs. The linker here tries to evaluate which symbols are safe to internalize and switches their linkage. Differential Revision: http://reviews.llvm.org/D18415 llvm-svn: 264585
* [ELF/LTO] Refactor to reduce indentation.Davide Italiano2016-03-261-15/+15
| | | | | | Suggested by: Rui Ueyama. llvm-svn: 264518
* ELF: Split BitcodeCompiler::compile.Rui Ueyama2016-03-231-17/+12
| | | | | | http://reviews.llvm.org/D18410 llvm-svn: 264193
* [LTO] Keep linkonce symbols when required.Davide Italiano2016-03-231-1/+9
| | | | | | | Similarly to how we do with linkonce_odr symbols already, but change their linkage to weak. llvm-svn: 264181
* [LTO] Only change linkage if we keep the symbol.Davide Italiano2016-03-231-5/+4
| | | | llvm-svn: 264171
* [LTO] Keep linkonce_odr symbols when appropriate.Davide Italiano2016-03-221-1/+6
| | | | | | | | | | | Ensure we keep the symbol we need to before it reaches the Writer (and hit an assertion), changing its linkage from linkonce_odr to weak. For a more detailed description of the problem, see PR19901 where a similar problem was fixed for the gold plugin. Thanks to Rafael for providing a testcase. llvm-svn: 264111
* ELF: Create LTO.{cpp,h} and move LTO-related code to that file.Rui Ueyama2016-03-221-0/+140
The code for LTO has been growing, so now is probably a good time to move it to its own file. SymbolTable.cpp is for symbol table, and because compiling bitcode files are semantically not a part of symbol table, this is I think a good thing to do. http://reviews.llvm.org/D18370 llvm-svn: 264091
OpenPOWER on IntegriCloud