summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-lto2
Commit message (Collapse)AuthorAgeFilesLines
...
* LTO: Hash the parts of the LTO configuration that affect code generation.Peter Collingbourne2016-12-081-0/+42
| | | | | | | | | Most importantly, we need to hash the relocation model, otherwise we can end up trying to link non-PIC object files into PIEs or DSOs. Differential Revision: https://reviews.llvm.org/D27556 llvm-svn: 289024
* llvm-lto2: Simpler workaround for PR30396.Peter Collingbourne2016-11-301-17/+10
| | | | | | | | | | | Maintain the command line resolutions as a map to a list of resolutions rather than a single resolution, and apply the resolutions in the order observed. This is not only simpler but allows us to test the scenario where the two symbols have different resolutions. Differential Revision: https://reviews.llvm.org/D27285 llvm-svn: 288288
* [CMake] llvm-lto2 depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | | llvm-lto2.cpp has the following include chain: llvm/LTO/Caching.h llvm/LTO/LTO.h llvm/CodeGen/Analysis.h llvm/IR/CallSite.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-lto2 needs to depend on intrinsics_gen. llvm-svn: 287434
* [ThinLTO] Disable importing and other cross-module optis at -O0Teresa Johnson2016-10-311-0/+7
| | | | | | | | | | | | | | | | Summary: There is no point to importing at -O0, since we won't inline. We should also disable other cross-module optimizations. (Plan to backport this fix to the 3.9 branch to fix PR30774) Reviewers: pcc Subscribers: johanengelen, mehdi_amini Differential Revision: https://reviews.llvm.org/D25918 llvm-svn: 285648
* [ThinLTO] Default backend threads to heavyweight_hardware_concurrencyTeresa Johnson2016-10-191-1/+2
| | | | | | | | | | | | | | | | | Summary: Changes default backend parallelism from thread::hardware_concurrency to the new llvm::heavyweight_hardware_concurrency, which for X86 Linux defaults to the number of physical cores (and will fall back to thread::hardware_concurrency otherwise). This avoid oversubscribing the physical cores using hyperthreading. Reviewers: mehdi_amini, pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25775 llvm-svn: 284618
* [ThinLTO] Fix bot failure due to unused variable with NDEBUGTeresa Johnson2016-10-121-1/+4
| | | | | | | | | Put variable only used in assert under #ifndef NDEBUG. This should fix bot failure at http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/28537 llvm-svn: 284039
* [ThinLTO] Don't link module level assembly when importingTeresa Johnson2016-10-121-1/+11
| | | | | | | | | | | | | | | | | | | | | Module inline asm was always being linked/concatenated when running the IRLinker. This is correct for full LTO but not when we are importing for ThinLTO, as it can result in multiply defined symbols when the module asm defines a global symbol. In order to test with llvm-lto2, I had to work around PR30396, where a symbol that is defined in module assembly but defined in the LLVM IR appears twice. Added workaround to llvm-lto2 with a FIXME. Fixes PR30610. Reviewers: mehdi_amini Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25359 llvm-svn: 284030
* LTO: Simplify caching interface.Peter Collingbourne2016-09-231-32/+21
| | | | | | | | | | | | | | | | | The NativeObjectOutput class has a design problem: it mixes up the caching policy with the interface for output streams, which makes the client-side code hard to follow and would for example make it harder to replace the cache implementation in an arbitrary client. This change separates the two aspects by moving the caching policy to a separate field in Config, replacing NativeObjectOutput with a NativeObjectStream class which only deals with streams and does not need to be overridden by most clients and introducing an AddFile callback for adding files (e.g. from the cache) to the link. Differential Revision: https://reviews.llvm.org/D24622 llvm-svn: 282299
* [LTO] Add ability to parse AA pipelines.Davide Italiano2016-09-161-0/+5
| | | | | | | This is supposed to be a drop in replacement for what lld provides via --lto-newpm-aa-pipeline. llvm-svn: 281774
* [lib/LTO] Add a way to run a custom pipelineDavide Italiano2016-09-071-0/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D24095 llvm-svn: 280830
* [ThinLTO] Move loading of cache entry to clientTeresa Johnson2016-08-261-2/+8
| | | | | | | | | | | | | | | | | | | | | | Summary: Have the cache pass back the path to the cache entry when it is ready to be loaded, instead of a buffer. For gold-plugin we can simply pass this file back to gold directly, which avoids expensive writing of a separate tmp file. Ensure the cache entry is not deleted on cleanup by adjusting the setting of the IsTemporary flags. Moved the loading of the buffer into llvm-lto2 to maintain current behavior. Reviewers: mehdi_amini Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23946 llvm-svn: 279883
* [ThinLTO] Add caching to the new LTO APIMehdi Amini2016-08-231-2/+13
| | | | | | | | | | | | Add the ability to plug a cache on the LTO API. I tried to write such that a linker implementation can control the cache backend. This is intrusive and I'm not totally happy with it, but I can't figure out a better design right now. Differential Revision: https://reviews.llvm.org/D23599 llvm-svn: 279576
* [LTO] Add the ability to test -thinlto-emit-imports-files through llvm-lto2Mehdi Amini2016-08-191-1/+15
| | | | | | | | | | | | | | Summary: Start bringing llvm-lto2 to a level where we can test the LTO API a bit deeper. Reviewers: tejohnson Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23681 llvm-svn: 279349
* [LTO] Change addSaveTemps API: do not add dot to the supplied prefix pathMehdi Amini2016-08-181-1/+2
| | | | | | | | | | | | | | | | Summary: It does not play well with directories (end up with a bunch of hidden files). Also, do not strip the 0 suffix for the first task, especially since 0 can be used by ThinLTO as well now. Reviewers: tejohnson Subscribers: mehdi_amini, pcc, llvm-commits Differential Revision: https://reviews.llvm.org/D23612 llvm-svn: 279014
* [LTO] Fix a use-after-free introduced in r278907 and caught by ASan.Chandler Carruth2016-08-171-3/+3
| | | | | | | | | The ASan build bot caught this right away: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/15580/steps/check-llvm%20asan/logs/stdio This was also breaking a Windows build bot I'm pretty sure. llvm-svn: 278912
* [LTO] Introduce an Output class to wrap the output stream creation (NFC)Mehdi Amini2016-08-171-6/+19
| | | | | | | | | | | | | | | | | Summary: While NFC for now, this will allow more flexibility on the client side to hold state necessary to back up the stream. Also when adding caching, this class will grow in complexity. Note I blindly modified the gold-plugin as I can't compile it. Reviewers: tejohnson Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D23542 llvm-svn: 278907
* Add (hopefully last) remaining missing dependences to llvm-lto2Teresa Johnson2016-08-112-1/+3
| | | | | | | | | | There are still a few missing symbols reported by: http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15535/steps/build_llvmclang/logs/stdio http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15535/steps/build_llvmclang/logs/stdio This should hopefully take care of them. llvm-svn: 278353
* More missing llvm-lto2 dependenciesTeresa Johnson2016-08-111-0/+2
| | | | | | Follow-on to r278341: Update CMakeLists.txt to match LLVMBuild.txt llvm-svn: 278349
* Fix bot failure from r278338 due to missing dependencesTeresa Johnson2016-08-111-1/+1
| | | | | | | | Add some missing dependences to the llvm-lto2 tool to attempt to appease missing symbols in link from bot: http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15527 llvm-svn: 278341
* Restore "Resolution-based LTO API."Teresa Johnson2016-08-113-0/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This restores commit r278330, with fixes for a few bot failures: - Fix a late change I had made to the save temps output file that I missed due to existing files sitting on my disk - Fix a bunch of Windows bot failures with "ambiguous call to overloaded function" due to confusion between llvm::make_unique vs std::make_unique (preface the new make_unique calls with "llvm::") - Attempt to fix a modules bot failure by adding a missing include to LTO/Config.h. Original change: Resolution-based LTO API. Summary: This introduces a resolution-based LTO API. The main advantage of this API over existing APIs is that it allows the linker to supply a resolution for each symbol in each object, rather than the combined object as a whole. This will become increasingly important for use cases such as ThinLTO which require us to process symbol resolutions in a more complicated way than just adjusting linkage. Patch by Peter Collingbourne. Reviewers: rafael, tejohnson, mehdi_amini Subscribers: lhames, tejohnson, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D20268 llvm-svn: 278338
* Revert "Resolution-based LTO API."Teresa Johnson2016-08-113-200/+0
| | | | | | | | | | This reverts commit r278330. I made a change to the save temps output that is causing issues with the bots. Didn't realize this because I had older output files sitting on disk in my test output directory. llvm-svn: 278331
* Resolution-based LTO API.Teresa Johnson2016-08-113-0/+200
Summary: This introduces a resolution-based LTO API. The main advantage of this API over existing APIs is that it allows the linker to supply a resolution for each symbol in each object, rather than the combined object as a whole. This will become increasingly important for use cases such as ThinLTO which require us to process symbol resolutions in a more complicated way than just adjusting linkage. Patch by Peter Collingbourne. Reviewers: rafael, tejohnson, mehdi_amini Subscribers: lhames, tejohnson, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D20268 Address review comments llvm-svn: 278330
OpenPOWER on IntegriCloud