summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [MCA] Add flag -show-encoding to llvm-mca.Andrea Di Biagio2019-08-093-13/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flag -show-encoding enables the printing of instruction encodings as part of the the instruction info view. Example (with flags -mtriple=x86_64-- -mcpu=btver2): Instruction Info: [1]: #uOps [2]: Latency [3]: RThroughput [4]: MayLoad [5]: MayStore [6]: HasSideEffects (U) [7]: Encoding Size [1] [2] [3] [4] [5] [6] [7] Encodings: Instructions: 1 2 1.00 4 c5 f0 59 d0 vmulps %xmm0, %xmm1, %xmm2 1 4 1.00 4 c5 eb 7c da vhaddps %xmm2, %xmm2, %xmm3 1 4 1.00 4 c5 e3 7c e3 vhaddps %xmm3, %xmm3, %xmm4 In this example, column Encoding Size is the size in bytes of the instruction encoding. Column Encodings reports the actual instruction encodings as byte sequences in hex (objdump style). The computation of encodings is done by a utility class named mca::CodeEmitter. In future, I plan to expose the CodeEmitter to the instruction builder, so that information about instruction encoding sizes can be used by the simulator. That would be a first step towards simulating the throughput from the decoders in the hardware frontend. Differential Revision: https://reviews.llvm.org/D65948 llvm-svn: 368432
* [llvm-readobj] - Remove `error(llvm::Expected<T> &&E)`George Rimar2019-08-093-8/+7
| | | | | | | | | | This is a bit strange method. It works like a unwrapOrError, but named error. It does not report an Input name. I removed it. Differential revision: https://reviews.llvm.org/D66000 llvm-svn: 368430
* [llvm-readobj] - Remove deprecated unwrapOrError(Expected<T> EO).George Rimar2019-08-096-190/+269
| | | | | | | | | This patch changes the code to use a modern unwrapOrError(StringRef Input, Expected<T> EO) version that contains the input source name and removes the deprecated version. Differential revision: https://reviews.llvm.org/D65946 llvm-svn: 368428
* [llvm-readobj] - Remove unwrapOrError(ErrorOr<T> EO) helper.George Rimar2019-08-092-11/+11
| | | | | | | | | | | It is outdated. Using of Expected<> is preferred, also it does not provide a way to report a file name. I updated the code to use the modern version of unwrapOrError instead. Differential revision: https://reviews.llvm.org/D65951 llvm-svn: 368410
* Fix -DBUILD_SHARED_LIBS=ON build after rL368358Sam Clegg2019-08-081-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D65982 llvm-svn: 368363
* Added Delta IR Reduction ToolDiego Trevino Ferrer2019-08-0811-0/+656
| | | | | | | | | | | | | | | | Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file. Reviewers: alexshap, chandlerc Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63672 > llvm-svn: 368071 llvm-svn: 368358
* [llvm-mc] Add reportWarning() to MCContextBrian Cain2019-08-081-3/+3
| | | | | | | Adding reportWarning() to MCContext, so that it can be used from the Hexagon assembler backend. llvm-svn: 368327
* [MCA] Remove dependency from InstrBuilder in mca::Context. NFCAndrea Di Biagio2019-08-081-23/+27
| | | | | | InstrBuilder is not required to construct the default pipeline. llvm-svn: 368275
* [yaml2obj/obj2yaml] - Add a basic support for extended section indexes.George Rimar2019-08-081-13/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | In some cases a symbol might have section index == SHN_XINDEX. This is an escape value indicating that the actual section header index is too large to fit in the containing field. Then the SHT_SYMTAB_SHNDX section is used. It contains the 32bit values that stores section indexes. ELF gABI says that there can be multiple SHT_SYMTAB_SHNDX sections, i.e. for example one for .symtab and one for .dynsym (1) https://groups.google.com/forum/#!topic/generic-abi/-XJAV5d8PRg (2) DT_SYMTAB_SHNDX: http://www.sco.com/developers/gabi/latest/ch5.dynamic.html In this patch I am only supporting a single SHT_SYMTAB_SHNDX associated with a .symtab. This is a more or less common case which is used a few tests I saw in LLVM. I decided not to create the SHT_SYMTAB_SHNDX section as "implicit", but implement is like a kind of regular section for now. i.e. tools do not recreate this section or its content, like they do for symbol table sections, for example. That should allow to write all kind of possible broken test cases for our needs and keep the output closer to requested. Differential revision: https://reviews.llvm.org/D65446 llvm-svn: 368272
* [llvm-readobj/libObject] - Introduce a custom warning handler for ↵George Rimar2019-08-083-23/+36
| | | | | | | | | | | | | | | | | | | | `ELFFile<ELFT>` methods. Currently, we have a code duplication in llvm-readobj which was introduced in D63266. The duplication was introduced to allow llvm-readobj to dump the partially broken object. Methods in ELFFile<ELFT> perform a strict validation of the inputs, what is itself good, but not for dumper tools, that might want to dump the information, even if some pieces are broken/unexpected. This patch introduces a warning handler which can be passed to ELFFile<ELFT> methods and can allow skipping the non-critical errors when needed/possible. For demonstration, I removed the duplication from llvm-readobj and implemented a warning using the new custom warning handler. It also deduplicates the strings printed, making the output less verbose. Differential revision: https://reviews.llvm.org/D65515 llvm-svn: 368260
* [llvm-strip] Support --strip-sectionsWolfgang Pieb2019-08-082-0/+4
| | | | | | | | | | | llvm-objcopy already supports --strip-sections. It is a good fit for its alias llvm-strip to support it as well. Reviewers: rupprecht, jhenderson Differential Revision: https://reviews.llvm.org/D65787 llvm-svn: 368241
* Revert Added Delta IR Reduction ToolDiego Trevino Ferrer2019-08-0711-687/+0
| | | | | | This reverts r368071 (git commit a2584978f5bb41973d65a145b0d9459b81e3ac6d) llvm-svn: 368217
* Added Delta IR Reduction ToolDiego Trevino Ferrer2019-08-0711-0/+687
| | | | | | | | | | | | | | | | Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file. Reviewers: alexshap, chandlerc Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63672 > llvm-svn: 368071 llvm-svn: 368214
* DebugInfo/DWARF: Normalize DWARFObject members on the DWARF spec section namesDavid Blaikie2019-08-072-9/+9
| | | | | | | | | Some of these names were abbreviated, some were not, some pluralised, some not. Made the API difficult to use - since it's an exact 1:1 mapping to the DWARF sections - use those names (changing underscore separation for camel casing). llvm-svn: 368189
* Remove support for 32-bit offsets in utility classes (5/5)Igor Kudrin2019-08-071-12/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D65641 llvm-svn: 368156
* [llvm-readelf] --notes: move 'Data size' column left by 1Fangrui Song2019-08-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | readelf -n: ``` // "Data size" is not left justified Owner Data size Description GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag) ``` llvm-readelf -n (before): ``` // "Data size" column shifted by 1 Owner Data size Description GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag) ``` llvm-readelf -n (after): ``` Owner Data size Description GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag) ``` This change is made to reduce the diff with readelf -n, so that it is slightly easier to check what features readelf implements but we don't. Reviewed By: grimar, jhenderson Differential Revision: https://reviews.llvm.org/D65847 llvm-svn: 368138
* Reverts commit r368117, r368115 and r368112Petr Hosek2019-08-0713-746/+0
| | | | | | | | | | | | This reverts commits: "Added Delta IR Reduction Tool" "[Bugpoint redesign] Added Pass to Remove Global Variables" "Added Tool as Dependency to tests & fixed warnings" Reduce/remove-funcs.ll is failing on bots. llvm-svn: 368122
* [yaml2obj] Move core yaml2obj code into lib and include for use in unit testsAlex Brachet2019-08-078-3067/+8
| | | | | | | | | | | | | | Reviewers: jhenderson, rupprecht, MaskRay, grimar, labath Reviewed By: rupprecht Subscribers: gribozavr, mgrang, seiya, mgorny, sbc100, hiraditya, aheejin, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65255 llvm-svn: 368119
* Added Tool as Dependency to tests & fixed warningsDiego Trevino Ferrer2019-08-074-7/+7
| | | | | | | | | | | | Summary: Fixes http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/14002 and http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/35392/steps/build_Lld/logs/stdio Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65843 llvm-svn: 368117
* [Bugpoint redesign] Added Pass to Remove Global VariablesDiego Trevino Ferrer2019-08-0711-206/+338
| | | | | | | | | | | | | | | Summary: This pass tries to remove Global Variables, as well as their derived uses. For example if a variable `@x` is used by `%call1` and `%call2`, both these uses and the definition of `@x` are deleted. Moreover if `%call1` or `%call2` are used elsewhere those uses are also deleted, and so on recursively. I'm still uncertain if this pass should remove derived uses, I'm open to suggestions. Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64176 llvm-svn: 368115
* Added Delta IR Reduction ToolDiego Trevino Ferrer2019-08-0710-0/+614
| | | | | | | | | | | | | | | | Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file. Reviewers: alexshap, chandlerc Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63672 > llvm-svn: 368071 llvm-svn: 368112
* Revert "Added Delta IR Reduction Tool"Dmitri Gribenko2019-08-0610-613/+0
| | | | | | This reverts commit r368071, it broke buildbots. llvm-svn: 368073
* Added Delta IR Reduction ToolDiego Trevino Ferrer2019-08-0610-0/+613
| | | | | | | | | | | | | | Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file. Reviewers: alexshap, chandlerc Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63672 llvm-svn: 368071
* Revert "[yaml2obj] Move core yaml2obj code into lib and include for use in ↵Dmitri Gribenko2019-08-068-8/+3067
| | | | | | | | unit tests" This reverts commit r368021, it broke tests. llvm-svn: 368035
* [yaml2obj] Move core yaml2obj code into lib and include for use in unit testsAlex Brachet2019-08-068-3067/+8
| | | | | | | | | | | | | | Reviewers: jhenderson, rupprecht, MaskRay, grimar, labath Reviewed By: rupprecht Subscribers: seiya, mgorny, sbc100, hiraditya, aheejin, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65255 llvm-svn: 368021
* Switch LLVM to use 64-bit offsets (2/5)Igor Kudrin2019-08-068-56/+56
| | | | | | | | | This updates all libraries and tools in LLVM Core to use 64-bit offsets which directly or indirectly come to DataExtractor. Differential Revision: https://reviews.llvm.org/D65638 llvm-svn: 368014
* [llvm-readelf] Support dumping of stack sizes sections with readelf ↵Wolfgang Pieb2019-08-053-0/+339
| | | | | | | | | | --stack-sizes Reviewers: jhenderson, grimar, rupprecht Differential Revision: https://reviews.llvm.org/D65313 llvm-svn: 367942
* llvm-symbolizer: Untag addresses in object files by default.Peter Collingbourne2019-08-051-0/+6
| | | | | | | | | | Any addresses that we pass to llvm-symbolizer are going to be untagged, while any HWASAN instrumented globals are going to be tagged in the symbol table. Therefore we need to untag the addresses before using them. Differential Revision: https://reviews.llvm.org/D65769 llvm-svn: 367926
* [llvm-lipo] Implement -segalignAnusha Basana2019-08-052-5/+82
| | | | | | | | | | Sets section alignments of the specified architecture slices to the alignment values. Alignment values are hexadecimal values that are powers of 2. Differential Revision: https://reviews.llvm.org/D65420 llvm-svn: 367908
* [llvm-readelf] Fix core note descriptionsJordan Rupprecht2019-08-051-2/+86
| | | | | | | | | | | | | | | | | | | | | | | Summary: Core files have different descriptions for note values. llvm-readelf currently prints the generic note type, which is wrong when using it to read a core file. To verify the constants/strings, see: Values: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=include/elf/common.h;h=75c4fb7e9d7c0f780d635ac305f579546b7b071b;hb=HEAD#l571 Strings: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=binutils/readelf.c;h=c31a5c1266b7bb62a485895b01b49e1f832ade35;hb=HEAD#l16881 Note: this does not handle printing the note data for NT_FILE, it just fixes the descriptions. Reviewers: MaskRay Reviewed By: MaskRay Subscribers: labath, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65608 llvm-svn: 367878
* Changing representation of .cv_def_range directives in Codeview debug info ↵Nilanjana Basu2019-08-051-2/+3
| | | | | | assembly format for better readability llvm-svn: 367867
* Revert "Changing representation of .cv_def_range directives in Codeview ↵Nilanjana Basu2019-08-051-3/+2
| | | | | | | | debug info assembly format for better readability" This reverts commit a885afa9fa8cab3b34f1ddf3d21535f88b662881. llvm-svn: 367861
* [yaml2obj] - Allow overriding sh_entsize for SHT_GNU_versym sections.George Rimar2019-08-051-1/+1
| | | | | | | | | | | This allows to write a test case for one of untested errors in llvm/Object/ELF.h. I did it in this patch to demonstrate. Differential revision: https://reviews.llvm.org/D65394 llvm-svn: 367860
* [obj2yaml] - Teach tool to dump SHT_NULL sections.George Rimar2019-08-051-7/+24
| | | | | | | | | | | Recently an advanced support of SHT_NULL sections was implemented in yaml2obj. This patch adds a corresponding support to obj2yaml. Differential revision: https://reviews.llvm.org/D65215 llvm-svn: 367852
* Changing representation of .cv_def_range directives in Codeview debug info ↵Nilanjana Basu2019-08-051-2/+3
| | | | | | assembly format for better readability llvm-svn: 367850
* Revert "[llvm-objdump] Re-commit r367284."Michael Pozulp2019-08-054-53/+28
| | | | | | | | This reverts r367776 (git commit d34099926e909390cb0254bebb4b7f5cf15467c7). My changes to llvm-objdump tests caused them to fail on windows: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/27368 llvm-svn: 367816
* Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFCFangrui Song2019-08-0532-52/+51
| | | | | | F_{None,Text,Append} are kept for compatibility since r334221. llvm-svn: 367800
* [llvm-objdump] Re-commit r367284.Michael Pozulp2019-08-044-28/+53
| | | | | | | | | | | | | | | | | | Add warning messages if disassembly + source for problematic inputs Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=41905 Reviewers: jhenderson, rupprecht, grimar Reviewed By: jhenderson, grimar Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62462 llvm-svn: 367776
* Temporarily Revert "Changing representation of cv_def_range directives in ↵Eric Christopher2019-08-021-3/+2
| | | | | | | | | | Codeview debug info assembly format for better readability" This is breaking bots and the author asked me to revert. This reverts commit 367704. llvm-svn: 367707
* Changing representation of cv_def_range directives in Codeview debug info ↵Nilanjana Basu2019-08-021-2/+3
| | | | | | assembly format for better readability llvm-svn: 367704
* [ORC] Change the locking scheme for ThreadSafeModule.Lang Hames2019-08-021-29/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ThreadSafeModule/ThreadSafeContext are used to manage lifetimes and locking for LLVMContexts in ORCv2. Prior to this patch contexts were locked as soon as an associated Module was emitted (to be compiled and linked), and were not unlocked until the emit call returned. This could lead to deadlocks if interdependent modules that shared contexts were compiled on different threads: when, during emission of the first module, the dependence was discovered the second module (which would provide the required symbol) could not be emitted as the thread emitting the first module still held the lock. This patch eliminates this possibility by moving to a finer-grained locking scheme. Each client holds the module lock only while they are actively operating on it. To make this finer grained locking simpler/safer to implement this patch removes the explicit lock method, 'getContextLock', from ThreadSafeModule and replaces it with a new method, 'withModuleDo', that implicitly locks the context, calls a user-supplied function object to operate on the Module, then implicitly unlocks the context before returning the result. ThreadSafeModule TSM = getModule(...); size_t NumFunctions = TSM.withModuleDo( [](Module &M) { // <- context locked before entry to lambda. return M.size(); }); Existing ORCv2 layers that operate on ThreadSafeModules are updated to use the new method. This method is used to introduce Module locking into each of the existing layers. llvm-svn: 367686
* [ThinLTO] Implement index-based WPDTeresa Johnson2019-08-021-0/+8
| | | | | | | | | | | | | | | | | | | This patch adds support to the WholeProgramDevirt pass to perform index-based WPD, which is invoked from ThinLTO during the thin link. The ThinLTO backend (WPD import phase) behaves the same regardless of whether the WPD decisions were made with the index-based or (the existing) IR-based analysis. Depends on D54815. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, arphaman, dang, llvm-commits Differential Revision: https://reviews.llvm.org/D55153 llvm-svn: 367679
* [MCA] Add support for printing immedate values as hex. Also enable lexing of ↵Andrea Di Biagio2019-08-022-0/+9
| | | | | | | | | | | | | | | | | | masm binary and hex literals. This patch adds a new llvm-mca flag named -print-imm-hex. By default, the instruction printer prints immediate operands as decimals. Flag -print-imm-hex enables the instruction printer to print those operands in hex. This patch also adds support for MASM binary and hex literal numbers (example 0FFh, 101b). Added tests to verify the behavior of the new flag. Tests also verify that masm numeric literal operands are now recognized. Differential Revision: https://reviews.llvm.org/D65588 llvm-svn: 367671
* Revert r367649: Improve raw_ostream so that you can "write" colors using ↵Rui Ueyama2019-08-026-11/+14
| | | | | | | | operator<< This reverts commit r367649 in an attempt to unbreak Windows bots. llvm-svn: 367658
* Improve raw_ostream so that you can "write" colors using operator<<Rui Ueyama2019-08-026-14/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. raw_ostream supports ANSI colors so that you can write messages to the termina with colors. Previously, in order to change and reset color, you had to call `changeColor` and `resetColor` functions, respectively. So, if you print out "error: " in red, for example, you had to do something like this: OS.changeColor(raw_ostream::RED); OS << "error: "; OS.resetColor(); With this patch, you can write the same code as follows: OS << raw_ostream::RED << "error: " << raw_ostream::RESET; 2. Add a boolean flag to raw_ostream so that you can disable colored output. If you disable colors, changeColor, operator<<(Color), resetColor and other color-related functions have no effect. Most LLVM tools automatically prints out messages using colors, and you can disable it by passing a flag such as `--disable-colors`. This new flag makes it easy to write code that works that way. Differential Revision: https://reviews.llvm.org/D65564 llvm-svn: 367649
* [dsymutil] Fix heap-use-after-free related to the LinkOptions.Jonas Devlieghere2019-08-011-5/+6
| | | | | | | | | In r367348, I changed dsymutil to pass the LinkOptions by value isntead of by const reference. However, the options were still captured by reference in the LinkLambda. This patch fixes that by passing them in by value. llvm-svn: 367635
* [llvm-objdump] Fix jumptable detection when disassembling Mach-O binariesKuba Mracek2019-08-011-18/+36
| | | | | | | | | | | - Add LC_SEGMENT_64 handling in getSectionsAndSymbols to be able to find the base segment address from 64-bit Mach-O binaries. - Add "data in code" detection into the !symbolTableWorked case, extract it into a separate function. - Fix uninitialized variable usage on BaseSegmentAddress (initialize to 0). - Add test. Differential Revision: https://reviews.llvm.org/D65491 llvm-svn: 367578
* Reland "[DwarfDebug] Dump call site debug info"Djordje Todorovic2019-07-311-4/+16
| | | | | | | | | The build failure found after the rL365467 has been resolved. Differential Revision: https://reviews.llvm.org/D60716 llvm-svn: 367446
* [build] Add the ability to create a symlink for lipoAnusha Basana2019-07-311-0/+4
| | | | | | | | | Add user enabled option to create lipo with symlink to llvm-lipo Used rL326381 for reference. Differential Revision: https://reviews.llvm.org/D65477 llvm-svn: 367444
* [dsymutil] Pass LinkOptions by value instead of const ref.Jonas Devlieghere2019-07-303-6/+6
| | | | | | | | | | | | | When looping over the difference architectures in a fat binary, we modify the link options before dispatching the link step to a different thread. Passing the options by cont reference is not thread safe, as we might modify its fields before the whole sturct is copied over. Given that the link options are already stored in the DwarfLinker, we can easily fix this by passing a copy of the link options instead of a reference, which would just get copied later on. llvm-svn: 367348
OpenPOWER on IntegriCloud