summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
* Partial revert of "[llvm-ar] Document response file support in --help"Sam Clegg2019-06-291-9/+0
| | | | | | | | | This is partial revert of 70a8027c60fe1f95e8a8a1ff6575ebf8778d3544. The test apparently failed on win32 bots due to the way slashes in pathnames are handled. llvm-svn: 364705
* [llvm-ar] Document response file support in --helpSam Clegg2019-06-281-0/+9
| | | | | | | | Also a test for this. Differential Revision: https://reviews.llvm.org/D63836 llvm-svn: 364673
* [llvm-cov[ Fix lcov coverage report contains functions from other ↵Max Moroz2019-06-281-0/+12
| | | | | | | | | | | | | | | | | | compilation units. Summary: Patch by Chuan Qiu (@eagleonhill). Reviewers: Dor1s Reviewed By: Dor1s Subscribers: lebedev.ri, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63571 llvm-svn: 364653
* [llvm-nm] Fix for BZ41711 - Class character for a symbol with undefinedChris Jackson2019-06-271-23/+23
| | | | | | | | | | binding does not match class assigned by GNU nm Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=41711 Differential Revision: https://reviews.llvm.org/D63340 llvm-svn: 364559
* [DWARF] Handle the DW_OP_entry_value operandDjordje Todorovic2019-06-272-0/+118
| | | | | | | | | | | | | | | Add the IR and the AsmPrinter parts for handling of the DW_OP_entry_values DWARF operation. ([11/13] Introduce the debug entry values.) Co-authored-by: Ananth Sowda <asowda@cisco.com> Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com> Co-authored-by: Ivan Baev <ibaev@cisco.com> Differential Revision: https://reviews.llvm.org/D60866 llvm-svn: 364542
* [yaml2obj] - Allow overriding e_shentsize, e_shoff, e_shnum and e_shstrndx ↵George Rimar2019-06-271-0/+61
| | | | | | | | | | | | fields in the YAML. This allows setting different values for e_shentsize, e_shoff, e_shnum and e_shstrndx fields and is useful for producing broken inputs for various test cases. Differential revision: https://reviews.llvm.org/D63771 llvm-svn: 364517
* BitStream reader: propagate errorsJF Bastien2019-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | The bitstream reader handles errors poorly. This has two effects: * Bugs in file handling (especially modules) manifest as an "unexpected end of file" crash * Users of clang as a library end up aborting because the code unconditionally calls `report_fatal_error` The bitstream reader should be more resilient and return Expected / Error as soon as an error is encountered, not way late like it does now. This patch starts doing so and adopting the error handling where I think it makes sense. There's plenty more to do: this patch propagates errors to be minimally useful, and follow-ups will propagate them further and improve diagnostics. https://bugs.llvm.org/show_bug.cgi?id=42311 <rdar://problem/33159405> Differential Revision: https://reviews.llvm.org/D63518 llvm-svn: 364464
* Fix frame.s test dir-separator checksSimon Pilgrim2019-06-251-10/+10
| | | | | | Handle / and \ separators llvm-svn: 364301
* [yaml2obj/obj2yaml] - Allow having the symbols and sections with duplicated ↵George Rimar2019-06-253-0/+422
| | | | | | | | | | | | names. The patch teaches yaml2obj/obj2yaml to support parsing/dumping the sections and symbols with the same name. A special suffix is added to a name to make it unique. Differential revision: https://reviews.llvm.org/D63596 llvm-svn: 364282
* [NFC] Fix tests added in r364225 which failed on Windows due to incorrect ↵Douglas Yung2019-06-242-13/+13
| | | | | | path separators. llvm-svn: 364249
* llvm-symbolizer: Add a FRAME command.Peter Collingbourne2019-06-243-0/+1449
| | | | | | | | | | | | | | | | | | | This command prints a description of the referenced function's stack frame. For each formal parameter and local variable, the tool prints: - function name - variable name - file/line of declaration - FP-relative variable location (if available) - size in bytes - HWASAN tag offset This information will be used by the HWASAN runtime to identify local variables in UAR reports. Differential Revision: https://reviews.llvm.org/D63468 llvm-svn: 364225
* [llvm-objdump] Match GNU objdump on symbol types shown in disassemblyYuanfang Chen2019-06-241-10/+49
| | | | | | | | | | | | output. STT_OBJECT and STT_COMMON are dumped as data, not disassembled. https://bugs.llvm.org/show_bug.cgi?id=41947 Differential Revision: https://reviews.llvm.org/D62964 llvm-svn: 364211
* [llvm-readobj/llvm-readelf] - Eliminate the elf-groups.x86_64 precompiled ↵George Rimar2019-06-243-62/+80
| | | | | | | | | | | | | | | | binary from the inputs. We do not need the elf-groups.x86_64. In one of the tests, it was used for no solid reason, and for the second test case we can use YAML input with SHT_GROUP sections. The patch performs a cleanup of one of the test cases, removes another one completely (since during the review was found out it actually duplicates one of the existent tests) and removes the precompiled binary. Differential revision: https://reviews.llvm.org/D63647 llvm-svn: 364167
* Fix UNSUPPORTED attribute from windows to system-windows.Douglas Yung2019-06-221-1/+1
| | | | llvm-svn: 364122
* [llvm-objdump] Allow --disassemble-functions to take demangled namesYuanfang Chen2019-06-222-27/+61
| | | | | | | | | | | | | The --disassemble-functions switch takes demangled names when --demangle is specified, otherwise the switch takes mangled names. https://bugs.llvm.org/show_bug.cgi?id=41908 Reviewers: jhenderson, grimar, MaskRay, rupprecht Differential Revision: https://reviews.llvm.org/D63524 llvm-svn: 364121
* [llvm-objdump] Move --start-address >= --stop-address check out of theYuanfang Chen2019-06-221-2/+2
| | | | | | | | | | | | | | | | | | | | -d code. Summary: Move it into `main` function so the checking is effective for all actions user may do with llvm-objdump; notably, -r and -s in addition to existing -d. Match GNU behavior. Reviewers: jhenderson, grimar, MaskRay, rupprecht Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63631 llvm-svn: 364118
* [llvm-lipo] Implement -thinShoaib Meenai2019-06-216-1/+404
| | | | | | | | | | Creates thin output file of specified arch_type from the fat input file. Patch by Anusha Basana <anushabasana@fb.com> Differential Revision: https://reviews.llvm.org/D63341 llvm-svn: 364107
* [llvm-objcopy] - Get rid of dynrel.elf precompiled binary from inputs.George Rimar2019-06-213-20/+64
| | | | | | | | | | We do not have to spread using the precompiled binaries in the tests, when we can use YAML. This patch removes the dynrel.elf binary and adds a few comments to the test cases. Differential revision: https://reviews.llvm.org/D63641 llvm-svn: 364052
* [llvm-readobj] - Inline a few yaml inputs into test cases.George Rimar2019-06-216-294/+293
| | | | | | | | | There are some test that are splitted into main part + input yaml for no visible reason. This patch inines the yaml part for the 3 test cases I found. Differential revision: https://reviews.llvm.org/D63644 llvm-svn: 364049
* Set an explicit x86 triple for test bottleneck-analysis.s added by my ↵Andrea Di Biagio2019-06-211-1/+1
| | | | | | | | r364045. NFC This should unbreak the ppc64 buildbots. llvm-svn: 364048
* [MCA][Bottleneck Analysis] Teach how to compute a critical sequence of ↵Andrea Di Biagio2019-06-218-0/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instructions based on the simulation. This patch teaches the bottleneck analysis how to identify and print the most expensive sequence of instructions according to the simulation. Fixes PR37494. The goal is to help users identify the sequence of instruction which is most critical for performance. A dependency graph is internally used by the bottleneck analysis to describe data dependencies and processor resource interferences between instructions. There is one node in the graph for every instruction in the input assembly sequence. The number of nodes in the graph is independent from the number of iterations simulated by the tool. It means that a single node of the graph represents all the possible instances of a same instruction contributed by the simulated iterations. Edges are dynamically "discovered" by the bottleneck analysis by observing instruction state transitions and "backend pressure increase" events generated by the Execute stage. Information from the events is used to identify critical dependencies, and materialize edges in the graph. A dependency edge is uniquely identified by a pair of node identifiers plus an instance of struct DependencyEdge::Dependency (which provides more details about the actual dependency kind). The bottleneck analysis internally ranks dependency edges based on their impact on the runtime (see field DependencyEdge::Dependency::Cost). To this end, each edge of the graph has an associated cost. By default, the cost of an edge is a function of its latency (in cycles). In practice, the cost of an edge is also a function of the number of cycles where the dependency has been seen as 'contributing to backend pressure increases'. The idea is that the higher the cost of an edge, the higher is the impact of the dependency on performance. To put it in another way, the cost of an edge is a measure of criticality for performance. Note how a same edge may be found in multiple iteration of the simulated loop. The logic that adds new edges to the graph checks if an equivalent dependency already exists (duplicate edges are not allowed). If an equivalent dependency edge is found, field DependencyEdge::Frequency of that edge is incremented by one, and the new cost is cumulatively added to the existing edge cost. At the end of simulation, costs are propagated to nodes through the edges of the graph. The goal is to identify a critical sequence from a node of the root-set (composed by node of the graph with no predecessors) to a 'sink node' with no successors. Note that the graph is intentionally kept acyclic to minimize the complexity of the critical sequence computation algorithm (complexity is currently linear in the number of nodes in the graph). The critical path is finally computed as a sequence of dependency edges. For edges describing processor resource interferences, the view also prints a so-called "interference probability" value (by dividing field DependencyEdge::Frequency by the total number of iterations). Examples of critical sequence computations can be found in tests added/modified by this patch. On output streams that support colored output, instructions from the critical sequence are rendered with a different color. Strictly speaking the analysis conducted by the bottleneck analysis view is not a critical path analysis. The cost of an edge doesn't only depend on the dependency latency. More importantly, the cost of a same edge may be computed differently by different iterations. The number of dependencies is discovered dynamically based on the events generated by the simulator. However, their number is not fixed. This is especially true for edges that model processor resource interferences; an interference may not occur in every iteration. For that reason, it makes sense to also print out a "probability of interference". By construction, the accuracy of this analysis (as always) is strongly dependent on the simulation (and therefore the quality of the information available in the scheduling model). That being said, the critical sequence effectively identifies a performance criticality. Instructions from that sequence are expected to have a very big impact on performance. So, users can take advantage of this information to focus their attention on specific interactions between instructions. In my experience, it works quite well in practice, and produces useful output (in a reasonable amount time). Differential Revision: https://reviews.llvm.org/D63543 llvm-svn: 364045
* [binutils] Add response file option to help and docsJames Henderson2019-06-217-6/+44
| | | | | | | | | | | | | | | | | | | | | Many LLVM-based tools already support response files (i.e. files containing a list of options, specified with '@'). This change simply updates the documentation and help text for some of these tools to include it. I haven't attempted to fix all tools, just a selection that I am interested in. I've taken the opportunity to add some tests for --help behaviour, where they were missing. We could expand these tests, but I don't think that's within scope of this patch. This fixes https://bugs.llvm.org/show_bug.cgi?id=42233 and https://bugs.llvm.org/show_bug.cgi?id=42236. Reviewed by: grimar, MaskRay, jkorous Differential Revision: https://reviews.llvm.org/D63597 llvm-svn: 364036
* [llvm-dwarfdump] Remove unnecessary explicit -h behaviourJames Henderson2019-06-211-0/+4
| | | | | | | | | | | | | | | | | --help and -h are automatically supported by the command-line parser, unless overridden by the tool. The behaviour of the PrintHelpMessage being used for -h prior to this patch is subtly different to that provided by --help automatically (it omits certain elements of help text and options, such as --help-list), so overriding the default is not desirable, without good reason. This patch removes the explicit specification of -h and its behaviour, so that the default behaviour is used. Reviewed by: hintonda Differential Revision: https://reviews.llvm.org/D63565 llvm-svn: 364029
* [llvm-nm] Generalize ELF symbol types 'N' and 'n'Fangrui Song2019-06-201-1/+21
| | | | | | | | Reviewed By: grimar, jhenderson Differential Revision: https://reviews.llvm.org/D63588 llvm-svn: 363918
* [llvm-objdump] Switch between ARM/Thumb based on mapping symbols.Eli Friedman2019-06-201-4/+4
| | | | | | | | | | | | | | | The ARMDisassembler changes allow changing between ARM and Thumb mode based on the MCSubtargetInfo, rather than the Target, which simplifies the other changes a bit. I'm not really happy with adding more target-specific logic to tools/llvm-objdump/, but there isn't any easy way around it: the logic in question specifically applies to disassembling an object file, and that code simply isn't located in lib/Target, at least at the moment. Differential Revision: https://reviews.llvm.org/D60927 llvm-svn: 363903
* [llvm-readobj] Match GNU output for DT_RPATH and DT_RUNPATH when dumping ↵Yuanfang Chen2019-06-193-9/+9
| | | | | | | | | | | | | | dynamic symbol table. Reviewers: jhenderson, grimar, MaskRay, rupprecht, espindola Subscribers: emaste, nemanjai, arichardson, kbarton, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63347 llvm-svn: 363868
* [llvm-objdump] Remove unnecessary indentation when dumping ELF data.Yuanfang Chen2019-06-191-4/+3
| | | | | | | | | | | | Reviewers: MaskRay, jhenderson, rupprecht Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63393 llvm-svn: 363858
* [test][llvm-dwarfdump] Remove pointless CHECK-NOT linesJames Henderson2019-06-191-2/+0
| | | | | | | | The original line was there from when this test was added, but it is checking for a switch that doesn't exist, so really has no purpose, at least any more. llvm-svn: 363833
* [NFC][llvm-objcopy] Fix overly restrictive od output checkHubert Tong2019-06-192-6/+6
| | | | | | | | | | | | | | The check against the output of `od` in the affected tests expect a specific input offset format. They also expect a specific offset value, not consistent with the EXAMPLE section for `od` in POSIX.1-2017 Chapter 4, while using the `-j` option. In particular, the example shows that the input offset begins at 0 following the bytes skipped. This patch adjusts the matching of the input offset to be more generic. In order to avoid false matches, it restricts the number of bytes to be formatted. llvm-svn: 363829
* Fix r363773: Update Barcelona MCA tests.Clement Courbet2019-06-191-2/+2
| | | | llvm-svn: 363781
* [yaml2obj/obj2yaml] - Make RawContentSection::Info Optional<>George Rimar2019-06-194-8/+146
| | | | | | | | This allows to customize this field for "implicit" sections properly. Differential revision: https://reviews.llvm.org/D63487 llvm-svn: 363777
* [NFC][X86][MCA] Barcelona: add load/store/load-store-throughput testsRoman Lebedev2019-06-193-0/+1855
| | | | llvm-svn: 363775
* [NFC][X86][MCA] BdVer2: add load-store-throughput testRoman Lebedev2019-06-191-0/+736
| | | | llvm-svn: 363774
* [X86] Add missing properties on llvm.x86.sse.{st,ld}mxcsrClement Courbet2019-06-1922-46/+46
| | | | | | | | | | | | | | | | Summary: llvm.x86.sse.stmxcsr only writes to memory. llvm.x86.sse.ldmxcsr only reads from memory, and might generate an FPE. Reviewers: craig.topper, RKSimon Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62896 llvm-svn: 363773
* Print dylib load kind (weak, reexport, etc) in llvm-objdump -m -dylibs-usedMichael Trent2019-06-181-4/+7
| | | | | | | | | | | | | | | | | | | | | | Summary: Historically llvm-objdump prints the path to a dylib as well as the dylib's compatibility version and current version number. This change extends this information by adding the kind of dylib load: weak, reexport, etc. rdar://51383512 Reviewers: pete, lhames Reviewed By: pete Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62866 llvm-svn: 363746
* [llvm-readobj] Allow --hex-dump/--string-dump to dump multiple sectionsFangrui Song2019-06-188-66/+112
| | | | | | | | | | | | | | | | | | 1) `-x foo` currently dumps one `foo`. This change makes it dump all `foo`. 2) `-x foo -x foo` currently dumps `foo` twice. This change makes it dump `foo` once. In addition, if foo has section index 9, `-x foo -x 9` dumps `foo` once. 3) Give a warning instead of an error if `foo` does not exist. The new behaviors match GNU readelf. Also, print a new line as a separator between two section dumps. GNU readelf uses two lines, but one seems good enough. Reviewed By: grimar, jhenderson Differential Revision: https://reviews.llvm.org/D63475 llvm-svn: 363683
* [llvm-strip] Error when using stdin twiceAlex Brachet2019-06-181-0/+26
| | | | | | | | | | | | | | | | Summary: Implements bug [[ https://bugs.llvm.org/show_bug.cgi?id=42204 | 42204 ]]. llvm-strip now warns when the same input file is used more than once, and errors when stdin is used more than once. Reviewers: jhenderson, rupprecht, espindola, alexshap Reviewed By: jhenderson, rupprecht Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63122 llvm-svn: 363638
* [Remarks] Extend -fsave-optimization-record to specify the formatFrancis Visoiu Mistrih2019-06-171-0/+2
| | | | | | | | | Use -fsave-optimization-record=<format> to specify a different format than the default, which is YAML. For now, only YAML is supported. llvm-svn: 363573
* [llvm-objdump] Use %08 instead of %016 to print leading addresses for 32-bit ↵Fangrui Song2019-06-172-17/+22
| | | | | | | | | | binaries Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D63398 llvm-svn: 363539
* [lit] Delete empty lines at the end of lit.local.cfg NFCFangrui Song2019-06-1710-10/+0
| | | | llvm-svn: 363538
* [llvm-objcopy] Add elf32-sparc and elf32-sparcel targetSeiya Nuta2019-06-171-0/+12
| | | | | | | | | | | | | | | | | | | Summary: The "sparc"/"sparcel" architectures appears in ArchMap (used by -B option) but not in OutputFormatMap (used by -I/-O option). Add their targets into OutputFormatMap for consistency. Note that AFAIK there're no targets for 32-bit little-endian SPARC ("elf32-sparcel") in GNU binutils. Reviewers: espindola, alexshap, rupprecht, jhenderson, compnerd, jakehehrlich Reviewed By: jhenderson, compnerd, jakehehrlich Subscribers: jyknight, emaste, arichardson, fedor.sergeev, jakehehrlich, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63238 llvm-svn: 363524
* [NFC][MCA][X86] Add one more 'clear super register' pattern - movss/movsd ↵Roman Lebedev2019-06-152-0/+230
| | | | | | load clears high XMM bits llvm-svn: 363498
* [NFC][MCA][X86] Add baseline test coverage for AMD Barcelona (aka K10, fam10h)Roman Lebedev2019-06-1548-120/+8928
| | | | | | Looking into sched model for that CPU ... llvm-svn: 363497
* [objcopy] Error when --preserve-dates is specified with standard streamsAlex Brachet2019-06-151-0/+23
| | | | | | | | | | | | | | | | Summary: llvm-objcopy/strip now error when -p is specified when reading from stdin or writing to stdout Reviewers: jhenderson, rupprecht, espindola, alexshap Reviewed By: jhenderson, rupprecht Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63090 llvm-svn: 363485
* [Remarks][NFC] Improve testing and documentation of -foptimization-record-passesFrancis Visoiu Mistrih2019-06-141-0/+2
| | | | | | | | | | | This adds: * documentation to the user manual * nicer error message * test for the error case * test for the gold plugin llvm-svn: 363463
* Revert "Revert r363377: [yaml2obj] - Allow setting custom section types for ↵George Rimar2019-06-147-29/+107
| | | | | | | | | | | | | | | | | | | | implicit sections." LLD test case will be fixed in a following commit. Original commit message: [yaml2obj] - Allow setting custom section types for implicit sections. We were hardcoding the final section type for sections that are usually implicit. The patch fixes that. This also fixes a few issues in existent test cases and removes one precompiled object. Differential revision: https://reviews.llvm.org/D63267 llvm-svn: 363401
* Revert r363377: [yaml2obj] - Allow setting custom section types for implicit ↵Rui Ueyama2019-06-146-105/+27
| | | | | | | | | sections. This reverts commit r363377 because lld's ELF/invalid/undefined-local-symbol-in-dso.test test started failing after this commit. llvm-svn: 363394
* [yaml2obj] - Allow setting custom section types for implicit sections.George Rimar2019-06-146-27/+105
| | | | | | | | | | | | We were hardcoding the final section type for sections that are usually implicit. The patch fixes that. This also fixes a few issues in existent test cases and removes one precompiled object. Differential revision: https://reviews.llvm.org/D63267 llvm-svn: 363377
* [llvm-readobj] Don't abort printing of dynamic table if string reference is ↵James Henderson2019-06-141-9/+44
| | | | | | | | | | | | | | | | | invalid If dynamic table is missing, output "dynamic strtab not found'. If the index is out of range, output "Invalid Offset<..>". https://bugs.llvm.org/show_bug.cgi?id=40807 Reviewed by: jhenderson, grimar, MaskRay Differential Revision: https://reviews.llvm.org/D63084 Patch by Yuanfang Chen. llvm-svn: 363374
* [llvm-readobj] - Do not fail to dump the object which has wrong type of ↵George Rimar2019-06-142-0/+11
| | | | | | | | | | | | | | | | | | | | | | .shstrtab. Imagine we have object that has .shstrtab with type != SHT_STRTAB. In this case, we fail to dump the object, though GNU readelf dumps it without any issues and warnings. This patch fixes that. It adds a code to ELFDumper.cpp which is based on the implementation of getSectionName from the ELF.h: https://github.com/llvm-mirror/llvm/blob/master/include/llvm/Object/ELF.h#L608 https://github.com/llvm-mirror/llvm/blob/master/include/llvm/Object/ELF.h#L431 https://github.com/llvm-mirror/llvm/blob/master/include/llvm/Object/ELF.h#L539 The difference is that all non critical errors are ommitted what allows us to improve the dumping on a tool side. Also, this opens a road for a follow-up that should allow us to dump the section headers, but drop the section names in case if .shstrtab is completely absent and/or broken. Differential revision: https://reviews.llvm.org/D63266 llvm-svn: 363371
OpenPOWER on IntegriCloud