summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [NativePDB] Fix access to both old & new fpo data entries from dbi streamAleksandr Urakov2019-01-302-0/+14
| | | | | | | | | | | | | | | | | | Summary: This patch fixes access to fpo streams in native pdb from DbiStream and makes code consistent with DbiStreamBuilder. Patch By: leonid.mashinskiy Reviewers: zturner, aleksandr.urakov Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D56725 llvm-svn: 352615
* Add lit config file to skip tests if WebAssembly target is not available.Douglas Yung2019-01-301-0/+2
| | | | llvm-svn: 352614
* [WebAssembly] Ensure BasicSymbolRef.getRawDataRefImpl().p is non-nullSam Clegg2019-01-292-1/+24
| | | | | | | | | | | | Store a non-zero value to ref.d.a and use ref.d.b to store the symbol index. This means that ref.p is never null, which was confusing llvm-nm. Fixes PR40497 Differential Revision: https://reviews.llvm.org/D57373 llvm-svn: 352551
* [X86][Btver2] Improved latency/throughput model for scalar int-to-float ↵Andrea Di Biagio2019-01-294-33/+34
| | | | | | | | | | | | | | conversions. Account for bypass delays when computing the latency of scalar int-to-float conversions. On Jaguar we need to account for an extra 6cy latency (see AMD fam16h SOG). This patch also fixes the number of micropcodes for the register-memory variants of scalar int-to-float conversions. Differential Revision: https://reviews.llvm.org/D57148 llvm-svn: 352518
* [llvm-objcopy] Implement --set-section-flags.Jordan Rupprecht2019-01-293-0/+114
| | | | | | | | | | | | | | | | | Summary: --set-section-flags is used to change the section flags (e.g. SHF_ALLOC) for given sections. The flags allowed are the same from the existing --rename-section=.old=.new[,flags] feature. Additionally, make sure that --set-section-flag cannot be used with --rename-section (either the source or destination), since --rename-section accepts flags. This avoids ambiguity for something like "--rename-section=.foo=.bar,alloc --set-section-flag=.bar,code". Reviewers: jhenderson, jakehehrlich, alexshap, espindola Reviewed By: jhenderson, jakehehrlich Subscribers: llvm-commits, emaste, arichardson Differential Revision: https://reviews.llvm.org/D57198 llvm-svn: 352505
* [llvm-objdump] - Update test after r352366. NFC.George Rimar2019-01-281-2/+2
| | | | | | Change the column name. llvm-svn: 352379
* [obj2yaml] - Dump the sh_entsize section field.George Rimar2019-01-281-0/+21
| | | | | | | | | | | | I faced with the fact that obj2yaml does not dump the sh_entsize field. A problem arose when I tried to dump ELF versioning sections. This is close to what D50235 did, but D50235 did the change for yaml2obj, and now I had to do the same for obj2yaml. Differential revision: https://reviews.llvm.org/D57229 llvm-svn: 352373
* [llvm-objcopy] Fix crash when writing empty binary outputJordan Rupprecht2019-01-281-0/+27
| | | | | | | | | | | | | | Summary: When using llvm-objcopy -O binary and the resulting file will be empty (e.g. removing the only section that would be written, or using --only-keep with a section that doesn't exist/isn't SHF_ALLOC), we crash because FileOutputBuffer expects Size > 0. Add a regression test, and change Buffer to open/truncate the output file in this case. Reviewers: alexshap, jhenderson, jakehehrlich, espindola Reviewed By: alexshap, jhenderson Subscribers: jfb, llvm-commits, emaste, arichardson Differential Revision: https://reviews.llvm.org/D56806 llvm-svn: 352371
* [llvm-objdump] - Print LMAs when dumping section headers.George Rimar2019-01-284-2/+110
| | | | | | | | | | | | When --section-headers is used, GNU objdump prints both LMA and VMA for sections. llvm-objdump does not do that what makes it's output be slightly inconsistent. Patch teaches llvm-objdump to print LMA/VMA for ELF file formats. The behavior for other formats remains unchanged. Differential revision: https://reviews.llvm.org/D57146 llvm-svn: 352366
* [llvm-objdump] - Implement the --adjust-vma option.George Rimar2019-01-281-0/+131
| | | | | | | | | | | | | | | | | GNU objdump's help says: "--adjust-vma: Add OFFSET to all displayed section addresses" In real life what it does is a bit more complicated (and IMO not always reasonable. For example, GNU objdump prints not only VMA, but also LMA for sections. And with --adjust-vma it adjusts LMA, but only when a section has relocations. llvm-objsump does not seem to support printing LMAs yet, but GNU's logic anyways does not make sense for me here). This patch tries to adjust VMA. I tried to implement a reasonable approach. I am not adjusting sections that are not allocatable. As, for example, adjusting debug sections VA's and rel[a] sections VA's should not make sense. This behavior seems to be GNU compatible. Differential revision: https://reviews.llvm.org/D57051 llvm-svn: 352347
* [NFC][MCA][X86][BdVer2] Cherry-pick int-to-ivec forwarding tests from BtVer2Roman Lebedev2019-01-273-0/+705
| | | | llvm-svn: 352317
* [llvm-mca][X86] Add some missing DQI testsSimon Pilgrim2019-01-268-4/+3954
| | | | | | Match more of the coverage of test\CodeGen\X86\avx512-schedule.ll as discussed on D57244 llvm-svn: 352273
* [llvm-nm] Print out N_COLD_FUNC as "cold func"Vedant Kumar2019-01-261-1/+1
| | | | | | | Per post-commit feedback from Mike, have llvm-nm print out this symbol attribute as "[cold func]". llvm-svn: 352258
* [MC] Teach the MachO object writer about N_FUNC_COLDVedant Kumar2019-01-252-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | N_FUNC_COLD is a new MachO symbol attribute. It's a hint to the linker to order a symbol towards the end of its section, to improve locality. Example: ``` void a1() {} __attribute__((cold)) void a2() {} void a3() {} int main() { a1(); a2(); a3(); return 0; } ``` A linker that supports N_FUNC_COLD will order _a2 to the end of the text section. From `nm -njU` output, we see: ``` _a1 _a3 _main _a2 ``` Differential Revision: https://reviews.llvm.org/D57190 llvm-svn: 352227
* [opt-viewer] Add javascript to expand/hide full message for multiline remarks.Florian Hahn2019-01-256-28/+128
| | | | | | | | | | | | | | | | | | | | | | | This patch adds support for displaying remarks with multiple lines. For such remarks, it creates a hidden div containing the message's lines except the first one in a <pre> tag. It also prepends a link (with '+' as text) to the regular remark line. This link can be used to show/hide the div containing the full remark. In combination with D57159, this allows for better displaying of multiline remarks in the html pages generated by opt-viewer. The Javascript is very simple and should be supported by any recent major browser. Reviewers: hfinkel, anemet, thegameg, serge-sans-paille Reviewed By: anemet Differential Revision: https://reviews.llvm.org/D57167 llvm-svn: 352223
* [llvm-symbolizer] Add switch to adjust addresses by fixed offsetJames Henderson2019-01-251-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | If a stack trace or similar has a list of addresses from an executable or DSO loaded at a variable address (e.g. due to ASLR), the addresses will not directly correspond to the addresses stored in the object file. If a user wishes to use llvm-symbolizer, they have to subtract the load address from every address. This is somewhat inconvenient, especially as the output of --print-address will result in the adjusted address being listed, rather than the address coming from the stack trace, making it harder to map results between the two. This change adds a new switch to llvm-symbolizer --adjust-vma which takes an offset, which is then used to automatically do this calculation. The printed address remains the input address (allowing for easy mapping), whilst the specified offset is applied to the addresses when performing the lookup. The switch is conceptually similar to llvm-objdump's new switch of the same name (see D57051), which in turn mirrors a GNU switch. There is no equivalent switch in addr2line. Reviewed by: grimar Differential Revision: https://reviews.llvm.org/D57151 llvm-svn: 352195
* [llvm-objcopy] Add support for -g as an alias for --strip-debugDouglas Yung2019-01-251-0/+4
| | | | | | | | | | | | This change adds an option -g to llvm-objcopy which is an alias for the existing option --strip-debug. This fixes PR40003. Reviewed by: alexshap Differential Revision: https://reviews.llvm.org/D57217 llvm-svn: 352182
* [llvm-mca][X86] Add missing shuffle testsSimon Pilgrim2019-01-258-8/+3924
| | | | | | Match the coverage of test\CodeGen\X86\avx512-shuffle-schedule.ll so we can get rid of -print-schedule (and fix PR37160) without losing schedule tests llvm-svn: 352179
* [elfabi] Add support for reading dynamic symbols from binariesArmando Montanez2019-01-2413-18/+71
| | | | | | | | | | | | | | | | | This patch adds initial support for reading dynamic symbols from ELF binaries. Currently, STT_NOTYPE, STT_OBJECT, STT_FUNC, and STT_TLS are explicitly supported. Other symbol types are mapped to ELFSymbolType::Unknown to improve signal/noise ratio. Symbols must meet two criteria to be read into in an ELFStub: - The symbol's binding must be STB_GLOBAL or STB_WEAK. - The symbol's visibility must be STV_DEFAULT or STV_PROTECTED. This filters out symbols that aren't of interest during compile-time linking against a shared object. This change uses DT_HASH and DT_GNU_HASH to determine the size of .dynsym. Using hash tables to determine the number of symbols in .dynsym allows llvm-elfabi to work on binaries without relying on section headers. Differential Revision: https://reviews.llvm.org/D56031 llvm-svn: 352121
* llvm-symbolizer: Extract individual test cases now that it's easier to use ↵David Blaikie2019-01-2424-1/+173
| | | | | | | | | | directly (without a piped input file) Pulling out the split-dwarf tests by way of example of how I think llvm-symbolizer should be tested going forward. Open to debate/discussion, though. llvm-svn: 352004
* [llvm-symbolizer] Add support for -i and -inlines as aliases for -inliningDouglas Yung2019-01-244-1/+17
| | | | | | | | | | | | | | This change adds two options, -i and -inlines as aliases for the -inlining option to llvm-symbolizer to improve compatibility with the GNU addr2line utility which accepts these options. It also modifies existing tests that use -inlining to exercise these new aliases as well. This fixes PR40073. Reviewed by: jhenderson, Quolyk, ruiu Differential Revision: https://reviews.llvm.org/D57083 llvm-svn: 351999
* [llvm-symbolizer] Improve compatibility of --functions with GNU addr2lineJames Henderson2019-01-232-1/+110
| | | | | | | | | | | | | | | | | | | | | | | | | This fixes https://bugs.llvm.org/show_bug.cgi?id=40072. GNU addr2line's --functions switch is off by default, has a short alias of -f, and does not take an argument. This patch changes llvm-symbolizer to allow the second and third point (changing the default behaviour may have negative impacts on users). If the option is missing a value, it now treats it as "linkage". This change does cause one previously valid command-line to behave differently. Before --functions <value> was accepted, but now only --functions=<value> is allowed (as well as --functions). The old behaviour will result in the value being treated as a positional argument. The previous testing for --functions=short has been pulled out into a new test that also tests the other accepted values and option formats. Reviewed by: ruiu Differential Revision: https://reviews.llvm.org/D57049 llvm-svn: 351968
* [MC][X86] Correctly model additional operand latency caused by transfer ↵Andrea Di Biagio2019-01-232-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | delays from the integer to the floating point unit. This patch adds a new ReadAdvance definition named ReadInt2Fpu. ReadInt2Fpu allows x86 scheduling models to accurately describe delays caused by data transfers from the integer unit to the floating point unit. ReadInt2Fpu currently defaults to a delay of zero cycles (i.e. no delay) for all x86 models excluding BtVer2. That means, this patch is only a functional change for the Jaguar cpu model only. Tablegen definitions for instructions (V)PINSR* have been updated to account for the new ReadInt2Fpu. That read is mapped to the the GPR input operand. On Jaguar, int-to-fpu transfers are modeled as a +6cy delay. Before this patch, that extra delay was added to the opcode latency. In practice, the insert opcode only executes for 1cy. Most of the actual latency is actually contributed by the so-called operand-latency. According to the AMD SOG for family 16h, (V)PINSR* latency is defined by expression f+1, where f is defined as a forwarding delay from the integer unit to the fpu. When printing instruction latency from MCA (see InstructionInfoView.cpp) and LLC (only when flag -print-schedule is speified), we now need to account for any extra forwarding delays. We do this by checking if scheduling classes declare any negative ReadAdvance entries. Quoting a code comment in TargetSchedule.td: "A negative advance effectively increases latency, which may be used for cross-domain stalls". When computing the instruction latency for the purpose of our scheduling tests, we now add any extra delay to the formula. This avoids regressing existing codegen and mca schedule tests. It comes with the cost of an extra (but very simple) hook in MCSchedModel. Differential Revision: https://reviews.llvm.org/D57056 llvm-svn: 351965
* [llvm-readelf] Don't suppress static symbol table with --dyn-symbols + --symbolsJames Henderson2019-01-232-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | In r287786, a bug was introduced into llvm-readelf where it didn't print the static symbol table if both --symbols and --dyn-symbols were specified, even if there was no dynamic symbol table. This is obviously incorrect. This patch fixes this issue, by delegating the decision of which symbol tables should be printed to the final dumper, rather than trying to decide in the command-line option handling layer. The decision was made to follow the approach taken in this patch because the LLVM style dumper uses a different order to the original GNU style behaviour (and GNU readelf) for ELF output. Other approaches resulted in behaviour changes for other dumpers which felt wrong. In particular, I wanted to avoid changing the order of the output for --symbols --dyn-symbols for LLVM style, keep what is emitted by --symbols unchanged for all dumpers, and avoid having different orders of .dynsym and .symtab dumping for GNU "--symbols" and "--symbols --dyn-symbols". Reviewed by: grimar, rupprecht Differential Revision: https://reviews.llvm.org/D57016 llvm-svn: 351960
* [llvm-objcopy] [COFF] Fix handling of aux symbols for big objectsMartin Storsjo2019-01-237-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | The aux symbols were stored in an opaque std::vector<uint8_t>, with contents interpreted according to the rest of the symbol. All aux symbol types but one fit in 18 bytes (sizeof(coff_symbol16)), and if written to a bigobj, two extra padding bytes are written (as sizeof(coff_symbol32) is 20). In the storage agnostic intermediate representation, store the aux symbols as a series of coff_symbol16 sized opaque blobs. (In practice, all such aux symbols only consist of one aux symbol, so this is more flexible than what reality needs.) The special case is the file aux symbols, which are written in potentially more than one aux symbol slot, without any padding, as one single long string. This can't be stored in the same opaque vector of fixed sized aux symbol entries. The file aux symbols will occupy a different number of aux symbol slots depending on the type of output object file. As nothing in the intermediate process needs to have accurate raw symbol indices, updating that is moved into the writer class. Differential Revision: https://reviews.llvm.org/D57009 llvm-svn: 351947
* [llvm-objcopy] [COFF] Remove testcase debugging lines. NFC.Martin Storsjo2019-01-231-6/+0
| | | | | | | These are no longer necessary as the testcase now seems to run fine on the buildbots that previously failed on this case, after SVN r351934. llvm-svn: 351946
* [llvm-symbolizer] Allow single letter command flags grouping.Dmitry Venikov2019-01-231-0/+7
| | | | | | | | | | | | | | Summary: Currently llvm-symbolizer doesn't allow flags combining. This patch allows such grouping behavior just like addr2line. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40304 Reviewers: jhenderson, ruiu Reviewed By: jhenderson Subscribers: rupprecht, llvm-commits Differential Revision: https://reviews.llvm.org/D57046 llvm-svn: 351936
* Reapply: [llvm-objcopy] [COFF] Implement --add-gnu-debuglinkMartin Storsjo2019-01-231-0/+48
| | | | | | | | | | | This was reverted since it broke a couple buildbots. The reason for the breakage is not yet known, but this time, the test has got more diagnostics added, to hopefully allow figuring out what goes wrong. Differential Revision: https://reviews.llvm.org/D57007 llvm-svn: 351931
* [llvm-objcopy] Remove os-dependent message from testJordan Rupprecht2019-01-231-1/+2
| | | | llvm-svn: 351914
* [llvm-objcopy] Fix error message for msvc testsJordan Rupprecht2019-01-231-1/+1
| | | | llvm-svn: 351905
* [llvm-objcopy] Return Error from Buffer::allocate(), ↵Jordan Rupprecht2019-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | [ELF]Writer::finalize(), and [ELF]Writer::commit() Summary: This patch changes a few methods to return Error instead of manually calling error/reportError to abort. This will make it easier to extract into a library. Note that error() takes just a string (this patch also adds an overload that takes an Error), while reportError() takes string + [error/code]. To help unify things, use FileError to associate a given filename with an error. Note that this takes some special care (for now), e.g. calling reportError(FileName, <something that could be FileError>) will duplicate the filename. The goal is to eventually remove reportError() and have every error associated with a file to be a FileError, and just one error handling block at the tool level. This change was suggested in D56806. I took it a little further than suggested, but completely fixing llvm-objcopy will take a couple more patches. If this approach looks good, I'll commit this and apply similar patche(s) for the rest. This change is NFC in terms of non-error related code, although the error message changes in one context. Reviewers: alexshap, jhenderson, jakehehrlich, mstorsjo, espindola Reviewed By: alexshap, jhenderson Subscribers: llvm-commits, emaste, arichardson Differential Revision: https://reviews.llvm.org/D56930 llvm-svn: 351896
* [llvm-mca][X86] Tidyup avx512 placeholder testsSimon Pilgrim2019-01-228-156/+1348
| | | | | | Ensure we keep avx512f/bw/dq + vl versions separate, add example broadcast tests - this should allow us to better the test coverage of test\CodeGen\X86\avx512-schedule.ll llvm-svn: 351848
* [llvm-mca][X86] Add VPOPCNTDQ testsSimon Pilgrim2019-01-222-0/+238
| | | | | | Matches test coverage of test\CodeGen\X86\avx512vpopcntdq-schedule.ll llvm-svn: 351842
* [llvm-mca][X86] Add missing CLWB/CLZERO/FSGSBASE/LWP/MWAITX/RDPID/SHA testsSimon Pilgrim2019-01-2217-0/+918
| | | | | | We're getting pretty close to matching/exceeding test coverage of the test\CodeGen\X86\*-schedule.ll files, which should allow us to get rid of -print-schedule and fix PR37160 llvm-svn: 351836
* [llvm-mca][X86] Add missing enter/leave, invlpg/invlpga, rdmsr/wrmsr, rdpmc ↵Simon Pilgrim2019-01-2211-13/+363
| | | | | | and rdtsc/rdtscp tests llvm-svn: 351835
* [llvm-mca][X86] Add missing mfence/pinsrw testsSimon Pilgrim2019-01-2211-11/+132
| | | | llvm-svn: 351831
* [llvm-mca][X86] Add missing monitor/mwait testsSimon Pilgrim2019-01-2211-10/+98
| | | | | | These technically should be under a MONITOR cpuid bit, but we tag them as SSE3 so I've done that here as well. llvm-svn: 351829
* [llvm-mca][X86] Add missing vperm2i128 testsSimon Pilgrim2019-01-226-6/+48
| | | | llvm-svn: 351828
* [llvm-mca][X86] Add missing tzcntw testsSimon Pilgrim2019-01-228-8/+64
| | | | llvm-svn: 351827
* [MCA] Add tests for int-to-fpu transfer delays. NFCAndrea Di Biagio2019-01-223-0/+612
| | | | llvm-svn: 351822
* [X86][BtVer2] SSE2 vector shifts has local forwarding disabledSimon Pilgrim2019-01-222-48/+48
| | | | | | | | Similar to horizontal ops on D56777, the sse2 (but not mmx) bit shift ops has local forwarding disabled, adding +1cy to the use latency for the result. Differential Revision: https://reviews.llvm.org/D57026 llvm-svn: 351817
* [X86][BtVer2] X86ISD::VPERMILPV has local forwarding disabledSimon Pilgrim2019-01-221-8/+8
| | | | | | | | Similar to horizontal ops on D56777, the vpermilpd/vpermilps variable mask ops has local forwarding disabled, adding +1cy to the use latency for the result. Differential Revision: https://reviews.llvm.org/D57022 llvm-svn: 351815
* Revert "[llvm-objcopy] [COFF] Implement --add-gnu-debuglink"Martin Storsjo2019-01-221-42/+0
| | | | | | | This reverts commit r351801, as it caused errors on (so far) ppc64be and aarch64 buildbots - the reason is yet unknown. llvm-svn: 351811
* [llvm-objcopy] [COFF] Implement --add-gnu-debuglinkMartin Storsjo2019-01-221-0/+42
| | | | | | Differential Revision: https://reviews.llvm.org/D57007 llvm-svn: 351801
* [llvm-objcopy] [COFF] Update symbol indices in weak externalsMartin Storsjo2019-01-221-0/+49
| | | | | | Differential Revision: https://reviews.llvm.org/D57006 llvm-svn: 351800
* [llvm-objcopy] Consistently use createStringError instead of ↵Martin Storsjo2019-01-221-1/+1
| | | | | | | | | | | | make_error<StringError> This was requested in the review of D57006. Also add missing quotes around symbol names in error messages. Differential Revision: https://reviews.llvm.org/D57014 llvm-svn: 351799
* [NFC][llvm-readobj]Normalise --/- inconsistency in test optionsJames Henderson2019-01-221-8/+8
| | | | llvm-svn: 351798
* [llvm-symbolizer] Add support for --basenames/-sJames Henderson2019-01-221-0/+12
| | | | | | | | | | | | | This fixes https://bugs.llvm.org/show_bug.cgi?id=40068. --basenames is a GNU addr2line switch which strips the directory names from the file path in the output. Reviewed by: ruiu Differential Revision: https://reviews.llvm.org/D56919 llvm-svn: 351795
* [llvm-readelf]Revert --dyn-symbols behaviour to make it GNU compatible, and ↵James Henderson2019-01-222-42/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add new --hash-symbols switch for old behaviour In r287786, the behaviour of --dyn-symbols in llvm-readelf (but not llvm-readobj) was changed to print the dynamic symbols as derived from the hash table, rather than to print the dynamic symbol table contents directly. The original change was initially submitted without review, and some comments were made on the commit mailing list implying that the new behavious is GNU compatible. I argue that it is not: 1) It does not include a null symbol. 2) It prints the symbols based on an order derived from the hash table. 3) It prints an extra column indicating which bucket it came from. This could break parsers that expect a fixed number of columns, with the first column being the symbol index. 4) If the input happens to have both .hash and .gnu.hash section, it prints interpretations of them both, resulting in most symbols being printed twice. 5) There is no way of just printing the raw dynamic symbol table, because --symbols also prints the static symbol table. This patch reverts the --dyn-symbols behaviour back to its old behaviour of just printing the contents of the dynamic symbol table, similar to what is printed by --symbols. As the hashed interpretation is still desirable to validate the hash table, it puts it under a new switch "--hash-symbols". This is a no-op on all output forms except for GNU output style for ELF. If there is no hash table, it does nothing, unlike the previous behaviour which printed the raw dynamic symbol table, since the raw dynsym is available under --dyn-symbols. The yaml input for the test is based on that in test/tools/llvm-readobj/demangle.test, but stripped down to the bare minimum to provide a valid dynamic symbol. Note: some LLD tests needed updating. I will commit a separate patch for those. Reviewed by: grimar, rupprecht Differential Revision: https://reviews.llvm.org/D56910 llvm-svn: 351789
* [X86][BtVer2] Update latency of mmx horizontal operationsSimon Pilgrim2019-01-211-12/+12
| | | | | | | | D56777 added +1cy local forwarding penalty for horizontal operations, but this penalty only affects sse2/xmm variants, the mmx variants don't suffer the penalty. Confirmed with @andreadb llvm-svn: 351755
OpenPOWER on IntegriCloud