summaryrefslogtreecommitdiffstats
path: root/lld/COFF/LTO.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [COFF] Wrap definitions in namespace lld { namespace coff {. NFCFangrui Song2019-10-101-2/+5
| | | | | | | | | | | Similar to D67323, but for COFF. Many lld/COFF/ files already use `namespace lld { namespace coff {`. Only a few need changing. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D68772 llvm-svn: 374314
* [lld-link] implement -lto-obj-pathBob Haarman2019-08-211-0/+2
| | | | | | | | | | | | | | | | | | | Summary: This adds the -lto-obj-path option to lld-link. This can be used to specify a path at which to write a native object file for the full LTO part when using LTO unit splitting. Reviewers: ruiu, tejohnson, pcc, rnk Reviewed By: ruiu, rnk Subscribers: mehdi_amini, steven_wu, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65964 llvm-svn: 369559
* [LLD] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-4/+4
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368936
* Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFCFangrui Song2019-08-051-1/+1
| | | | | | F_{None,Text,Append} are kept for compatibility since r334221. llvm-svn: 367800
* [lld-link] implement -thinlto-{prefix,object-suffix}-replaceBob Haarman2019-07-111-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds the following two options to lld-link: -thinlto-prefix-replace: allows replacing a prefix in paths generated for ThinLTO. This can be used to ensure index files and native object files are stored in unique directories, allowing multiple distributed ThinLTO links to proceed concurrently. -thinlto-object-suffix-replace: allows replacing a suffix in object file paths involved in ThinLTO. This allows minimized index files to be used for the thin link while storing the paths to the full bitcode files for subsequent steps (code generation and final linking). Reviewers: ruiu, tejohnson, pcc, rnk Subscribers: mehdi_amini, steven_wu, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64542 llvm-svn: 365807
* [lld-link] implement -thinlto-index-onlyBob Haarman2019-07-111-6/+52
| | | | | | | | | | | | | | | | | | | | | | | Summary: This implements -thinlto-index-only, -thinlto-index-only:, and -thinlto-emit-imports-files options in lld-link. They are analogous to their counterparts in ld.lld: -thinlto-index-only causes us to perform ThinLTO's thin link and write index files, but not perform code generation. -thinlto-index-only: does the same, but also writes a text file listing the native object files expected to be generated. -thinlto-emit-imports-files creates a text file next to each index file, listing the files to import from. Reviewers: ruiu, tejohnson, pcc, rnk Subscribers: mehdi_amini, steven_wu, dexonsmith, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64461 llvm-svn: 365800
* [Coding style change][lld] Rename variables for non-ELF portsRui Ueyama2019-07-111-63/+63
| | | | | | | | | | | This patch does the same thing as r365595 to other subdirectories, which completes the naming style change for the entire lld directory. With this, the naming style conversion is complete for lld. Differential Revision: https://reviews.llvm.org/D64473 llvm-svn: 365730
* Fix names of functions in TargetOptionsCommandFlags.h. NFC.Sam Clegg2019-02-011-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D57555 llvm-svn: 352825
* [LTO] Set CGOptLevel in LTO config.Sam Clegg2019-01-301-0/+2
| | | | | | | | | Previously we were never setting this which means it was always being set to Default (-O2/-Os). Differential Revision: https://reviews.llvm.org/D57422 llvm-svn: 352667
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [COFF] Set the CPU string for LTO like ELF doesReid Kleckner2018-12-181-0/+1
| | | | | | Fixes PR40043 llvm-svn: 349436
* Set MAttrs in LTO modeFangrui Song2018-11-011-0/+2
| | | | | | | | | | | | | | | | Summary: Without this patch, MAttrs are not set. Patch by Yin Ma Reviewers: espindola, MaskRay, ruiu, pcc Reviewed By: MaskRay, pcc Subscribers: pcc, emaste, sbc100, inglorion, arichardson, aheejin, steven_wu, llvm-commits Differential Revision: https://reviews.llvm.org/D53446 llvm-svn: 345884
* Code cleanup in preparation for adding LTO for wasm. NFC.Sam Clegg2018-05-221-41/+21
| | | | | | | | | | | | | | - Move some common code into Common/rrorHandler.cpp and Common/Strings.h. - Don't use `fatal` when incompatible bitcode files are encountered. - Rename NameRef variable to just Name See D47162 Differential Revision: https://reviews.llvm.org/D47206 llvm-svn: 333021
* [COFF] Enable per-function and data sections in LTOReid Kleckner2018-03-141-0/+6
| | | | | | | | | | | | Summary: This allows post-LTO symbol reordering and ICF. Reviewers: inglorion Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D44492 llvm-svn: 327563
* [lld/LTO] Remove unused Path parameter to AddBufferFnTeresa Johnson2018-02-201-4/+4
| | | | | | | | | | | | | | | | Summary: With D43396, no clients use the Path parameter anymore. This is the lld side fix with D43400. Depends on D43396 and D43400. Reviewers: pcc Subscribers: emaste, inglorion, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D43401 llvm-svn: 325620
* Rename replaceBody -> replaceSymbol.Rui Ueyama2017-11-031-1/+1
| | | | llvm-svn: 317383
* Rename SymbolBody -> SymbolRui Ueyama2017-11-031-3/+3
| | | | | | | | | | | | | Now that we have only SymbolBody as the symbol class. So, "SymbolBody" is a bit strange name now. This is a mechanical change generated by perl -i -pe s/SymbolBody/Symbol/g $(git grep -l SymbolBody lld/ELF lld/COFF) nd clang-format-diff. Differential Revision: https://reviews.llvm.org/D39459 llvm-svn: 317370
* [COFF] Merge Symbol and SymbolBody.Rui Ueyama2017-10-311-6/+3
| | | | llvm-svn: 317007
* [lld] unified COFF and ELF error handling on new Common/ErrorHandlerBob Haarman2017-10-251-1/+1
| | | | | | | | | | | | | | | | | | | Summary: The COFF linker and the ELF linker have long had similar but separate Error.h and Error.cpp files to implement error handling. This change introduces new error handling code in Common/ErrorHandler.h, changes the COFF and ELF linkers to use it, and removes the old, separate implementations. Reviewers: ruiu Reviewed By: ruiu Subscribers: smeenai, jyknight, emaste, sdardis, nemanjai, nhaehnle, mgorny, javed.absar, kbarton, fedor.sergeev, llvm-commits Differential Revision: https://reviews.llvm.org/D39259 llvm-svn: 316624
* COFF: When generating code for LTO, use static reloc model on 32-bit x86.Peter Collingbourne2017-10-111-1/+7
| | | | | | | | | | | | | | Fixes PR34306. This is because it usually results in more compact code, and because there are also known code generation bugs when using the PIC model (see bug). Based on a patch by Carlo Kok. Differential Revision: https://reviews.llvm.org/D38769 llvm-svn: 315400
* Move new lld's code to Common subdirectory.Rui Ueyama2017-10-021-1/+1
| | | | | | | | | | New lld's files are spread under lib subdirectory, and it isn't easy to find which files are actually maintained. This patch moves maintained files to Common subdirectory. Differential Revision: https://reviews.llvm.org/D37645 llvm-svn: 314719
* Simplify error handling. NFC.Rafael Espindola2017-09-211-4/+2
| | | | llvm-svn: 313930
* COFF: Implement ThinLTO cache and cache pruning support.Peter Collingbourne2017-09-081-5/+27
| | | | | | Differential Revision: https://reviews.llvm.org/D37607 llvm-svn: 312770
* [coff] default to multiple parallel ThinLTO jobsBob Haarman2017-04-121-1/+1
| | | | | | | | | | | | | | | | | | | Summary: lld-link allows the number of parallel ThinLTO jobs to be specified using /opt:lldltojobs=N. If left unspecified, the implementation conservatively defaults to 1. This leads to very long link times. This change makes it so that the default is to automatically set the parallelism, as we do in the ELF linker. Reviewers: ruiu, hans Reviewed By: ruiu, hans Subscribers: pcc, mehdi_amini, Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D31986 llvm-svn: 300089
* LTO: Replace InputFile::Symbol::getFlags() with predicate accessors. NFC.Peter Collingbourne2017-03-281-3/+1
| | | | | | | This makes the predicates independent of the flag representation and makes the code a little easier to read. llvm-svn: 298951
* [COFF] added support for /lldsavetempsBob Haarman2017-02-081-3/+22
| | | | | | | | | | | | | | Summary: This adds an option to save temporary files generated during link-time optimization. This can be useful for debugging. Reviewers: ruiu, pcc Reviewed By: ruiu, pcc Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D29518 llvm-svn: 294498
* Add an option to use the MSVC linker to link LTO-generated object files.Rui Ueyama2017-02-061-8/+6
| | | | | | | | | | | This patch defines a new command line option, /MSVCLTO, to LLD. If that option is given, LLD invokes link.exe to link LTO-generated object files. This is hacky but useful because link.exe can create PDB files. Differential Revision: https://reviews.llvm.org/D29526 llvm-svn: 294234
* refactor COFF linker to use new LTO APIBob Haarman2017-02-021-0/+125
Summary: The COFF linker previously implemented link-time optimization using an API which has now been marked as legacy. This change refactors the COFF linker to use the new LTO API, which is also used by the ELF linker. Reviewers: pcc, ruiu Reviewed By: pcc Subscribers: mgorny, mehdi_amini Differential Revision: https://reviews.llvm.org/D29059 llvm-svn: 293967
OpenPOWER on IntegriCloud