summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [ThinLTO] Auto-hide prevailing linkonce_odr only when all copies eligibleTeresa Johnson2019-05-103-3/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We hit undefined references building with ThinLTO when one source file contained explicit instantiations of a template method (weak_odr) but there were also implicit instantiations in another file (linkonce_odr), and the latter was the prevailing copy. In this case the symbol was marked hidden when the prevailing linkonce_odr copy was promoted to weak_odr. It led to unsats when the resulting shared library was linked with other code that contained a reference (expecting to be resolved due to the explicit instantiation). Add a CanAutoHide flag to the GV summary to allow the thin link to identify when all copies are eligible for auto-hiding (because they were all originally linkonce_odr global unnamed addr), and only do the auto-hide in that case. Most of the changes here are due to plumbing the new flag through the bitcode and llvm assembly, and resulting test changes. I augmented the existing auto-hide test to check for this situation. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, dexonsmith, arphaman, dang, llvm-commits, steven_wu, wmi Tags: #llvm Differential Revision: https://reviews.llvm.org/D59709 llvm-svn: 360466
* Replace 'REQUIRES: nozlib' with '!zlib' because we don't need two waysPaul Robinson2019-05-102-2/+2
| | | | | | to say the same thing. llvm-svn: 360455
* [llvm-objdump] Print st_otherFangrui Song2019-05-101-0/+36
| | | | | | | | | | | Add support for ".hidden" ".internal" ".protected" and " 0x%02x" for other st_other bits used by some architectures. Reviewed By: sfertile Differential Revision: https://reviews.llvm.org/D61718 llvm-svn: 360439
* [llvm-objcopy] Add additional testing for various casesJames Henderson2019-05-1010-41/+497
| | | | | | | | | | | | | This patch adds a number of tests to test various cases not covered by existing tests. All of them work correctly, with no need to change llvm-objcopy itself, although some do indicate possible areas for improvement. Reviewed by: MaskRay Differential Revision: https://reviews.llvm.org/D61727 llvm-svn: 360422
* llvm-dwarfdump: Add dwo parsing to --statistics.Caroline Tice2019-05-092-0/+1455
| | | | | | | | | | | Add check for, and parsing of, .dwo files to Statistics.cpp; create a new getNon SkeletonUnitDie function for DWARFUnit.h Reviewers: dblaikie Differential Revision: https://review.llvm.org/D61755 llvm-svn: 360380
* [MCA] Add support for nested and overlapping region markersAndrea Di Biagio2019-05-097-4/+265
| | | | | | | | | | | | | | | | | | | | | | | This patch fixes PR41523 https://bugs.llvm.org/show_bug.cgi?id=41523 Regions can now nest/overlap provided that they have different names. Anonymous regions cannot overlap. Region end markers must specify the region name. The only exception is for when there is only one user-defined region; in that particular case, the region end marker doesn't need to specify a name. Incorrect region end markers are no longer ignored. Instead, the tool reports an error and we exit with an error code. Added test cases to verify the new diagnostic error messages. Updated the llvm-mca docs to reflect this feature change. Differential Revision: https://reviews.llvm.org/D61676 llvm-svn: 360351
* MinidumpYAML: add support for the ThreadList streamPavel Labath2019-05-091-32/+50
| | | | | | | | | | | | | | | | | | | Summary: The implementation is a pretty straightforward extension of the pattern used for (de)serializing the ModuleList stream. Since there are other streams which use the same format (MemoryList and MemoryList64, at least). I tried to generalize the code a bit so that adding future streams of this type can be done with less code. Reviewers: amccarth, jhenderson, clayborg Subscribers: markmentovai, lldb-commits, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61423 llvm-svn: 360350
* [X86] AMD Piledriver (BdVer2): major cleanup (mainly inverse throughput)Roman Lebedev2019-05-0981-6232/+6237
| | | | | | | | | | | | | | | | I've started this cleanup more several times now, but got sidetracked elsewhere, e.g. by llvm-exegesis problems. Not this time, finally! This is mainly cleaning up the inverse throughput values, and a few latencies/uops, based on the llvm-exegesis measured values. Though this is not complete by any means, there's certainly more cleanup to be done. The performance numbers (i've only checked by RawSpeed benchmark) aren't really surprising - overall this *slightly* (< -1%) improves perf. llvm-svn: 360341
* [llvm-nm] Fix handling of symbol types 't' 'd' 'r'Fangrui Song2019-05-097-8/+195
| | | | | | | | | | | | | | | | | | | This restores part of r359311 that was reverted by r359830. Rewrite the symbol types to fix several issues. Notable difference is that the type of __init_array_start changes from 't' to 'd'. GNU nm used to mark ELF symbols relative to .init_array as 't' https://sourceware.org/bugzilla/show_bug.cgi?id=24505 (before 2.33) because ".init" is the prefix. The bug was copied by r287803. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D61551 llvm-svn: 360339
* AMDGPU: Select VOP3 form of addMatt Arsenault2019-05-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The VOP3 form should always be the preferred selection, to be shrunk later. This should only be an optimization issue, but this partially works around a problem from clobbering VCC when SIFixSGPRCopies rewrites an SCC defining operation directly to VCC. 3 of the testcases are regressions from failing to fold the immediate in cases it should. These can be avoided by improving the VCC liveness handling in SIFoldOperands. Simply increasing the threshold to computeRegisterLiveness works, although this is common enough that VCC liveness should probably be tracked throughout the pass. The hack of leaving behind an implicit_def instruction to avoid breaking iterator wastes instruction count, which inhibits finding the VCC def in long chains of adds. Doing this however exposes different, worse looking regressions from poor scheduling behavior. This could probably be avoided around by forcing the shrink of the addc here, but the scheduler should probably be fixed. The r600 add test needs to be split out because it asserts on the arguments in the new test during the calling convention lowering. llvm-svn: 360293
* [NFC]Fix British English -> American English issuesJames Henderson2019-05-081-2/+2
| | | | llvm-svn: 360252
* [llvm-objcopy] Improve error message for unrecognised archive memberJames Henderson2019-05-081-0/+45
| | | | | | | | | | | | | | Prior to this patch, llvm-objcopy's error messages for archives with unsupported members only mentioned the archive name, not the member name, making them unhelpful. This change improves it by approximately following GNU objcopy's error message syntax of "<archive name>(<member name>): <problem>". Reviewed by: grimar Differential Revision: https://reviews.llvm.org/D61674 llvm-svn: 360251
* [MCA] Don't add a name to the default code region.Andrea Di Biagio2019-05-081-1/+1
| | | | | | This is done in preparation for a patch that fixes PR41523. llvm-svn: 360243
* [llvm-objcopy] Add --prefix-alloc-sectionsJames Henderson2019-05-083-0/+73
| | | | | | | | | | | | | | | | This patch adds support for --prefix-alloc-sections, which adds a prefix to every allocated section names. It adds a prefix after renaming section names by --rename-section as GNU objcopy does. Fixes PR41266: https://bugs.llvm.org/show_bug.cgi?id=41266 Differential Revision: https://reviews.llvm.org/D60042 Patch by Seiya Nuta. llvm-svn: 360233
* [llvm-objdump] - Print relocation record in a GNU format.George Rimar2019-05-071-11/+30
| | | | | | | | | | | | | | | This fixes the https://bugs.llvm.org/show_bug.cgi?id=41355. Previously with -r we printed relocation section name instead of the target section name. It was like this: "RELOCATION RECORDS FOR [.rel.text]" Now it is: "RELOCATION RECORDS FOR [.text]" Also when relocation target section has more than one relocation section, we did not combine the output. Now we do. Differential revision: https://reviews.llvm.org/D61312 llvm-svn: 360143
* [yaml2obj] - Allow setting st_value explicitly for Symbol.George Rimar2019-05-071-0/+37
| | | | | | | | | | In some cases it is useful to explicitly set symbol's st_name value. For example, I am using it in a patch for LLD to remove the broken binary from a test case and replace it with a YAML test. Differential revision: https://reviews.llvm.org/D61180 llvm-svn: 360137
* [X86] Remove the suffix on vcvt[u]si2ss/sd register variants in assembly ↵Craig Topper2019-05-0633-176/+176
| | | | | | | | | | | | | | printing. We require d/q suffixes on the memory form of these instructions to disambiguate the memory size. We don't require it on the register forms, but need to support parsing both with and without it. Previously we always printed the d/q suffix on the register forms, but it's redundant and inconsistent with gcc and objdump. After this patch we should support the d/q for parsing, but not print it when its unneeded. llvm-svn: 360085
* [llvm-nm] Convert weak.test to use yaml2obj and fix unntested 'v'Fangrui Song2019-05-042-6/+35
| | | | | | This restores part of the good change reverted by r359830. llvm-svn: 359965
* [CommandLine] Enable Grouping for short options by default. Part 4 of 5Don Hinton2019-05-031-1/+1
| | | | | | | | | | | | | | | | | | | Summary: This change enables `cl::Grouping` for short options -- options with names of a single character. This is consistent with GNU getopt behavior. Reviewers: rnk, MaskRay Reviewed By: MaskRay Subscribers: thopre, cfe-commits, MaskRay, rupprecht, hiraditya, llvm-commits Tags: #llvm, #clang Differential Revision: https://reviews.llvm.org/D61270 llvm-svn: 359917
* Let --discard-all imply --strip-debug.Sid Manning2019-05-031-0/+5
| | | | | | | | This will match gnu strip's behavior. Differential Revision: https://reviews.llvm.org/D61092 llvm-svn: 359887
* [Object][XCOFF] Add an XCOFF dumper for llvm-readobj.Sean Fertile2019-05-034-0/+66
| | | | | | | | | | | Patch adds support for dumping of file headers with llvm-readobj. XCOFF object files are added to test dumping a well formed file, and dumping both negative timestamps and negative symbol counts, both of which are allowed in the XCOFF definition. Differential Revision: https://reviews.llvm.org/D60878 llvm-svn: 359878
* Revert [llvm-nm] Fix handling of symbol types + [llvm-nm] Generalize symbol ↵Jordan Rupprecht2019-05-024-84/+13
| | | | | | | | types This reverts r359311 and r359312 (git commit 0bf06a8f59b0074a60871865e828d92db8930c59 and 5f184f17800ea2ac27be5e4ab540cb94a46e80c7) llvm-svn: 359830
* [llvm-strip]Add --no-strip-all to disable --strip-all behaviour (including ↵James Henderson2019-05-027-20/+59
| | | | | | | | | | | | | | | | | default stripping) If certain switches are not specified, llvm-strip behaves as if --strip-all were specified. This means that for testing, when we don't want the stripping behaviour, we have to specify one of these switches, which can be confusing. This change adds --no-strip-all to allow an alternative way of suppressing the default stripping, in a less confusing manner. Reviewed by: jakehehrlich, MaskRay Differential Revision: https://reviews.llvm.org/D61377 llvm-svn: 359781
* [tests] Add host-byteorder-*-endian; update XFAILs of big-endian triplesHubert Tong2019-05-015-5/+5
| | | | | | | | | | | | | | | | | | | | Summary: Triple components in `XFAIL` lines are tested against the target triple. Various tests that are expected to fail on big-endian hosts are marked as being `XFAIL` for big-endian targets. This patch corrects these tests by having them test against a new `host-byteorder-big-endian` feature. Reviewers: xingxue, sfertile, jasonliu Reviewed By: xingxue Subscribers: jvesely, nhaehnle, fedor.sergeev, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60551 llvm-svn: 359689
* [llvm-ar][llvm-nm][llvm-size] Change -long-option to --long-option in tests. NFCFangrui Song2019-05-017-8/+8
| | | | llvm-svn: 359688
* [llvm-objdump] Print newlines before and after "Disassembly of section ...:"Fangrui Song2019-05-015-0/+16
| | | | | | | | | | | This improves readability and the behavior is consistent with GNU objdump. The new test test/tools/llvm-objdump/X86/disassemble-section-name.s checks we print newlines before and after "Disassembly of section ...:" Differential Revision: https://reviews.llvm.org/D61127 llvm-svn: 359668
* [yaml2obj] - Report when unknown section is referenced from program header ↵George Rimar2019-05-012-3/+18
| | | | | | | | | | | | declaration block. Previously we did not report this. Also this removes multiple lookups in the map what cleanups the code. Differential revision: https://reviews.llvm.org/D61322 llvm-svn: 359663
* [llvm-readobj] Change -t to --symbols in tests. NFCFangrui Song2019-05-0112-14/+14
| | | | | | | | | | -t is --symbols in llvm-readobj but --section-details (unimplemented) in readelf. The confusing option should not be used since we aim for improving compatibility. Keep just one llvm-readobj -t use case in test/tools/llvm-readobj/symbols.test llvm-svn: 359661
* [gold] Fix two readelf tests after rL359649Fangrui Song2019-05-012-2/+2
| | | | llvm-svn: 359660
* Fix test/tools/llvm-readobj/mips-plt.testFangrui Song2019-05-011-1/+1
| | | | llvm-svn: 359657
* [llvm-readobj] llvm-readobj --elf-output-style=GNU => llvm-readelf. NFCFangrui Song2019-05-0113-47/+39
| | | | | | | | | The latter is much more common. A dedicated --elf-output-style=GNU test demonstrating it is the same as llvm-readelf is sufficient. llvm-svn: 359652
* [llvm-readobj] Change -long-option to --long-option in tests. NFCFangrui Song2019-05-01138-255/+257
| | | | | | | | | | We use both -long-option and --long-option in tests. Switch to --long-option for consistency. In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf. While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf). llvm-svn: 359649
* [llvm-objcopy] Simplify SHT_NOBITS -> SHT_PROGBITS promotionFangrui Song2019-05-012-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GNU objcopy uses bfd_elf_get_default_section_type to decide the candidate section type, which roughly translates to our [a] (I assume SEC_COMMON implies SHF_ALLOC): (!(Sec.Flags & ELF::SHF_ALLOC) || Flags & (SectionFlag::SecContents | SectionFlag::SecLoad))) Then, it updates the section type in bfd/elf.c:elf_fake_sections if: if (this_hdr->sh_type == SHT_NULL) this_hdr->sh_type = sh_type; // common case else if (this_hdr->sh_type == SHT_NOBITS && sh_type == SHT_PROGBITS && (asect->flags & SEC_ALLOC) != 0) // uncommon case ... this_hdr->sh_type = sh_type; If the following condition is met the uncommon branch is executed: if (elf_section_type (osec) == SHT_NULL && (osec->flags == isec->flags || (final_link && ((osec->flags ^ isec->flags) & ~(SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_RELOC)) == 0))) I suggest we just ignore this clause and follow the common case behavior, which is done in this patch. Rationales to do so: If --set-section-flags is a no-op (osec->flags == isec->flags) (corresponds to the "readonly" test in set-section-flags.test), GNU objcopy will require (Sec.Flags & ELF::SHF_ALLOC). [a] is essentially: Flags & (SectionFlag::SecContents | SectionFlag::SecLoad) This special case is not really useful. Non-SHF_ALLOC SHT_NOBITS sections do not make much sense and it doesn't matter if they are SHT_NOBITS or SHT_PROGBITS. For all other RUN lines in set-section-flags.test, the new behavior matches GNU objcopy, i.e. this patch improves compatibility. Differential Revision: https://reviews.llvm.org/D60189 llvm-svn: 359639
* [llvm-profdata] Add overlap command to compute similarity b/w two profile filesRong Xu2019-04-309-0/+191
| | | | | | | | | Add overlap functionality to llvm-profdata tool to compute the similarity between two profile files. Differential Revision: https://reviews.llvm.org/D60977 llvm-svn: 359612
* [WebAssembly] Support EXPLICIT_NAME symbols in llvm-readobjDan Gohman2019-04-301-0/+135
| | | | | | | | | Teach llvm-readobj about WASM_SYMBOL_EXPLICIT_NAME. Differential Revision: https://reviews.llvm.org/D61323 Reviewer: sbc100 llvm-svn: 359602
* [llvm-objcopy] Add RISC-V support for -B/-OJordan Rupprecht2019-04-302-15/+43
| | | | | | | | | | | | Reviewers: jorgbrown, espindola, alexshap, jhenderson Subscribers: emaste, arichardson, fedor.sergeev, jakehehrlich, kito-cheng, shiva0217, MaskRay, rogfer01, rkruppe, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61272 llvm-svn: 359568
* [llvm-nm] Add --special-syms no-op flagEugene Leviant2019-04-301-0/+32
| | | | | | Differential revision: https://reviews.llvm.org/D60502 llvm-svn: 359563
* [llvm-objcopy] - Check dynamic relocation sections for broken references.George Rimar2019-04-302-0/+64
| | | | | | | | | | | | | | This is a fix for https://bugs.llvm.org/show_bug.cgi?id=41371. Currently, it is possible to break the sh_link field of the dynamic relocation section by removing the section it refers to. The patch fixes an issue and adds 2 test cases. One of them shows that it does not seem possible to break the sh_info field. I added an assert to verify this. Differential revision: https://reviews.llvm.org/D60825 llvm-svn: 359552
* Fix one more case of passing options with too many dashes.Don Hinton2019-04-291-1/+1
| | | | llvm-svn: 359495
* [llvm-mca][x86] Fix MMX PMOVMSKB testSimon Pilgrim2019-04-2911-33/+33
| | | | | | This is defined as part of SSE1, XMM PMOVMSKB doesn't appear until SSE2 llvm-svn: 359477
* [llvm-extract] Expose the group extraction feature of the BlockExtractorQuentin Colombet2019-04-291-0/+124
| | | | | | | | | | | | This patch extends the `-bb` option to be able to use the group extraction feature from the BlockExtractor. In particular, `-bb=func:bb` is modified to support a list of basic blocks per function: `-bb=func:bb1[;bb2...]` that will be extracted together if at all possible (region must be single entry.) Differential Revision: https://reviews.llvm.org/D60973 llvm-svn: 359464
* [DWARF] Fix dump of local/foreign TU lists in .debug_namesFangrui Song2019-04-291-0/+107
| | | | | | Differential Revision: https://reviews.llvm.org/D61241 llvm-svn: 359425
* [llvm-nm] -print-size => --print-sizeFangrui Song2019-04-291-1/+1
| | | | llvm-svn: 359417
* [MCA] Fix typo in AVX2 gather tests. NFCAndrea Di Biagio2019-04-286-18/+18
| | | | llvm-svn: 359397
* [llvm-nm][llvm-readelf] Avoid single-dash -long-option in testsFangrui Song2019-04-2710-19/+19
| | | | llvm-svn: 359383
* [llvm-nm] Fix handling of symbol types 't' 'd' 'r'Fangrui Song2019-04-264-13/+84
| | | | | | | | | | | | | | | In addition, fix and convert the two tests to yaml2obj based. This allows us to delete two executables. X86/weak.test: 'v' was not tested X86/init-fini.test: symbol types of __bss_start _edata _end were wrong GNU nm reports __init_array_start as 't', and __preinit_array_start as 'd'. __init_array_start is 't' just because its section ".init_array" starts with ".init" 'd' makes more sense and allows us to drop the weird SHT_INIT_ARRAY rule. So, change __init_array_start to 'd' instead. llvm-svn: 359311
* [llvm-nm][llvm-size] Use --double-dash options in testsFangrui Song2019-04-263-7/+7
| | | | llvm-svn: 359308
* Fix llvm-objcopy/ELF/preserve-segment-contents test on UTF-8 localeAlexandre Ganea2019-04-261-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D61137 llvm-svn: 359302
* [llvm-objcopy] Accept --long-option but not -long-optionFangrui Song2019-04-264-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-{objcopy,strip} (and many other LLVM binary utilities) accept cl::opt style -long-option as well as many short options (e.g. -p -S -x). People who use them as replacement of GNU binutils often use the grouped option syntax (POSIX Utility Conventions), e.g. -Sx => -S -x, -Wd => -W -d, -sj.text => -s -j.text There is ambiguity if a long option starts with the character used by a short option. Drop the support for -long-option to resolve the ambiguity. This divergence from other utilities is accepted (other utilities continue supporting -long-option). https://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html Reviewers: alexshap, jakehehrlich, jhenderson, rupprecht, espindola Reviewed By: jakehehrlich, jhenderson, rupprecht Subscribers: grimar, emaste, arichardson, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60439 llvm-svn: 359265
* [Object][XCOFF] Add intial support for section header table.Sean Fertile2019-04-254-0/+43
| | | | | | | | | Adds a representation of the section header table to XCOFFObjectFile, and implements enough to dump the section headers with llvm-obdump. Differential Revision: https://reviews.llvm.org/D60784 llvm-svn: 359244
OpenPOWER on IntegriCloud