summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [MCA] Fix wrong definition of ResourceUnitMask in DefaultResourceStrategy.Andrea Di Biagio2019-01-101-1/+2
| | | | | | | | | | | | | | Field ResourceUnitMask was incorrectly defined as a 'const unsigned' mask. It should have been a 64 bit quantity instead. That means, ResourceUnitMask was always implicitly truncated to a 32 bit quantity. This issue has been found by inspection. Surprisingly, that bug was latent, and it never negatively affected any existing upstream targets. This patch fixes the wrong definition of ResourceUnitMask, and adds a bunch of extra debug prints to help debugging potential issues related to invalid processor resource masks. llvm-svn: 350820
* [llvm-objdump] - Print symbol addressed when dumping disassembly output (-d)George Rimar2019-01-091-0/+3
| | | | | | | | | | | | | | | | | | | | When GNU objdump dumps the input with -d it prints the symbol addresses, for example: 0000000000000031 <foo>: 31: 00 00 add %al,(%rax) ... llvm-objdump currently does not do that. Patch changes the behavior to match the GNU objdump. That is useful for implementing -z/--disassemble-zeroes (D56083), it allows omitting first zero bytes and keep the information about the symbol address in the output. Differential revision: https://reviews.llvm.org/D56123 llvm-svn: 350726
* [llvm-profdata] add value-cutoff functionality in show commandRong Xu2019-01-081-13/+53
| | | | | | | | | | | | | This patch improves llvm-profdata show command: (1) add -value-cutoff=<N> option: Show only those functions whose max count values are greater or equal to N. (2) add -list-below-cutoff option: Only output names of functions whose max count value are below the cutoff. (3) formats value-profile counts and prints out percentage. Differential Revision: https://reviews.llvm.org/D56342 llvm-svn: 350673
* [PGO] Revert r350579 to fix commit message.Rong Xu2019-01-081-53/+13
| | | | | | Will re-commit it using the correct commit message. llvm-svn: 350670
* Revert "Work around a linker error caused by https://reviews.llvm.org/D56084."Adrian Prantl2019-01-081-2/+0
| | | | | | This reverts commit r350650 llvm-svn: 350653
* Work around a linker error caused by https://reviews.llvm.org/D56084.Adrian Prantl2019-01-081-0/+2
| | | | | | This unbreaks all bots that build with -DLLVM_ENABLE_MODULES=1 llvm-svn: 350650
* [llvm-readobj] Don't print '@' at end of unversioned dynsym namesJames Henderson2019-01-081-2/+4
| | | | | | | | | | | | | This fixes https://bugs.llvm.org/show_bug.cgi?id=40097. The problem was caused by a regression in r188022. See also r350614. Reviewed by: rupprecht, mstorsjo, Higuoxing, jakehehrlich Differential Revision: https://reviews.llvm.org/D56319 llvm-svn: 350615
* [WebAssembly] Massive instruction renamingThomas Lively2019-01-081-1/+1
| | | | | | | | | | | | | | | Summary: An automated renaming of all the instructions listed at https://github.com/WebAssembly/spec/issues/884#issuecomment-426433329 as well as some similarly-named identifiers. Reviewers: aheejin, dschuff, aardappel Subscribers: sbc100, jgravelle-google, eraman, sunfish, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D56338 llvm-svn: 350609
* [dsymutil] Fix assertion triggered by empty address range.Jonas Devlieghere2019-01-081-1/+5
| | | | | | | | | An assertion was hit when running dsymutil on a gcc generated binary that contained an empty address range. Address ranges are stored in an interval map of half open intervals. Since the interval is empty and therefore meaningless, we simply don't add it to the map. llvm-svn: 350591
* [dsymutil] Upstream unobfuscation logic.Jonas Devlieghere2019-01-0714-28/+388
| | | | | | | | | | The unobufscation support for BCSymbolMaps was the last piece of code that hasn't been upstreamed yet. This patch contains a reworked version of the existing code and relevant tests. Differential revision: https://reviews.llvm.org/D56346 llvm-svn: 350580
* [PGO] Use SourceFileName rather module name in PGOFuncNameRong Xu2019-01-071-13/+53
| | | | | | | | | | In LTO or Thin-lto mode (though linker plugin), the module names are of temp file names which are different for different compilations. Using SourceFileName avoids the issue. This should not change any functionality for current PGO as all the current callers of getPGOFuncName() is before LTO. llvm-svn: 350579
* [ObjectYAML] [COFF] Support multiple symbols with the same nameMartin Storsjo2019-01-072-2/+27
| | | | | | Differential Revision: https://reviews.llvm.org/D56294 llvm-svn: 350566
* [elfabi] Add option to manually specify file read formatArmando Montanez2019-01-071-10/+33
| | | | | | Although llvm-elfabi will attempt to read input files without needing the format to be manually specified, doing so has the potential to introduce extraneous errors that can hinder debugging (since multiple readers may fail in attempts to read the file). This change allows the input file format to be manually specified to force elfabi to use a single reader. This makes it easier to test and debug errors specific to a given reader. llvm-svn: 350545
* [llvm-objcopy] Handle -O <format> flag.Jordan Rupprecht2019-01-073-3/+33
| | | | | | | | | | | | | | | | | Summary: The -O flag is currently being mostly ignored; it's only checked whether or not the output format is "binary". This adds support for a few formats (e.g. elf64-x86-64), so that when specified, the output can change between 32/64 bit and sizes/alignments are updated accordingly. This fixes PR39135 Reviewers: jakehehrlich, jhenderson, alexshap, espindola Reviewed By: jhenderson Subscribers: emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D53667 llvm-svn: 350541
* [llvm-demangle-fuzzer] Also fuzz microsoftDemangle().Matt Morehouse2019-01-076-2/+52
| | | | | | | | | | | | | | | | | | Summary: Use first byte of input to determine whether to call itaniumDemangle() or microsoftDemangle(). Addresses https://bugs.llvm.org/show_bug.cgi?id=39582. Reviewers: kcc, thakis Reviewed By: kcc, thakis Subscribers: mgorny, thakis, erik.pilkington, llvm-commits Differential Revision: https://reviews.llvm.org/D54780 llvm-svn: 350534
* [llvm-nm] Add --portability as alias for --format=posixJames Henderson2019-01-071-0/+2
| | | | | | | | | | | | | GNU nm supports this alias, so supporting it in llvm-nm makes it easier to transition between the two. Fixes https://bugs.llvm.org/show_bug.cgi?id=40002 Reviewed by: mstorsjo, rupprecht Differential Revision: https://reviews.llvm.org/D56312 llvm-svn: 350522
* [CodeView] More appropriate name and type for a Microsoft precompiled ↵Alexandre Ganea2019-01-071-2/+2
| | | | | | headers parameter. NFC llvm-svn: 350520
* [llvm-objcopy] Fix buildbots on older compilersJordan Rupprecht2019-01-032-3/+4
| | | | llvm-svn: 350343
* [elfabi] Introduce tool for ELF TextAPIArmando Montanez2019-01-038-0/+400
| | | | | | | | | | | | | | | | | | | | | | | | Follow up for D53051 This patch introduces the tool associated with the ELF implementation of TextAPI (previously llvm-tapi, renamed for better distinction). This tool will house a number of features related to enalysis and manipulation of shared object's exposed interfaces. The first major feature for this tool is support for producing binary stubs that are useful for compile-time linking of shared objects. This patch introduces beginnings of support for reading binary ELF objects to work towards that goal. Added: - elfabi tool. - support for reading architecture from a binary ELF file into an ELFStub. - Support for writing .tbe files. Differential Revision: https://reviews.llvm.org/D55352 llvm-svn: 350341
* Fix typos in commentsJordan Rupprecht2019-01-031-2/+2
| | | | llvm-svn: 350337
* [llvm-objcopy][ELF] Implement a mutable section visitor that updates ↵Jordan Rupprecht2019-01-032-34/+151
| | | | | | | | | | | | | | | | | | | | | size-related fields (Size, EntrySize, Align) before layout. Summary: Fix EntrySize, Size, and Align before doing layout calculation. As a side cleanup, this removes a dependence on sizeof(Elf_Sym) within BinaryReader, so we can untemplatize that. This unblocks a cleaner implementation of handling the -O<format> flag. See D53667 for a previous attempt. Actual implementation of the -O<format> flag will come in an upcoming commit, this is largely a NFC (although not _totally_ one, because alignment on binary input was actually wrong before). Reviewers: jakehehrlich, jhenderson, alexshap, espindola Reviewed By: jhenderson Subscribers: emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D56211 llvm-svn: 350336
* Python compat - no explicit reference to Python versionSerge Guelton2019-01-034-4/+4
| | | | | | | | Update documentation and shebang. Differential Revision: https://reviews.llvm.org/D56252 llvm-svn: 350327
* Python compat - decode/encode stringSerge Guelton2019-01-031-1/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D56258 llvm-svn: 350320
* Python compat - map/filterSerge Guelton2019-01-031-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D56259 llvm-svn: 350313
* Python compat - print statementSerge Guelton2019-01-031-0/+2
| | | | | | | | | Make sure all print statements are compatible with Python 2 and Python3 using the `from __future__ import print_function` statement. Differential Revision: https://reviews.llvm.org/D56249 llvm-svn: 350307
* [llvm-readobj] [COFF] Print the symbol index for relocationsMartin Storsjo2019-01-031-0/+4
| | | | | | | | | | There can be multiple local symbols with the same name (for e.g. comdat sections), and thus the symbol name itself isn't enough to disambiguate symbols. Differential Revision: https://reviews.llvm.org/D56140 llvm-svn: 350288
* [gold] emit assembly listing from gold plugin on LTO stageTeresa Johnson2019-01-021-1/+11
| | | | | | | | | | | | | | | | | | Summary: Sometimes it's useful to emit assembly after LTO stage to modify it manually. Emitting precodegen bitcode file (via save-temps plugin option) and then feeding it to llc doesn't always give the same binary as original. This patch is simpler alternative to https://reviews.llvm.org/D24020. Patch by Denis Bakhvalov. Reviewers: mehdi_amini, tejohnson Reviewed By: tejohnson Subscribers: MaskRay, inglorion, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D56114 llvm-svn: 350276
* Revert rL350035 "[llvm-exegesis] Clustering: don't enqueue a point multiple ↵Clement Courbet2019-01-021-35/+33
| | | | | | | | times" Let's discuss this on the review thread before submitting. llvm-svn: 350207
* [llvm-objcopy] [COFF] Use Error/Expected returns instead of calling ↵Martin Storsjo2018-12-305-56/+63
| | | | | | | | reportError. NFC. Differential Revision: https://reviews.llvm.org/D55922 llvm-svn: 350168
* [llvm-exegesis] Clustering: don't enqueue a point multiple timesFangrui Song2018-12-231-33/+35
| | | | | | | | | | | | | | | Summary: SetVector uses both DenseSet and vector, which is time/memory inefficient. The points are represented as natural numbers so we can replace the DenseSet part by indexing into a vector<char> instead. Don't cargo cult the pseudocode on the wikipedia DBSCAN page. This is a standard BFS style algorithm (the similar loops have been used several times in other LLVM components): every point is processed at most once, thus the queue has at most NumPoints elements. We represent it with a vector and allocate it outside of the loop to avoid allocation in the loop body. We check `Processed[P]` to avoid enqueueing a point more than once, which also nicely saves us a `ClusterIdForPoint_[Q].isUndef()` check. Many people hate the oneshot abstraction but some favor it, therefore we make a compromise, use a lambda to abstract away the neighbor adding process. Delete the comment `assert(Neighbors.capacity() == (Points_.size() - 1));` as it is wrong. llvm-svn: 350035
* cmake: Remove add_llvm_loadable_module()Tom Stellard2018-12-202-2/+2
| | | | | | | | | | | | | | | | | Summary: This function is very similar to add_llvm_library(), so this patch merges it into add_llvm_library() and replaces all calls to add_llvm_loadable_module(lib ...) with add_llvm_library(lib MODULE ...) Reviewers: philip.pfaffe, beanz, chandlerc Reviewed By: philip.pfaffe Subscribers: chapuni, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D51748 llvm-svn: 349839
* [llvm-objcopy] [COFF] Avoid memcpy() with null parameters in more places. NFC.Martin Storsjo2018-12-201-4/+4
| | | | | | | | | This fixes all cases of errors in asan+ubsan builds. Also use std::copy instead of if+memcpy in the previously updated spot, for consistency. llvm-svn: 349826
* [llvm-objcopy] [COFF] Don't call memcpy() with a null argument. NFC.Martin Storsjo2018-12-201-1/+2
| | | | | | | | | It is invalid to call memcpy with a null pointer, even if the size is zero. This should fix the sanitizer buildbot. llvm-svn: 349808
* [llvm-objcopy] Use ELFOSABI_NONE instead of 0. NFC.George Rimar2018-12-201-1/+1
| | | | | | | This was requested during the review of D55886. (sorry, forgot to address this) llvm-svn: 349741
* [llvm-objcopy] - Do not drop the OS/ABI and ABIVersion fields of ELF headerGeorge Rimar2018-12-202-2/+8
| | | | | | | | | | | This is https://bugs.llvm.org/show_bug.cgi?id=40005, Patch teaches llvm-objcopy to preserve OS/ABI and ABIVersion fields of ELF header. (Currently, it drops them to zero). Differential revision: https://reviews.llvm.org/D55886 llvm-svn: 349738
* [yaml2obj/obj2yaml] - Support dumping/parsing ABI version.George Rimar2018-12-202-1/+2
| | | | | | | | | | | These tools were assuming ABI version is 0, that is not always true. Patch teaches them to work with that field. Differential revision: https://reviews.llvm.org/D55884 llvm-svn: 349737
* [binutils] NFC: fix clang-tidy warning: use empty() instead of size() == 0Jordan Rupprecht2018-12-2011-31/+30
| | | | llvm-svn: 349710
* Revert 349677, it contained a whole bunch of stuff I did not mean to commitNico Weber2018-12-193-13/+11
| | | | llvm-svn: 349678
* [gn build] Add build file for clang/lib/Basic and dependenciesNico Weber2018-12-193-11/+13
| | | | | | | | | | | | Adds a build file for clang-tblgen and an action for running it, and uses that to process all the .td files in include/clang/Basic. Also adds an action to write include/clang/Config/config.h and include/clang/Basic/Version.inc. Differential Revision: https://reviews.llvm.org/D55847 llvm-svn: 349677
* [llvm-mca] Rename an error variable.Matt Davis2018-12-191-2/+2
| | | | llvm-svn: 349662
* [llvm-mca] Add an error handler for error from parseCodeRegionsMatt Davis2018-12-191-10/+14
| | | | | | | | | | | | | | | | | | | Summary: It's a bit tricky to add a test for the failing path right now, binary support will have an easier path to exercise the path here. * Ran clang-format. Reviewers: andreadb Reviewed By: andreadb Subscribers: tschuett, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D55803 llvm-svn: 349659
* [llvm-objdump] - Fix one more BB.George Rimar2018-12-191-1/+4
| | | | | | | | | Should fix the http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25876/steps/build/logs/stdio: /home/grosser/buildslave/polly-amd64-linux/llvm.src/tools/llvm-objdump/llvm-objdump.cpp:539:25: error: conditional expression is ambiguous; 'std::string' (aka 'basic_string<char>') can be converted to 'typename std::remove_reference<StringRef>::type' (aka 'llvm::StringRef') and vice versa Target = Demangle ? demangle(*SymName) : *SymName; llvm-svn: 349617
* [llvm-objdump] - Fix BB.George Rimar2018-12-191-16/+15
| | | | | | Move the helper method before the first incocation in the file. llvm-svn: 349614
* [llvm-objdump] - Demangle the symbols when printing symbol table and ↵George Rimar2018-12-191-27/+28
| | | | | | | | | | | | | | | relocations. This is https://bugs.llvm.org/show_bug.cgi?id=40009, llvm-objdump does not demangle the symbols when prints symbol table and/or relocations. Patch teaches it to do that. Differential revision: https://reviews.llvm.org/D55821 llvm-svn: 349613
* [llvm-objcopy] [COFF] Fix the Object forward declarationMartin Storsjo2018-12-192-2/+2
| | | | | | This fixes build warnings with clang, and linker errors with MSVC. llvm-svn: 349606
* [llvm-objcopy] Initial COFF supportMartin Storsjo2018-12-199-0/+762
| | | | | | | | | This is an initial implementation of no-op passthrough copying of COFF with objcopy. Differential Revision: https://reviews.llvm.org/D54939 llvm-svn: 349605
* [bugpoint][PR29027] Reduce function attributesBrian Gesiak2018-12-192-0/+117
| | | | | | | | | | | | | | | | | | | | | Summary: In addition to reducing the functions in an LLVM module, bugpoint now reduces the function attributes associated with each of the remaining functions. To test this, add a -bugpoint-crashfuncattr test pass, which crashes if a function in the module has a "bugpoint-crash" attribute. A test case demonstrates that the IR is reduced to just that one attribute. Reviewers: MatzeB, silvas, davide, reames Reviewed By: reames Subscribers: reames, llvm-commits Differential Revision: https://reviews.llvm.org/D55216 llvm-svn: 349601
* [AArch64] - Return address signing dwarf supportLuke Cheeseman2018-12-182-39/+58
| | | | | | | | | | | | | | - Reapply changes intially introduced in r343089 - The archtecture info is no longer loaded whenever a DWARFContext is created - The runtimes libraries (santiziers) make use of the dwarf context classes but do not intialise the target info - The architecture of the object can be obtained without loading the target info - Adding a method to the dwarf context to get this information and multiplex the string printing later on Differential Revision: https://reviews.llvm.org/D55774 llvm-svn: 349472
* [MCA] Don't assume that createMCInstrAnalysis() always returns a valid pointer.Andrea Di Biagio2018-12-171-1/+1
| | | | | | | | | | Class InstrBuilder wrongly assumed that llvm targets were always able to return a non-null pointer when createMCInstrAnalysis() was called on them. This was causing crashes when simulating executions for targets that don't provide an MCInstrAnalysis object. This patch fixes the issue by making MCInstrAnalysis optional. llvm-svn: 349352
* [llvm-mca] Move llvm-mca library to llvm/lib/MCA.Clement Courbet2018-12-1745-5875/+10
| | | | | | | | | | | | Summary: See PR38731. Reviewers: andreadb Subscribers: mgorny, javed.absar, tschuett, gbedwell, andreadb, RKSimon, llvm-commits Differential Revision: https://reviews.llvm.org/D55557 llvm-svn: 349332
OpenPOWER on IntegriCloud