summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-dwp] Fix `UN:` lines (supposed to be `RUN:`) in X86/simple.test and ↵Fangrui Song2018-09-061-8/+7
| | | | | | | | | | | | adjust check lines for TYPES: Reviewers: dblaikie, aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51704 llvm-svn: 341510
* [llvm-dwp] Use buffer_stream if output file is not seekable (e.g. "-")Fangrui Song2018-09-061-4/+2
| | | | | | | | | | Reviewers: dblaikie, pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51707 llvm-svn: 341509
* [llvm-strip] Support stripping multiple input filesJordan Rupprecht2018-09-051-0/+75
| | | | | | | | | | | | | | | | | Summary: Allow strip to be called on multiple input files, which is interpreted as stripping N files in place. Using multiple input files is incompatible with -o. To allow this, create a `DriverConfig` struct which just wraps a list of `CopyConfigs`. objcopy will only ever have a single `CopyConfig`, but strip will have N (where N >= 1) CopyConfigs. Reviewers: alexshap, jakehehrlich Reviewed By: alexshap, jakehehrlich Subscribers: MaskRay, jakehehrlich, llvm-commits Differential Revision: https://reviews.llvm.org/D51660 llvm-svn: 341464
* [llvm-strip] Allow copying relocation sections without symbol tables.Jordan Rupprecht2018-09-041-0/+45
| | | | | | | | | | | | | | | | | | | | | Summary: Fixes the error "Link field value 0 in section .rela.plt is invalid" when copying/stripping certain binaries. Minimal repro: ``` $ cat /tmp/a.c int main() { return 0; } $ clang -static /tmp/a.c -o /tmp/a $ llvm-strip /tmp/a -o /tmp/b llvm-strip: error: Link field value 0 in section .rela.plt is invalid. ``` Reviewers: jakehehrlich, alexshap Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51493 llvm-svn: 341419
* [MachO] Fix inconsistency between error messages when validating LC_DYSYMTABFrancis Visoiu Mistrih2018-09-041-1/+1
| | | | llvm-svn: 341379
* [MachO] Fix LC_DYSYMTAB validation for external symbolsFrancis Visoiu Mistrih2018-09-041-0/+51
| | | | | | | We were validating the same index (ilocalsym) twice, while iextdefsym was never validated. llvm-svn: 341378
* [dwarfdump] Improve -diff option by hiding more data.Jonas Devlieghere2018-09-041-0/+489
| | | | | | | | | | The -diff option makes it easy to diff dwarf by hiding addresses and offsets. However not all of them were hidden, which should be fixed by this patch. Differential revision: https://reviews.llvm.org/D51593 llvm-svn: 341377
* Revert r341342: Dwarf .debug section compression support (zlib, zlib-gnu).Chandler Carruth2018-09-046-146/+0
| | | | | | | | | | | | Also reverts follow-up commits r341343 and r341344. The primary commit continues to break some build bots even after the fixes in r341343 for UBSan issues: http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/5823 It is also failing for me locally (linux, x86-64). llvm-svn: 341360
* [llvm-objcopy] Dwarf .debug section compression support (zlib, zlib-gnu).Puyan Lotfi2018-09-036-0/+146
| | | | | | | | | | | | | | | | | | | Usage: llvm-objcopy --compress-debug-sections=zlib foo.o llvm-objcopy --compress-debug-sections=zlib-gnu foo.o In both cases the debug section contents is compressed with zlib. In the GNU style case the header is the "ZLIB" magic string followed by the uint64 big- endian decompressed size. In the non-GNU mode the header is the Elf(32|64)_Chdr. Decompression support is coming soon. Differential Revision: https://reviews.llvm.org/D49678 llvm-svn: 341342
* [X86] Remove wrong ReadAdvance from multiclass sse_fp_unop_s.Andrea Di Biagio2018-09-031-87/+89
| | | | | | | | | | | | | | | | | | | | | | A ReadAdvance was incorrectly added to the SchedReadWrite list associated with the following SSE instructions: sqrtss sqrtsd rsqrtss rcpss As a consequence, a wrong operand latency was computed for the register operand used as the base address of the folded load operand. This patch removes the wrong ReadAdvance, and updates the llvm-mca test cases. There is still a problem with correctly modeling partial register writes on XMM registers This other problem is currently tracked here: https://bugs.llvm.org/show_bug.cgi?id=38813 Differential Revision: https://reviews.llvm.org/D51542 llvm-svn: 341326
* [DebugInfo] Have the verifier accept missing linkage names.Jonas Devlieghere2018-09-031-0/+646
| | | | | | | | | | | | | | | | | | According to the standard, for the .debug_names (the "dwarf accelerator tables"): > If a subprogram or inlined subroutine is included, and has a > DW_AT_linkage_name attribute, there will be an additional index entry > for the linkage name. For Swift we generate DW_structure_types with a linkage name and the verifier was incorrectly rejecting this. This patch fixes that by only considering the linkage name in those particular cases. The test is the "reduced" debug info of the failing swift test on swift.org. Differential revision: https://reviews.llvm.org/D51420 llvm-svn: 341311
* [DebugInfo] Common behavior for error typesAlexandre Ganea2018-08-312-2/+2
| | | | | | | | | | | | | | | Following D50807, and heading towards D50664, this intermediary change does the following: 1. Upgrade all custom Error types in llvm/trunk/lib/DebugInfo/ to use the new StringError behavior (D50807). 2. Implement std::is_error_code_enum and make_error_code() for DebugInfo error enumerations. 3. Rename GenericError -> PDBError (the file will be renamed in a subsequent commit) 4. Update custom error messages to follow the same formatting: (\w\s*)+\. 5. Keep generic "file not found" (ENOENT) errors as they are in PDB code. Previously, there used to be a custom enumeration for that purpose. 6. Remove a few extraneous LF in log() implementations. Printing LF is a responsability at a higher level, not at the error level. Differential Revision: https://reviews.llvm.org/D51499 llvm-svn: 341228
* [X86][BtVer2] Remove wrong ReadAdvance from AVX vbroadcast(ss|sd|f128) ↵Andrea Di Biagio2018-08-311-10/+10
| | | | | | | | | | | | | | | | | | | instructions. The presence of a ReadAdvance for input operand #0 is problematic because it changes the input latency of the register used as the base address for the folded load. A broadcast cannot start executing if the load address hasn't been computed yet. In the llvm-mca example, the VBROADCASTSS is dependent on the address generated by the LEAQ. That means, it cannot start until LEAQ reaches the write-back stage. If we apply ReadAdvance, then we wrongly assume that the load can start 3 cycles in advance. Differential Revision: https://reviews.llvm.org/D51534 llvm-svn: 341222
* [X86] Add llvm-mca tests that show how operand latency is wrongly computed ↵Andrea Di Biagio2018-08-311-0/+206
| | | | | | | | | | | for SSE sqrtss/sd and rcpss. According to the timeline view, sqrtss/sd/rcpss start executing before the load address for the memory operand is available. This problem is caused by the presence of a ReadAfterLd (a ReadAdvance). Those unary operations should not specify a ReadAdvance at all. llvm-svn: 341213
* [llvm-objdump] Keep the memory buffer from the dSYM alive when using -g -dsymFrancis Visoiu Mistrih2018-08-311-0/+4
| | | | | | | | | | When using -g and -dsym, llvm-objdump opens the dsym file and keeps the MachOObjectFile alive, while the memory buffer that the MachOObjectFile was based on gets destroyed. Differential Revision: https://reviews.llvm.org/D51365 llvm-svn: 341209
* [X86][BtVer2] Add an llvm-mca test that shows how the read latency of AVX ↵Andrea Di Biagio2018-08-311-0/+73
| | | | | | broadcastss on ymm registers is incorrectly set. llvm-svn: 341197
* [X86][BtVer2] Fix WriteFShuffle256 schedule write info.Andrea Di Biagio2018-08-311-11/+11
| | | | | | | | | | | | | | | This patch fixes the number of micro opcodes, and processor resource cycles for the following AVX instructions: vinsertf128rr/rm vperm2f128rr/rm vbroadcastf128 Tests have been regenerated using the usual scripts in the llvm/utils directory. Differential Revision: https://reviews.llvm.org/D51492 llvm-svn: 341185
* AMDGPU: Remove remnants of old address space mappingMatt Arsenault2018-08-311-4/+4
| | | | llvm-svn: 341165
* dsymutil: Avoid pruning non-type forward declarations inside DW_TAG_moduleAdrian Prantl2018-08-303-0/+59
| | | | | | | | | | | | | | | | forward declarations. Especially with template instantiations, there are legitimate reasons why for declarations might be emitted into a DW_TAG_module skeleton / forward-declaration sub-tree, that are not forward declarations in the sense of that there is a more complete definition over in a .pcm file. The example in the testcase is a constant DW_TAG_member of a DW_TAG_class template instatiation. rdar://problem/43623196 llvm-svn: 341123
* [llvm-mca] Report the number of dispatched micro opcodes in the ↵Andrea Di Biagio2018-08-3010-20/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DispatchStatistics view. This patch introduces the following changes to the DispatchStatistics view: * DispatchStatistics now reports the number of dispatched opcodes instead of the number of dispatched instructions. * The "Dynamic Dispatch Stall Cycles" table now also reports the percentage of stall cycles against the total simulated cycles. This change allows users to easily compare dispatch group sizes with the processor DispatchWidth. Before this change, it was difficult to correlate the two numbers, since DispatchStatistics view reported numbers of instructions (instead of opcodes). DispatchWidth defines the maximum size of a dispatch group in terms of number of micro opcodes. The other change introduced by this patch is related to how DispatchStage generates "instruction dispatch" events. In particular: * There can be multiple dispatch events associated with a same instruction * Each dispatch event now encapsulates the number of dispatched micro opcodes. The number of micro opcodes declared by an instruction may exceed the processor DispatchWidth. Therefore, we cannot assume that instructions are always fully dispatched in a single cycle. DispatchStage knows already how to handle instructions declaring a number of opcodes bigger that DispatchWidth. However, DispatchStage always emitted a single instruction dispatch event (during the first simulated dispatch cycle) for instructions dispatched. With this patch, DispatchStage now correctly notifies multiple dispatch events for instructions that cannot be dispatched in a single cycle. A few views had to be modified. Views can no longer assume that there can only be one dispatch event per instruction. Tests (and docs) have been updated. Differential Revision: https://reviews.llvm.org/D51430 llvm-svn: 341055
* [X86] Improved sched model for X86 CMPXCHG* instructions.Andrew V. Tischenko2018-08-302-18/+20
| | | | | | Differential Revision: https://reviews.llvm.org/D50070 llvm-svn: 341024
* [llvm-strip] Fix -p|--preserve-dates to not truncate output when used in-place.Jordan Rupprecht2018-08-291-0/+8
| | | | | | | | The restoreDateOnFile() method used to preserve dates uses sys::fs::openFileForWrite(). That method defaults to opening files with CD_CreateAlways, which truncates the output file if it exists. Use CD_OpenExisting instead to open it and *not* truncate it, which also has the side benefit of erroring if the file does not exist (it should always exist, because we just wrote it out). Also, fix the test case to make sure the output is a valid output file, and not empty. The extra test assertions are enough to catch this regression. llvm-svn: 340996
* [llvm-mca] Add fields "Total uOps" and "uOps Per Cycle" to the report ↵Andrea Di Biagio2018-08-2976-176/+514
| | | | | | | | | | | | | | | | | | | | | | | | | | | generated by the SummaryView. This patch adds two new fields to the perf report generated by the SummaryView. Fields are now logically organized into two small groups; only the second group contains throughput indicators. Example: ``` Iterations: 100 Instructions: 300 Total Cycles: 414 Total uOps: 700 Dispatch Width: 4 uOps Per Cycle: 1.69 IPC: 0.72 Block RThroughput: 4.0 ``` This patch also updates the docs for llvm-mca. Due to the nature of this change, several tests in the tools/llvm-mca directory were affected, and had to be updated using script `update_mca_test_checks.py`. llvm-svn: 340946
* [llvm-mca] Don't disable the SummaryView if flag `-all-stats` is false.Andrea Di Biagio2018-08-292-6/+78
| | | | llvm-svn: 340945
* [llvm-mca][TimelineView] Force the same number of executions for every entry ↵Andrea Di Biagio2018-08-283-19/+19
| | | | | | | | | | | | | | | | | | | in the 'wait-times' table. This patch also uses colors to highlight problematic wait-time entries. A problematic entry is an entry with an high wait time that tends to match (or exceed) the size of the scheduler's buffer. Color RED is used if an instruction had to wait an average number of cycles which is bigger than (or equal to) the size of the underlying scheduler's buffer. Color YELLOW is used if the time (in cycles) spend waiting for the operands or pipeline resources is bigger than half the size of the underlying scheduler's buffer. Color MAGENTA is used if an instruction does not consume buffer resources according to the scheduling model. llvm-svn: 340825
* [PPC] Remove Darwin support from POWER backend.Kit Barton2018-08-282-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch issues an error message if Darwin ABI is attempted with the PPC backend. It also cleans up existing test cases, either converting the test to use an alternative triple or removing the test if the coverage is no longer needed. Updated Tests ------------- The majority of test cases were updated to use a different triple that does not include the Darwin ABI. Many tests were also updated to use FileCheck, in place of grep. Deleted Tests ------------- llvm/test/tools/dsymutil/PowerPC/sibling.test was originally added to test specific functionality of dsymutil using an object file created with an old version of llvm-gcc for a Powerbook G4. After a discussion with @JDevlieghere he suggested removing the test. llvm/test/CodeGen/PowerPC/combine_loads_from_build_pair.ll was converted from a PPC test to a SystemZ test, as the behavior is also reproducible there. All other tests that were deleted were specific to the darwin/ppc ABI and no longer necessary. Phabricator Review: https://reviews.llvm.org/D50988 llvm-svn: 340795
* [llvm-mca] Improved report generated by the SchedulerStatistics view.Andrea Di Biagio2018-08-276-35/+119
| | | | | | | | | | | | | Before this patch, the SchedulerStatistics only printed the maximum number of buffer entries consumed in each scheduler's queue at a given point of the simulation. This patch restructures the reported table, and adds an extra field named "Average number of used buffer entries" to it. This patch also uses different colors to help identifying bottlenecks caused by high scheduler's buffer pressure. llvm-svn: 340746
* fix comment typoNico Weber2018-08-271-1/+1
| | | | llvm-svn: 340744
* [cfi-verify] Support cross-DSOJoel Galenson2018-08-244-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When used in cross-DSO mode, CFI will generate calls to special functions rather than trap instructions. For example, instead of generating if (!InlinedFastCheck(f)) abort(); call *f CFI generates if (!InlinedFastCheck(f)) __cfi_slowpath(CallSiteTypeId, f); call *f This patch teaches cfi-verify to recognize calls to __cfi_slowpath and abort and treat them as trap functions. In addition to normal symbols, we also parse the dynamic relocations to handle cross-DSO calls in libraries. We also extend cfi-verify to recognize other patterns that occur using cross-DSO. For example, some indirect calls are not guarded by a branch to a trap but instead follow a call to __cfi_slowpath. For example: if (!InlinedFastCheck(f)) call *f else { __cfi_slowpath(CallSiteTypeId, f); call *f } In this case, the second call to f is not marked as protected by the current code. We thus recognize if indirect calls directly follow a call to a function that will trap on CFI violations and treat them as protected. We also ignore indirect calls in the PLT, since on AArch64 each entry contains an indirect call that should not be protected by CFI, and these are labeled incorrectly when debug information is not present. Differential Revision: https://reviews.llvm.org/D49383 llvm-svn: 340612
* [llvm-objdump] Label calls to the PLT.Joel Galenson2018-08-245-0/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D50204 llvm-svn: 340611
* Make llvm-profdata show -text work as advertised in the documentation.Richard Smith2018-08-241-0/+6
| | | | | | | | | | | | | | | | | | | Per LLVM's CommandGuide, llvm-profdata show -text is supposed to produce textual output that can be passed as input to further llvm-profdata invocations. This previously didn't work for two reasons: 1) -text was not sufficient to enable the machine-readable text format output; instead, -text was effectively ignored if -counts was not also specified. (With this patch, -counts is instead ignored if -text is specified, because the machine-readable text format always includes counts.) 2) When the input data was an IR-level profile, the :ir marker was missing from the output, resulting in a text format output that would not be usable as profiling data due to function hash mismatches. Differential Revision: https://reviews.llvm.org/D51188 llvm-svn: 340592
* [gold] -thinlto-object-suffix-replace: don't append new suffix if path does ↵Fangrui Song2018-08-221-0/+11
| | | | | | | | | | | | | | | | not end with old suffix Summary: This is to be consistent with lld behavior since rLLD340364. Reviewers: tejohnson Reviewed By: tejohnson Subscribers: steven_wu, eraman, mehdi_amini, inglorion, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D51060 llvm-svn: 340380
* [llvm-objdump] Add ability to demangle COFF symbols.Zachary Turner2018-08-201-7/+1
| | | | llvm-svn: 340221
* [llvm-objcopy] Implement -G/--keep-global-symbol(s).Jordan Rupprecht2018-08-172-0/+146
| | | | | | | | | | | | | | | | | Summary: Port GNU Objcopy -G/--keep-global-symbol(s). This is slightly different than the already-implemented --globalize-symbol, which marks a symbol as global when copying. When --keep-global-symbol (alias -G) is used, *only* those symbols marked will stay global, and all other globals are demoted to local. (Also note that it doesn't *promote* a symbol to global). Additionally, there is a pluralized version of the flag --keep-global-symbols, which effectively applies --keep-global-symbol for every non-comment in a file. Reviewers: jakehehrlich, jhenderson, alexshap Reviewed By: jhenderson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D50589 llvm-svn: 340105
* Fix windows buildbots by removing : from filenamesJordan Rupprecht2018-08-171-4/+4
| | | | llvm-svn: 340071
* [llvm-objcopy] Add support for -I binary -B <arch>.Jordan Rupprecht2018-08-174-0/+212
| | | | | | | | | | | | | | | | | Summary: The -I (--input-target) and -B (--binary-architecture) flags exist but are currently silently ignored. This adds support for -I binary for architectures i386, x86-64 (and alias i386:x86-64), arm, aarch64, sparc, and ppc (powerpc:common64). This is largely based on D41687. This is done by implementing an additional subclass of Reader, BinaryReader, which works by interpreting the input file as contents for .data field, sets up a synthetic header, and adds additional sections/symbols (e.g. _binary__tmp_data_txt_start). Reviewers: jakehehrlich, alexshap, jhenderson, javed.absar Reviewed By: jhenderson Subscribers: jyknight, nemanjai, kbarton, fedor.sergeev, jrtc27, kristof.beyls, paulsemel, llvm-commits Differential Revision: https://reviews.llvm.org/D50343 llvm-svn: 340070
* Add missing test file from r339799.Peter Collingbourne2018-08-161-0/+31
| | | | llvm-svn: 339927
* [llvm-strip] Add support for -p/--preserve-datesJordan Rupprecht2018-08-161-0/+70
| | | | | | | | | | | | | | Summary: [llvm-strip] Preserve access/modification timestamps when -p is used. Reviewers: jakehehrlich, jhenderson, alexshap Reviewed By: jhenderson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D50744 llvm-svn: 339921
* [yaml2obj] - Allow to use numeric sh_link (Link) value for sections.George Rimar2018-08-161-0/+25
| | | | | | | That change allows using numeric values for Link field. It is consistent with the code for another fields in this method. llvm-svn: 339873
* [yaml2elf] - Use check-next in test.George Rimar2018-08-161-9/+9
| | | | | | Its a follow up for rL339870. llvm-svn: 339872
* [yaml2elf] - Simplify code, add a test. NFC.George Rimar2018-08-161-0/+25
| | | | | | | This simplifies the code allowing to set the sh_info for relocations sections. And adds a missing test. llvm-svn: 339870
* llvm-readobj: Fix addend in relocations for android packed formatPeter Collingbourne2018-08-151-0/+42
| | | | | | | | | | | If a relocation group doesn't have the RELOCATION_GROUP_HAS_ADDEND_FLAG set, then this implies the group's addend equals zero. In this case android packed format won't encode an explicit addend delta, instead we need to set Addend, the "previous addend" variable, to zero by ourself. Patch by Yi-Yo Chiang! Differential Revision: https://reviews.llvm.org/D50601 llvm-svn: 339799
* [yaml2obj] - Teach yaml2obj to produce SHT_GROUP section with a custom Info ↵George Rimar2018-08-151-0/+27
| | | | | | | | | | | | | field. This allows to set custom Info field value for SHT_GROUP sections. It is useful to allow this because we would be able to replace at least one binary object committed in LLD and replace it with the yaml2obj based test. Differential revision: https://reviews.llvm.org/D50776 llvm-svn: 339772
* [llvm-mca] Fix PR38575: Avoid an invalid implicit truncation of a processor ↵Andrea Di Biagio2018-08-151-0/+82
| | | | | | | | | | | | | | | | | resource mask (an uint64_t value) to unsigned. This patch fixes a regression introduced at revision 338702. A processor resource mask was incorrectly implicitly truncated to an unsigned quantity. Later on, the truncated mask was used to initialize an element of a vector of processor resource descriptors. On targets with more than 32 processor resources, some elements of the vector are left uninitialized. As a consequence, this bug might have eventually caused a crash due to null dereference in the Scheduler. This patch fixes PR38575, and adds a test for it. llvm-svn: 339768
* [yaml2obj] - Teach tool to produce SHT_GROUP section with a custom type.George Rimar2018-08-151-0/+34
| | | | | | | | | | | | Currently, it is possible to use yaml2obj for producing SHT_GROUP sections of type GRP_COMDAT. For LLD test case I need to produce an object with a broken (different from GRP_COMDAT) type. The patch teaches tool to do such things. Differential revision: https://reviews.llvm.org/D50761 llvm-svn: 339764
* [gold] Fix Tests cases on i686Tom Stellard2018-08-113-9/+9
| | | | | | | | | | | | Reviewers: tejohnson Reviewed By: tejohnson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D50583 llvm-svn: 339492
* [llvm-objcopy] NFC: Add some color to error()Jordan Rupprecht2018-08-092-2/+2
| | | | llvm-svn: 339404
* [llvm-objcopy] Add --prefix-symbols optionPaul Semel2018-08-091-0/+71
| | | | | | Differential Revision: https://reviews.llvm.org/D50381 llvm-svn: 339362
* [llvm-objcopy] Add --dump-sectionPaul Semel2018-08-091-0/+16
| | | | | | Differential Revision: https://reviews.llvm.org/D49979 llvm-svn: 339358
* [X86] MCA tests for XCHG*, XADD* and CMPXCHG* instructionsAndrew V. Tischenko2018-08-0710-10/+940
| | | | | | Differential Revision: https://reviews.llvm.org/D49912 llvm-svn: 339145
OpenPOWER on IntegriCloud