summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/gold
Commit message (Collapse)AuthorAgeFilesLines
...
* testcase gardening: update the emissionKind enum to the new syntax. (NFC)Adrian Prantl2016-04-013-3/+3
| | | | llvm-svn: 265081
* Fix gold tests for llvm-readobj format change.Rafael Espindola2016-03-242-4/+6
| | | | llvm-svn: 264306
* [ThinLTO] Renaming of function index to module summary index (NFC)Teresa Johnson2016-03-153-7/+7
| | | | | | | | | | | | | | | (Resubmitting after fixing missing file issue) With the changes in r263275, there are now more than just functions in the summary. Completed the renaming of data structures (started in r263275) to reflect the wider scope. In particular, changed the FunctionIndex* data structures to ModuleIndex*, and renamed related variables and comments. Also renamed the files to reflect the changes. A companion clang patch will immediately succeed this patch to reflect this renaming. llvm-svn: 263513
* Revert "[ThinLTO] Renaming of function index to module summary index (NFC)"Teresa Johnson2016-03-143-7/+7
| | | | | | This reverts commit r263490. Missed a file. llvm-svn: 263493
* [ThinLTO] Renaming of function index to module summary index (NFC)Teresa Johnson2016-03-143-7/+7
| | | | | | | | | | | | | With the changes in r263275, there are now more than just functions in the summary. Completed the renaming of data structures (started in r263275) to reflect the wider scope. In particular, changed the FunctionIndex* data structures to ModuleIndex*, and renamed related variables and comments. Also renamed the files to reflect the changes. A companion clang patch will immediately succeed this patch to reflect this renaming. llvm-svn: 263490
* [ThinLTO] Support for reference graph in per-module and combined summary.Teresa Johnson2016-03-111-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds support for including a full reference graph including call graph edges and other GV references in the summary. The reference graph edges can be used to make importing decisions without materializing any source modules, can be used in the plugin to make file staging decisions for distributed build systems, and is expected to have other uses. The call graph edges are recorded in each function summary in the bitcode via a list of <CalleeValueIds, StaticCount> tuples when no PGO data exists, or <CalleeValueId, StaticCount, ProfileCount> pairs when there is PGO, where the ValueId can be mapped to the function GUID via the ValueSymbolTable. In the function index in memory, the call graph edges reference the target via the CalleeGUID instead of the CalleeValueId. The reference graph edges are recorded in each summary record with a list of referenced value IDs, which can be mapped to value GUID via the ValueSymbolTable. Addtionally, a new summary record type is added to record references from global variable initializers. A number of bitcode records and data structures have been renamed to reflect the newly expanded scope of the summary beyond functions. More cleanup will follow. Reviewers: joker.eph, davidxl Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D17212 llvm-svn: 263275
* [gold] Fix common symbols handling.Evgeniy Stepanov2016-03-112-0/+23
| | | | | | | | | | | | LLVM Gold plugin decides which instance of a common symbol it wants based on the symbol size in claim_file_hook. If the file that contains the chosen instance is later dropped from the link, we end up with an undefined reference. This change delays this decision until the set of the included files is known. llvm-svn: 263180
* Fix new gold test to specify emulation mode.Teresa Johnson2016-03-041-1/+1
| | | | | | | | | | The thinlto_linkonceresolution.ll gold linker test introduced in r262727 included a target triple, but didn't set the emulation mode, which is necessary since the default linker target may be different. Patch by H.J. Lu llvm-svn: 262745
* [ThinLTO] Ensure prevailing linkonce emitted as weak in ThinLTO backendsTeresa Johnson2016-03-042-0/+36
| | | | | | | | | | | | | | | | | | | | | | | Summary: Since IR files are all compiled into separate independent object files in ThinLTO mode, the prevailing linkonce symbols must be emitted in its object file even if it is no longer referenced there, e.g. if no references remain in the module after inlining, since it may be referenced by another ThinLTO compiled object file. This is done by changing LDPR_PREVAILING_DEF_IRONLY* symbols to LDPR_PREVAILING_DEF, which converts the prevailing linkonce to weak. We also don't need the other prevailing IRONLY handling for internalization, which is not currently performed for ThinLTO. Test case included. Reviewers: davidxl, rafael Subscribers: rafael, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16173 llvm-svn: 262727
* [ThinLTO] Launch importing backends in parallel threads from gold pluginTeresa Johnson2016-03-042-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Launch ThinLTO backends (LTO and codegen pipelines with importing) in parallel using a ThreadPool, after creating the combined index. The number of threads is controlled by the existing -jobs gold plugin option, or the hardware concurrency if not specified. The old behavior of exiting after creating the combined index can be invoked via a new thinlto-index-only plugin option. This commit involves just the ThinLTO-specific pieces of D15390, the NFC and other restructuring pieces were committed independently: r262677: Add hardware_concurrency interface to llvm::thread (NFC) r262719: Change split code gen to use ThreadPool r262721: Refactor gold-plugin codegen to prepare for ThinLTO threads (NFC) Reviewers: pcc, joker.eph, rafael Subscribers: rafael, davidxl, llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D15390 llvm-svn: 262724
* Restore "[ThinLTO] Use MD5 hash in function index." with fixTeresa Johnson2016-02-101-2/+4
| | | | | | | | | | | This restores commit r260408, along with a fix for a bot failure. The bot failure was caused by dereferencing a unique_ptr in the same call instruction parameter list where it was passed via std::move. Apparently due to luck this was not exposed when I built the compiler with clang, only with gcc. llvm-svn: 260442
* Revert "[ThinLTO] Use MD5 hash in function index." due to bot failureTeresa Johnson2016-02-101-4/+2
| | | | | | This reverts commit r260408. Bot failure that I need to investigate. llvm-svn: 260412
* [ThinLTO] Use MD5 hash in function index.Teresa Johnson2016-02-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch uses the lower 64-bits of the MD5 hash of a function name as a GUID in the function index, instead of storing function names. Any local functions are first given a global name by prepending the original source file name. This is the same naming scheme and GUID used by PGO in the indexed profile format. This change has a couple of benefits. The primary benefit is size reduction in the combined index file, for example 483.xalancbmk's combined index file was reduced by around 70%. It should also result in memory savings for the index file in memory, as the in-memory map is also indexed by the hash instead of the string. Second, this enables integration with indirect call promotion, since the indirect call profile targets are recorded using the same global naming convention and hash. This will enable the function importer to easily locate function summaries for indirect call profile targets to enable their import and subsequent promotion. The original source file name is recorded in the bitcode in a new module-level record for use in the ThinLTO backend pipeline. Reviewers: davidxl, joker.eph Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D17028 llvm-svn: 260408
* WholeProgramDevirt: introduce.Peter Collingbourne2016-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This pass implements whole program optimization of virtual calls in cases where we know (via bitset information) that the list of callees is fixed. This includes the following: - Single implementation devirtualization: if a virtual call has a single possible callee, replace all calls with a direct call to that callee. - Virtual constant propagation: if the virtual function's return type is an integer <=64 bits and all possible callees are readnone, for each class and each list of constant arguments: evaluate the function, store the return value alongside the virtual table, and rewrite each virtual call as a load from the virtual table. - Uniform return value optimization: if the conditions for virtual constant propagation hold and each function returns the same constant value, replace each virtual call with that constant. - Unique return value optimization for i1 return values: if the conditions for virtual constant propagation hold and a single vtable's function returns 0, or a single vtable's function returns 1, replace each virtual call with a comparison of the vptr against that vtable's address. Differential Revision: http://reviews.llvm.org/D16795 llvm-svn: 260312
* Fix gold test after r256465.James Y Knight2015-12-291-1/+1
| | | | | | | That commit added a new pass, and this test is sensitive to what the first pass after verify is called. llvm-svn: 256532
* Handle empty Subprogram list when linking metadata.Teresa Johnson2015-12-221-0/+17
| | | | | | | | Use an iterator that handles an empty subprogram list. Fixes PR25915. llvm-svn: 256224
* Add testcase for r256161 (PR25907)Teresa Johnson2015-12-211-0/+28
| | | | llvm-svn: 256174
* [ThinLTO/LTO] Don't link in unneeded metadataTeresa Johnson2015-12-182-5/+41
| | | | | | | | | | | | | | | | | | | | Summary: Third patch split out from http://reviews.llvm.org/D14752. Only map in needed DISubroutine metadata (imported or otherwise linked in functions and other DISubroutine referenced by inlined instructions). This is supported for ThinLTO, LTO and llvm-link --only-needed, with associated tests for each one. Depends on D14838. Reviewers: dexonsmith, joker.eph Subscribers: davidxl, llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D14843 llvm-svn: 256003
* Pass -m elf_x84_64 to gold invocations.Rafael Espindola2015-12-171-2/+2
| | | | | | Fixes pr25868. llvm-svn: 255930
* Slit lib/Linker in two.Rafael Espindola2015-12-101-1/+1
| | | | | | | | | | | | | | | | A linker normally has two stages: symbol resolution and "moving stuff". In lib/Linker there is the complication of lazy linking some globals, but it was still far more mixed than it needed to. This splits the linker into a lower level IRMover and the linker proper. The IRMover just takes a list of globals to move and a callback that lets the user control what is lazy linked. The main motivation is that now tools/gold (and soon lld) can use their own symbol resolution to instruct IRMover what to do. llvm-svn: 255254
* Add a passing test.Rafael Espindola2015-11-292-0/+28
| | | | | | When a comdat is discarded, any globals defined in it become undefined. llvm-svn: 254258
* Don't depend on the order the IR is copied.Rafael Espindola2015-11-291-12/+13
| | | | llvm-svn: 254257
* Don't depend on the order the IR is copied.Rafael Espindola2015-11-291-14/+14
| | | | llvm-svn: 254256
* Test both input file orders.Rafael Espindola2015-11-271-2/+7
| | | | llvm-svn: 254186
* Add missing file.Rafael Espindola2015-11-271-0/+3
| | | | llvm-svn: 254185
* Make the test a bit more interesting.Rafael Espindola2015-11-271-2/+8
| | | | | | It now covers a regular function replacing an available_externally one. llvm-svn: 254184
* Add a few passing lto tests.Rafael Espindola2015-11-2612-0/+168
| | | | | | | | | | | | | | | I found these while trying to get a prototype to bootstrap. They cover things like * Handling of non linker visible stuff (append, available_externally) * Type merging * Alias to dropped globals * Dropping linkage when converting to a declaration. These should hopefully be generally useful for anyone refactoring the plugin. llvm-svn: 254174
* Make this test a bit more strict.Rafael Espindola2015-11-241-9/+18
| | | | | | It now tests with files in both orders. llvm-svn: 253993
* Add an already passing test.Rafael Espindola2015-11-242-0/+28
| | | | | | | | | This tests that a declaration can resolve to an alias. I broke this locally while prototyping a change and it looks like a nice test to have. llvm-svn: 253984
* Have a single way for creating unique value names.Rafael Espindola2015-11-221-6/+6
| | | | | | | | | | | We had two code paths. One would create names like "foo.1" and the other names like "foo1". For globals it is important to use "foo.1" to help C++ name demangling. For locals there is no strong reason to go one way or the other so I kept the most common mangling (foo1). llvm-svn: 253804
* [ThinLTO] Handle bitcode without function summary sections gracefullyTeresa Johnson2015-11-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Several fixes to the handling of bitcode files without function summary sections so that they are skipped during ThinLTO processing in llvm-lto and the gold plugin when appropriate instead of aborting. 1 Don't assert when trying to add a FunctionInfo that doesn't have a summary attached. 2 Skip FunctionInfo structures that don't have attached function summary sections when trying to create the combined function summary. 3 In both llvm-lto and gold-plugin, check whether a bitcode file has a function summary section before trying to parse the index, and skip the bitcode file if it does not. 4 Fix hasFunctionSummaryInMemBuffer in BitcodeReader, which had a bug where we returned to early while looking for the summary section. Also added llvm-lto and gold-plugin based tests for cases where we don't have function summaries in the bitcode file. I verified that either the first couple fixes described above are enough to avoid the crashes, or fixes 1,3,4. But have combined them all here for added robustness. Reviewers: joker.eph Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D14903 llvm-svn: 253796
* [LTO] Appease buildbots take 3James Molloy2015-11-181-2/+2
| | | | | | | | This time I've found a linux box and checked it there. This test now passes. Because I'd introduced an undefined reference in @bar, gold now returns an error. This doesn't matter for the test itself, because it also emits the remarks the test is checking for. But it does cause LIT to notice a nonzero return code which it faults on. llvm-svn: 253454
* [LTO] Buildbot appeasing take 2James Molloy2015-11-181-1/+1
| | | | | | Let's try again. This time using the right function signature. It's a real pity I can't run this on a darwin machine... llvm-svn: 253453
* [LTO] Fix up test/tools/gold/X86/remarks.llJames Molloy2015-11-181-1/+4
| | | | | | It needs the same fixes as in test/LTO/X86/remarks.ll, but this test appears not to get run on my system (but does on the buildbot). Strange. llvm-svn: 253452
* Support for llvm-bcanalyzer dumping of record array strings.Teresa Johnson2015-10-081-2/+6
| | | | | | | | | | | | | | | | | | Summary: Adds support for automatically detecting and printing strings represented by Array abbrev operands, analogous to the string dumping performed for Blob abbrev operands. Enhanced the ThinLTO combined index test to check for the appropriate module and function strings. Reviewers: dexonsmith, joker.eph, davidxl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13553 llvm-svn: 249695
* Support for function summary index bitcode sections and files.Teresa Johnson2015-10-042-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The bitcode format is described in this document: https://drive.google.com/file/d/0B036uwnWM6RWdnBLakxmeDdOeXc/view For more info on ThinLTO see: https://sites.google.com/site/llvmthinlto The first customer is ThinLTO, however the data structures are designed and named more generally based on prior feedback. There are a few comments regarding how certain interfaces are used by ThinLTO, and the options added here to gold currently have ThinLTO-specific names as the behavior they provoke is currently ThinLTO-specific. This patch includes support for generating per-module function indexes, the combined index file via the gold plugin, and several tests (more are included with the associated clang patch D11908). Reviewers: dexonsmith, davidxl, joker.eph Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13107 llvm-svn: 249270
* Disable the second verification run when performing LTO throughTeresa Johnson2015-09-161-0/+25
| | | | | | | | gold in NDEBUG mode. Follow on patch for r247729 - LTO: Disable extra verify runs in release builds. llvm-svn: 247824
* Tweak 2 x86 gold tests so they can run on non-x86 platformsArnaud A. de Grandmaison2015-09-112-3/+5
| | | | llvm-svn: 247415
* Fix llvm/test/tools/gold/X86/bad-alias.ll.NAKAMURA Takumi2015-09-111-2/+2
| | | | llvm-svn: 247391
* Fix the gold test cases after alias changesDavid Blaikie2015-09-111-1/+1
| | | | llvm-svn: 247381
* [opaque pointer type] Add textual IR support for explicit type parameter for ↵David Blaikie2015-09-114-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | global aliases update.py: import fileinput import sys import re alias_match_prefix = r"(.*(?:=|:|^)\s*(?:external |)(?:(?:private|internal|linkonce|linkonce_odr|weak|weak_odr|common|appending|extern_weak|available_externally) )?(?:default |hidden |protected )?(?:dllimport |dllexport )?(?:unnamed_addr |)(?:thread_local(?:\([a-z]*\))? )?alias" plain = re.compile(alias_match_prefix + r" (.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|addrspacecast|\[\[[a-zA-Z]|\{\{).*$)") cast = re.compile(alias_match_prefix + r") ((?:bitcast|inttoptr|addrspacecast)\s*\(.* to (.*?)(| addrspace\(\d+\) *)\*\)\s*(?:;.*)?$)") gep = re.compile(alias_match_prefix + r") ((?:getelementptr)\s*(?:inbounds)?\s*\((?P<type>.*), (?P=type)(?:\s*addrspace\(\d+\)\s*)?\* .*\)\s*(?:;.*)?$)") def conv(line): m = re.match(cast, line) if m: return m.group(1) + " " + m.group(3) + ", " + m.group(2) m = re.match(gep, line) if m: return m.group(1) + " " + m.group(3) + ", " + m.group(2) m = re.match(plain, line) if m: return m.group(1) + ", " + m.group(2) + m.group(3) + "*" + m.group(4) + "\n" return line for line in sys.stdin: sys.stdout.write(conv(line)) apply.sh: for name in "$@" do python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name" rm -f "$name.tmp" done The actual commands: From llvm/src: find test/ -name *.ll | xargs ./apply.sh From llvm/src/tools/clang: find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}" From llvm/src/tools/polly: find test/ -name *.ll | xargs ./apply.sh llvm-svn: 247378
* Tweak llvm/test/tools/gold/X86/parallel.ll to run with pthread-unaware ↵NAKAMURA Takumi2015-09-031-4/+1
| | | | | | | | | ld.gold on Linux. If ld.gold is configured without --enable-thread, ld.gold might not load libpthread.so. Preloading LLVMgold.so loads also libpthread.so. llvm-svn: 246739
* Suppress llvm/test/tools/gold/X86/parallel.ll while investigating.NAKAMURA Takumi2015-09-021-0/+3
| | | | | | | | | For me, Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7deb0dc in _dl_fixup () from /lib64/ld-linux-x86-64.so.2 llvm-svn: 246641
* gold-plugin: Implement parallel LTO code generation using llvm::splitCodeGen.Peter Collingbourne2015-09-011-0/+22
| | | | | | | | | Parallelism can be enabled using a new plugin option, jobs=N, where N is the number of code generation threads. Differential Revision: http://reviews.llvm.org/D12308 llvm-svn: 246584
* Split the gold tests into X86 and PowerPC directories.Rafael Espindola2015-08-2832-1/+3
| | | | | | Patch by Than McIntosh! llvm-svn: 246328
* Pass -m to the linker in this test.Rafael Espindola2015-06-231-1/+1
| | | | | | Fixes the test on a ppc host. llvm-svn: 240431
* Add a triple to the test to fix it on some hosts.Rafael Espindola2015-06-221-1/+1
| | | | | | | | The slp vectorizer doesn't optimize this case in 32 bits. Fixes PR23453. llvm-svn: 240289
* gold-plugin: save the .o when given -save-temps.Rafael Espindola2015-06-151-0/+3
| | | | | | | The plugin now save the bitcode before and after optimizations and the .o that is passed to the linker. llvm-svn: 239726
* Add -m -m elf_x86_64 to gold invocations.Rafael Espindola2015-03-243-4/+5
| | | | | | | | | | Otherwise the tests would fail if the default was not elf_x86_64. This fixes PR22966. Patch by H.J. Lu! llvm-svn: 233124
* libLTO, llvm-lto, gold: Introduce flag for controlling optimization level.Peter Collingbourne2015-03-191-0/+50
| | | | | | | | | | This change also introduces a link-time optimization level of 1. This optimization level runs only the globaldce pass as well as cleanup passes for passes that run at -O0, specifically simplifycfg which cleans up lowerbitsets. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150316/266951.html llvm-svn: 232769
OpenPOWER on IntegriCloud