summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/gold
Commit message (Collapse)AuthorAgeFilesLines
...
* [ThinLTO] Allow indexing to request backend to ignore the moduleVitaly Buka2018-02-161-0/+18
| | | | | | | | | | | | | | | | | | Summary: Gold plugin does not add pass to ThinLTO modules without useful symbols. In this case ThinLTO can't create corresponding index file and some features, like CFI, cannot be processes by backed correctly without index. Given that we don't need the backed output we can request it to avoid processing the module. This is implemented by this patch using new "SkipModuleByDistributedBackend" flag. Reviewers: pcc, tejohnson Subscribers: mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D42995 llvm-svn: 325411
* [gold] Fix error report in thinlto_emit_linked_objects.ll testVitaly Buka2018-02-143-2/+9
| | | | | | | | | Summary: It's just cleanup after r323818 to avoid irrelevant error message inside the test. Existing version of test passed but generated unrelated error report about symbol redefinition. llvm-svn: 325080
* [ThinLTO] Serialize WithGlobalValueDeadStripping index flag for distributed ↵Teresa Johnson2018-02-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | backends Summary: A recent fix to drop dead symbols (r323633) did not work for ThinLTO distributed backends because we lose the WithGlobalValueDeadStripping set on the index during the thin link. This patch adds a new flags record to the bitcode format for the index, and serializes this flag for the combined index (it would always be 0 for the per-module index generated by the compile step, so no need to serialize the new flags record there until/unless we add another flag that applies to the per-module indexes). Generally this flag should always be set for the distributed backends, which are necessarily performed after the thin link. However, if we were to simply set this flag on the index applied to the distributed backends (invoked via clang), we would lose the ability to disable dead stripping via -compute-dead=false for debugging purposes. Reviewers: grimar, pcc Subscribers: mehdi_amini, inglorion, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D42799 llvm-svn: 324444
* [ThinLTO] Remove dead and dropped symbol declarations when possibleTeresa Johnson2018-02-061-3/+3
| | | | | | | | | | | | | | | | | | | | | Summary: Removing the dropped symbols will prevent indirect call promotion in the ThinLTO Backend from adding a new reference to a symbol, which can result in linker unsats. This can happen when we compile with a sample profile collected from one binary by used for another, which may have profiled targets that aren't used in the new binary. Note that until dropDeadSymbols handles variables and aliases (in progress), we may not be able to remove the declaration and can still have an issue. Reviewers: grimar, davidxl Subscribers: mehdi_amini, inglorion, llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D42816 llvm-svn: 324299
* [ThinLTO] - Fix for "ThinLTO inlines variables that should be discarded".George Rimar2018-02-021-1/+3
| | | | | | | | | | | This fixes PR36187. Patch teaches ThinLTO to drop non-prevailing variables, just like we recently did for functions (in r323633). Differential revision: https://reviews.llvm.org/D42798 llvm-svn: 324075
* [ThinLTO/gold] Write empty imports even for modules with symbolsVitaly Buka2018-01-301-12/+15
| | | | | | | | | | | | Summary: ThinLTO may skip object for other reasons, e.g. if there is no summary. Reviewers: pcc, eugenis Subscribers: mehdi_amini, inglorion, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D42514 llvm-svn: 323818
* [ThinLTO] - Stop internalizing and drop non-prevailing symbols.George Rimar2018-01-291-3/+6
| | | | | | | | | | | Implementation marks non-prevailing symbols as not live in the summary. Then them are dropped in backends. Fixes https://bugs.llvm.org/show_bug.cgi?id=35938 Differential revision: https://reviews.llvm.org/D42107 llvm-svn: 323633
* Make GlobalValues with non-default visibilility dso_local.Rafael Espindola2018-01-182-3/+3
| | | | | | | | | | | | This is similar to r322317, but for visibility. It is not as neat because we have to special case extern_weak. The idea is the same as the previous change, make the transition to explicit dso_local easier for the frontends. With this they only have to add dso_local to symbols where we need some external information to decide if it is dso_local (like it being part of an ELF executable). llvm-svn: 322806
* Make internal/private GVs implicitly dso_local.Rafael Espindola2018-01-113-7/+7
| | | | | | | | | | | | | | | | While updating clang tests for having clang set dso_local I noticed that: - There are *a lot* of tests to update. - Many of the updates are redundant. They are redundant because a GV is "obviously dso_local". This patch starts formalizing that a bit by requiring that internal and private GVs be dso_local too. Since they all are, we don't have to print dso_local to the textual representation, making it a bit more compact and easier to read. llvm-svn: 322317
* [LTO] Make processing of combined module more consistentVitaly Buka2017-12-161-1/+14
| | | | | | | | | | | | | | | | | Summary: 1. Use stream 0 only for combined module. Previously if combined module was not processes ThinLTO used the stream for own output. However small changes in input, could trigger combined module and shuffle outputs making life of llvm::LTO harder. 2. Always process combined module and write output to stream 0. Processing empty combined module is cheap and allows llvm::LTO users to avoid implementing processing which is already done in llvm::LTO. Subscribers: mehdi_amini, inglorion, eraman, hiraditya Differential Revision: https://reviews.llvm.org/D41267 llvm-svn: 320905
* [LLVMgold] Use platform dependent extension in testsEugene Leviant2017-12-1468-104/+104
| | | | | | Differential revision: https://reviews.llvm.org/D41238 llvm-svn: 320710
* [gold] Fix broken thin LTO cache test NFCAndrew Ng2017-11-171-3/+3
| | | | | | | | Fix test as it is assuming that the cache pruning is always being performed by default. Explicitly set prune interval to 0s to ensure pruning is always performed. llvm-svn: 318520
* [LTO][ThinLTO] Use the linker resolutions to mark global values as dso_local.Sean Fertile2017-11-049-21/+22
| | | | | | | | | | | | | Now that we have a way to mark GlobalValues as local we can use the symbol resolutions that the linker plugin provides as part of lto/thinlto link step to refine the compilers view on what symbols will end up being local. Originally commited as r317374, but reverted in r317395 to update some missed tests. Differential Revision: https://reviews.llvm.org/D35702 llvm-svn: 317408
* [ThinLTO/gold] Implement ThinLTO cache pruning supportYi Kong2017-09-181-0/+36
| | | | | | Differential Revision: https://reviews.llvm.org/D37993 llvm-svn: 313592
* [gold] Fix up a new test to allow it to pass on non x86 builds.David Green2017-08-251-1/+1
| | | | | | | | Fix a test that is failing on a downstream ARM/AArch64 bootstrap. We just need add an elf_x86_64 parameter to gold. llvm-svn: 311780
* [gold] Test we don't strip globals when producing relocatables.Davide Italiano2017-08-231-0/+26
| | | | | | | lld was broken in this regard (PR33097). The gold plugin gets this right so, no changes needed, but better adding a test. llvm-svn: 311541
* [llvm] Get rid of "%T" expansionsKuba Mracek2017-08-153-12/+13
| | | | | | | | | | The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in llvm. Differential Revision: https://reviews.llvm.org/D36495 llvm-svn: 310953
* [gold] Relax this tests a little more.Davide Italiano2017-07-261-3/+3
| | | | | | Thanks to Peter for the report! llvm-svn: 309176
* [gold] Relax tests to account for difference in layout across versions.Davide Italiano2017-07-262-21/+6
| | | | llvm-svn: 309174
* [gold] Enable data-sections by default for the gold-plugin.Davide Italiano2017-07-262-0/+34
| | | | | | Follow up to r309056. llvm-svn: 309075
* [gold] Enable function-sections by default.Davide Italiano2017-07-251-0/+40
| | | | | | | | | | This is needed, among others, to respect --section-ordering-file with LTO. I'll follow up with a similar change for data sections. I hope every version of gold available on the bots has support for --section-ordering file. llvm-svn: 309056
* [LTO] Prevent dead stripping and internalization of symbols with sectionsTeresa Johnson2017-07-252-0/+89
| | | | | | | | | | | | | | | | | | | | | | | Summary: ELF linkers generate __start_<secname> and __stop_<secname> symbols when there is a value in a section <secname> where the name is a valid C identifier. If dead stripping determines that the values declared in section <secname> are dead, and we then internalize (and delete) such a symbol, programs that reference the corresponding start and end section symbols will get undefined reference linking errors. To fix this, add the section name to the IRSymtab entry when a symbol is defined in a specific section. Then use this in the gold-plugin to mark the symbol as external and visible from outside the summary when the section name is a valid C identifier. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D35639 llvm-svn: 309009
* Infer relocation model from module flags in relocatable LTO link.Evgeniy Stepanov2017-05-221-0/+63
| | | | | | Fix for PR33096. llvm-svn: 303578
* LTO: Mark undefined module asm symbols as used.Peter Collingbourne2017-04-261-2/+2
| | | | | | | | | | | | | | | | Marking them as used causes them to be considered visible outside of LTO. This prevents the symbols from being internalized or discarded, either by GlobalDCE or by summary-based dead stripping in ThinLTO. This change makes it unnecessary to add these symbols to llvm.compiler.used in the backend, as the symbols are kept alive by virtue of being external, so remove the backend code that handles that. Fixes PR32798. Differential Revision: https://reviews.llvm.org/D32544 llvm-svn: 301438
* Bitcode: Add a string table to the bitcode format.Peter Collingbourne2017-04-171-17/+5
| | | | | | | | | | | | | | | | | | | | | | | Add a top-level STRTAB block containing a string table blob, and start storing strings for module codes FUNCTION, GLOBALVAR, ALIAS, IFUNC and COMDAT in the string table. This change allows us to share names between globals and comdats as well as between modules, and improves the efficiency of loading bitcode files by no longer using a bit encoding for symbol names. Once we start writing the irsymtab to the bitcode file we will also be able to share strings between it and the module. On my machine, link time for Chromium for Linux with ThinLTO decreases by about 7% for no-op incremental builds or about 1% for full builds. Total bitcode file size decreases by about 3%. As discussed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2017-April/111732.html Differential Revision: https://reviews.llvm.org/D31838 llvm-svn: 300464
* [ThinLTO] Add support for emitting minimized bitcode for thin linkTeresa Johnson2017-03-231-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The cumulative size of the bitcode files for a very large application can be huge, particularly with -g. In a distributed build environment, all of these files must be sent to the remote build node that performs the thin link step, and this can exceed size limits. The thin link actually only needs the summary along with a bitcode symbol table. Until we have a proper bitcode symbol table, simply stripping the debug metadata results in significant size reduction. Add support for an option to additionally emit minimized bitcode modules, just for use in the thin link step, which for now just strips all debug metadata. I plan to add a cc1 option so this can be invoked easily during the compile step. However, care must be taken to ensure that these minimized thin link bitcode files produce the same index as with the original bitcode files, as these original bitcode files will be used in the backends. Specifically: 1) The module hash used for caching is typically produced by hashing the written bitcode, and we want to include the hash that would correspond to the original bitcode file. This is because we want to ensure that changes in the stripped portions affect caching. Added plumbing to emit the same module hash in the minimized thin link bitcode file. 2) The module paths in the index are constructed from the module ID of each thin linked bitcode, and typically is automatically generated from the input file path. This is the path used for finding the modules to import from, and obviously we need this to point to the original bitcode files. Added gold-plugin support to take a suffix replacement during the thin link that is used to override the identifier on the MemoryBufferRef constructed from the loaded thin link bitcode file. The assumption is that the build system can specify that the minimized bitcode file has a name that is similar but uses a different suffix (e.g. out.thinlink.bc instead of out.o). Added various tests to ensure that we get identical index files out of the thin link step. Reviewers: mehdi_amini, pcc Subscribers: Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D31027 llvm-svn: 298638
* LTO: When creating a local cache, create the cache directory if it does not ↵Peter Collingbourne2017-03-021-2/+2
| | | | | | | | already exist. Differential Revision: https://reviews.llvm.org/D30519 llvm-svn: 296726
* [ThinLTO] PrintStatistics when we exit early for thinlto-index-onlyTeresa Johnson2017-02-021-0/+7
| | | | | | | | | | | | | | Summary: This is necessary to get stats from the ThinLink printed before the early exit when compiling in a distributed build. Reviewers: mehdi_amini Subscribers: Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D29461 llvm-svn: 293908
* gold-plugin: Fix test case.Peter Collingbourne2017-01-261-1/+2
| | | | llvm-svn: 293137
* gold-plugin: Simplify naming of object files created with save-temps or ↵Peter Collingbourne2017-01-261-2/+2
| | | | | | | | | | obj-path. Now we never append a number to the file name for task ID 0. Differential Revision: https://reviews.llvm.org/D29160 llvm-svn: 293132
* gold-plugin: Add the file path to the file open error diagnostic.Peter Collingbourne2017-01-251-0/+8
| | | | llvm-svn: 293013
* [ThinLTO] Drop non-prevailing non-ODR weak to declarationsTeresa Johnson2017-01-204-10/+84
| | | | | | | | | | | | | | | Summary: Allow non-ODR weak/linkonce non-prevailing copies to be marked as available_externally in the index. Add support for dropping these to declarations in the backend. Reviewers: mehdi_amini, pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28806 llvm-svn: 292656
* Fix x86 gold tests on non-x86 targets.Asiri Rathnayake2017-01-0413-0/+31
| | | | | | | | | | These tests are missing a target triple and the -m elf_x86_64 gold option, which makes them fail on non-x86 targets. Differential revision: https://reviews.llvm.org/D28285 Reviewers: tejohnson llvm-svn: 290965
* Pass sample pgo flags to thinlto.Dehao Chen2016-12-162-0/+27
| | | | | | | | | | | | Summary: ThinLTO needs to invoke SampleProfileLoader pass during link time in order to annotate profile correctly after module importing. Reviewers: davidxl, mehdi_amini, tejohnson Subscribers: pcc, davide, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D27790 llvm-svn: 289957
* [gold] Add datalayout to test where it was missingTeresa Johnson2016-12-152-0/+6
| | | | | | | | | Needed due to change to require datalayout (r289719). Found this in my own testing, maybe there aren't any bots using a v1.12 gold yet. llvm-svn: 289876
* [gold] Add datalayout to two tests where it was missing.Davide Italiano2016-12-142-0/+6
| | | | | | Reported by: thakis via chromium bots. llvm-svn: 289737
* [LTO] Reject modules without datalayout.Davide Italiano2016-12-1472-1/+121
| | | | | | | | | | | Also, udpate the ~60 failing tests in the tree which did not contain a valid datalayout. This fixes PR31123. lld will be updated in a following patch, immediately after this is committed. Differential Revision: https://reviews.llvm.org/D27082 llvm-svn: 289719
* Fix test/tools/gold/X86/thinlto_funcimport.ll on non-X86 hostsJohn Brawn2016-11-111-2/+2
| | | | | | Pass -m elf_x86_64 to gold, as is done in other tests. llvm-svn: 286593
* [ThinLTO] Disable importing and other cross-module optis at -O0Teresa Johnson2016-10-312-0/+38
| | | | | | | | | | | | | | | | 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] Correctly resolve linkonce when importing aliaseeTeresa Johnson2016-10-301-14/+29
| | | | | | | | | | | | | | | | | | | Summary: When we have an aliasee that is linkonce, while we can't convert the non-prevailing copies to available_externally, we still need to convert the prevailing copy to weak. If a reference to the aliasee is exported, not converting a copy to weak will result in undefined references when the linkonce is removed in its original module. Add a new test and update existing tests. Reviewers: mehdi_amini Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26076 llvm-svn: 285512
* Fix test on non-x86 hostsBernard Ogden2016-10-111-1/+1
| | | | | | | | | | Summary: This test is allowed to run on non-x86 hosts and thus must use llvm-nm rather than nm. Differential Revision: https://reviews.llvm.org/D25473 llvm-svn: 283901
* ThinLTO: Fix Gold test after caching fix in r283655Mehdi Amini2016-10-081-1/+15
| | | | | | (I don't have Gold available, so this is speculative) llvm-svn: 283681
* [gold] Split plugin options controlling ThinLTO and codegen parallelism.Teresa Johnson2016-09-231-1/+1
| | | | | | | | | | | | | | | | Summary: As suggested in D24826, use different options for ThinLTO backend parallelism from the option controlling regular LTO code gen parallelism. They are already split in the LTO API, and this enables controlling them with different clang options. Reviewers: pcc, mehdi_amini Subscribers: dexonsmith, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D24873 llvm-svn: 282290
* [ThinLTO] Emit files for distributed builds for all modulesTeresa Johnson2016-09-211-0/+12
| | | | | | | | | | | | | | | | | | | | With the new LTO API in r278338, we stopped emitting the individual index files and imports files for some modules in the distributed backend case (thinlto-index-only plugin option). Specifically, this is when the linker decides not to include a module in the link, because it was in an archive library and did not have a strong reference to it. Not creating the expected output files makes the distributed build system implementation more difficult, in terms of checking for the expected outputs of the thin link, and scheduling the backend jobs. To address this, the gold-plugin will write dummy empty .thinlto.bc and .imports files for modules not included in the link (which LTO never sees). Augmented a gold v1.12+ test, since that version of gold has the handling for notifying on modules not being included in the link. llvm-svn: 282100
* [ThinLTO] Always emit a summary when compiling in ThinLTO modeTeresa Johnson2016-09-202-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Emit an empty summary section, instead of no summary section, when there are no global variables in the index. This ensures that LTO will treat these files as ThinLTO inputs, instead of as regular LTO inputs. In addition to not being what the user likely intended when compiling with -flto=thin, the current behavior is problematic for distributed build systems that expect to get ThinLTO index and imports files back for each input compiled with -flto=thin. Combining into a single regular LTO module also reduces the backend parallelism. And in the case where the index was suppressed due to uses in inline assembly, combining into a single LTO module could provoke renaming of duplicates that we were trying to prevent by suppressing the index. This change required a couple of fixes to handle the empty summary section. Reviewers: mehdi_amini Subscribers: mehdi_amini, llvm-commits, pcc Differential Revision: https://reviews.llvm.org/D24779 llvm-svn: 282037
* [LTO] Use llvm-nm instead of nm in new testsTeresa Johnson2016-09-161-1/+1
| | | | | | | | | | | The use of nm in the new tests added with r281725 caused a couple of bot failures: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15701 http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/6939 Use llvm-nm instead. llvm-svn: 281750
* [LTO] Prevent asm references to be dropped from the output.Davide Italiano2016-09-161-0/+28
| | | | | | Differential Revision: https://reviews.llvm.org/D24617 llvm-svn: 281741
* [LTO] Fix handling of mixed (regular and thin) mode LTOTeresa Johnson2016-09-162-0/+24
| | | | | | | | | | | | | | | | | | | | | Summary: In runThinLTO we start the task numbering for ThinLTO backend tasks depending on whether there was also a regular LTO object (CombinedModule). However, the CombinedModule is moved at the end of runRegularLTO, so we need to save this information and pass it into runThinLTO. Otherwise the AddOutput callback to the client will use the same task number for both the regular LTO object and the first ThinLTO object, which in gold-plugin caused only one to be end up in the output filename array and therefore passed back to gold for the final native link. Reviewers: pcc, mehdi_amini Subscribers: mehdi_amini, kromanova Differential Revision: https://reviews.llvm.org/D24643 llvm-svn: 281725
* [LTO] Don't pass SF_Undefined symbols to the IRmover.Davide Italiano2016-09-131-0/+18
| | | | | | This should fix PR 30363. llvm-svn: 281366
* [gold/LTO] Add test case for r281134Teresa Johnson2016-09-101-0/+10
| | | | | | Add test case that was supposed to go in with r281134. llvm-svn: 281135
OpenPOWER on IntegriCloud