summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix MSVC llvm-exegesis build. NFCI.Simon Pilgrim2018-10-251-8/+8
| | | | | | MSVC is a bit funny about is_pod..... llvm-svn: 345252
* [llvm-exegesis] Add missing initializer.Clement Courbet2018-10-252-9/+9
| | | | | | This is a better fix than rL345245. llvm-svn: 345246
* [llvm-exegesis] Fix VC build of r345243.Clement Courbet2018-10-251-8/+8
| | | | | | | | "const members cannot be default initialized unless their type has a user defined default constructor" Make members non-const. llvm-svn: 345245
* [llvm-exegesis] Fix warning in r345243.Clement Courbet2018-10-251-1/+1
| | | | | | warning C4099: 'llvm::exegesis::PfmCountersInfo': type name first seen using 'class' now seen using 'struct' llvm-svn: 345244
* [MCSched] Bind PFM Counters to the CPUs instead of the SchedModel.Clement Courbet2018-10-259-22/+109
| | | | | | | | | | | | | | | | Summary: The pfm counters are now in the ExegesisTarget rather than the MCSchedModel (PR39165). This also compresses the pfm counter tables (PR37068). Reviewers: RKSimon, gchatelet Subscribers: mgrang, llvm-commits Differential Revision: https://reviews.llvm.org/D52932 llvm-svn: 345243
* [llvm-readobj] Print ELF header flags names in GNU outputSimon Atanasyan2018-10-251-48/+85
| | | | | | | | | | | | | | GNU readelf tool prints hex value of the ELF header flags field and the flags names. This change adds the same functionality to llvm-readobj. Now llvm-readobj can print MIPS and RISCV flags. New GNUStyle::printFlags() method is a copy of ScopedPrinter::printFlags() routine. Probably we can escape code duplication and / or simplify the printFlags() method. But it's a task for separate commit. Differential revision: https://reviews.llvm.org/D52027 llvm-svn: 345238
* [llvm-objcopy] Introduce dispatch mechanism based on the inputAlexander Shaposhnikov2018-10-243-29/+77
| | | | | | | | | | | | | In this diff we introduce dispatch mechanism based on the type of the input (archive, object file, raw binary) and the format (coff, elf, macho). We also move the ELF-specific code into the namespace llvm::objcopy::elf. Test plan: make check-all Differential revision: https://reviews.llvm.org/D53311 llvm-svn: 345217
* Make llvm-dwarfdump -name work on type units.Paul Robinson2018-10-241-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D53672 llvm-svn: 345203
* [llvm-mca] Replace InstRef::isValid with operator bool. NFC.Matt Davis2018-10-246-17/+12
| | | | llvm-svn: 345190
* [MC] Separate masm integer literal lexer support from inline asmReid Kleckner2018-10-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This renames the IsParsingMSInlineAsm member variable of AsmLexer to LexMasmIntegers and moves it up to MCAsmLexer. This is the only behavior controlled by that variable. I added a public setter, so that it can be set from outside or from the llvm-mc command line. We may need to arrange things so that users can get this behavior from clang, but that's future work. I also put additional hex literal lexing functionality under this flag to fix PR32973. It appears that this hex literal parsing wasn't intended to be enabled in non-masm-style blocks. Now, masm integers (0b1101 and 0ABCh) work in __asm blocks from clang, but 0b label references work when using .intel_syntax in standalone .s files. However, 0b label references will *not* work from __asm blocks in clang. They will work from GCC inline asm blocks, which it sounds like is important for Crypto++ as mentioned in PR36144. Essentially, we only lex masm literals for inline asm blobs that use intel syntax. If the .intel_syntax directive is used inside a gnu-style inline asm statement, masm literals will not be lexed, which is compatible with gas and llvm-mc standalone .s assembly. This fixes PR36144 and PR32973. Reviewers: Gerolf, avt77 Subscribers: eraman, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D53535 llvm-svn: 345189
* [llvm-mca] Simplify the logic in FetchStage. NFCIAndrea Di Biagio2018-10-243-22/+18
| | | | | | Only method 'getNextInstruction()' needs to interact with the SourceMgr. llvm-svn: 345185
* [llvm-mca] Remove dependency from InstrBuilder in class InstructionTables.Andrea Di Biagio2018-10-246-12/+9
| | | | | | | | | Also, removed the initialization of vectors used for processor resource masks. Support function 'computeProcResourceMasks()' already calls method resize on those vectors. No functional change intended. llvm-svn: 345161
* [llvm-mca] Refactor class SourceMgr. NFCIAndrea Di Biagio2018-10-244-44/+43
| | | | | | | | Added begin()/end() methods to allow the usage of SourceMgr in foreach loops. With this change, method getMCInstFromIndex() (as well as a couple of other methods) are now redundant, and can be removed from the public interface. llvm-svn: 345147
* Fix llvm-strings crash for negative char valuesJames Henderson2018-10-241-1/+1
| | | | | | | | | | | | | | | | | On Windows at least, llvm-strings was crashing if it encountered bytes that mapped to negative chars, as it was passing these into std::isgraph and std::isblank functions, resulting in undefined behaviour. On debug builds using MSVC, these functions verfiy that the value passed in is representable as an unsigned char. Since the char is promoted to an int, a value greater than 127 would turn into a negative integer value, and fail the check. Using the llvm::isPrint function is sufficient to solve the issue. Reviewed by: ruiu, mstorsjo Differential Revision: https://reviews.llvm.org/D53509 llvm-svn: 345137
* [llvm-exegesis] Implements a cache of Instruction objects.Guillaume Chatelet2018-10-246-8/+40
| | | | llvm-svn: 345130
* [llvm-mca] [llvm-mca] Improved error handling and error reporting from class ↵Andrea Di Biagio2018-10-244-47/+78
| | | | | | | | | | | | | | | | | | | | | | | | | InstrBuilder. A new class named InstructionError has been added to Support.h in order to improve the error reporting from class InstrBuilder. The llvm-mca driver is responsible for handling InstructionError objects, and printing them out to stderr. The goal of this patch is to remove all the remaining error handling logic from the library code. In particular, this allows us to: - Simplify the logic in InstrBuilder by removing a needless dependency from MCInstrPrinter. - Centralize all the error halding logic in a new function named 'runPipeline' (see llvm-mca.cpp). This is also a first step towards generalizing class InstrBuilder, so that in future, we will be able to reuse its logic to also "lower" MachineInstr to mca::Instruction objects. Differential Revision: https://reviews.llvm.org/D53585 llvm-svn: 345129
* [AMDGPU] Defined gfx909 Raven Ridge 2Tim Renouf2018-10-241-0/+1
| | | | | | | Differential Revision: https://reviews.llvm.org/D53418 Change-Id: Ie3d054f2e956c2768988c0f4c0ffd29a47294eef llvm-svn: 345120
* [ARM64][Windows] Add unwind support to llvm-readobjSanjin Sijaric2018-10-243-38/+416
| | | | | | | | | This patch adds support for dumping the unwind info from ARM64 COFF object files. Differential Revision: https://reviews.llvm.org/D53264 llvm-svn: 345108
* [ORC] Re-apply r345077 with fixes to remove ambiguity in lookup calls.Lang Hames2018-10-231-7/+39
| | | | llvm-svn: 345098
* [dwarfdump] Make incompatibility between -diff and -verbose explicit.Jonas Devlieghere2018-10-231-1/+9
| | | | | | | | Using -diff and -verbose together doesn't work today. We should audit where these two options interact and fix them. In the meantime we error out when the user try to specify both. llvm-svn: 345084
* [llvm-objcopy] Fix use-after-move clang-tidy warningJordan Rupprecht2018-10-231-2/+2
| | | | llvm-svn: 345079
* Revert r345077 "[ORC] Change how non-exported symbols are matched during ↵Reid Kleckner2018-10-231-39/+7
| | | | | | | | | | | | | | | lookup." Doesn't build on Windows. The call to 'lookup' is ambiguous. Clang and MSVC agree, anyway. http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/787 C:\b\slave\clang-x64-windows-msvc\build\llvm.src\unittests\ExecutionEngine\Orc\CoreAPIsTest.cpp(315): error C2668: 'llvm::orc::ExecutionSession::lookup': ambiguous call to overloaded function C:\b\slave\clang-x64-windows-msvc\build\llvm.src\include\llvm/ExecutionEngine/Orc/Core.h(823): note: could be 'llvm::Expected<llvm::JITEvaluatedSymbol> llvm::orc::ExecutionSession::lookup(llvm::ArrayRef<llvm::orc::JITDylib *>,llvm::orc::SymbolStringPtr)' C:\b\slave\clang-x64-windows-msvc\build\llvm.src\include\llvm/ExecutionEngine/Orc/Core.h(817): note: or 'llvm::Expected<llvm::JITEvaluatedSymbol> llvm::orc::ExecutionSession::lookup(const llvm::orc::JITDylibSearchList &,llvm::orc::SymbolStringPtr)' C:\b\slave\clang-x64-windows-msvc\build\llvm.src\unittests\ExecutionEngine\Orc\CoreAPIsTest.cpp(315): note: while trying to match the argument list '(initializer list, llvm::orc::SymbolStringPtr)' llvm-svn: 345078
* [ORC] Change how non-exported symbols are matched during lookup.Lang Hames2018-10-231-7/+39
| | | | | | | | | | | | | | | | | In the new scheme the client passes a list of (JITDylib&, bool) pairs, rather than a list of JITDylibs. For each JITDylib the boolean indicates whether or not to match against non-exported symbols (true means that they should be found, false means that they should not). The MatchNonExportedInJD and MatchNonExported parameters on lookup are removed. The new scheme is more flexible, and easier to understand. This patch also updates JITDylib search orders to be lists of (JITDylib&, bool) pairs to match the new lookup scheme. Error handling is also plumbed through the LLJIT class to allow regression tests to fail predictably when a lookup from a lazy call-through fails. llvm-svn: 345077
* [llvm-strip] Support -s alias for --strip-all. Make both strip and objcopy ↵Jordan Rupprecht2018-10-232-2/+5
| | | | | | | | | | | | | | | | | | | | | case sensitive to support both -s (--strip-all) and -S (--strip-debug). Summary: GNU strip supports both `-s` and `-S` as aliases for `--strip-all` and `--strip-debug`, respectfully. As part of this, it turns out that strip/objcopy were accepting case insensitive command line args. I'm not sure if there was an explicit reason for this. The only others uses of this are llvm-cvtres/llvm-mt/llvm-lib, which are all tools specific for windows support. Forcing case sensitivity allows both aliases to exist, but seems like a good idea anyway. And as a surprise test case adjustment, the llvm-strip unit test was running with `-keep=unavailable_symbol`, despite `keep` not be a valid flag for strip. This is because there is a flag `-K` which, when case insensitivity is permitted, allows it to be interpreted as `-K` = `eep=unavailable_symbol` (e.g. to allow `-Kfoo` == `--keep-symbol=foo`). Reviewers: jakehehrlich, jhenderson, alexshap Reviewed By: jakehehrlich Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D53163 llvm-svn: 345068
* [RuntimeDyld][COFF] Skip non-loaded sections when calculating ImageBase.Lang Hames2018-10-231-5/+14
| | | | | | | | | | | | | | | | | | Non-loaded sections (whose unused load-address defaults to zero) should not be taken into account when calculating ImageBase, or ImageBase will be incorrectly set to 0. Patch by Andrew Scheidecker. Thanks Andrew! https://reviews.llvm.org/D51343 + // The Sections list may contain sections that weren't loaded for + // whatever reason: they may be debug sections, and ProcessAllSections + // is false, or they may be sections that contain 0 bytes. If the + // section isn't loaded, the load address will be 0, and it should not + // be included in the ImageBase calculation. llvm-svn: 344995
* [dsymutil] Improve error reporting when we cannot create output file.Jonas Devlieghere2018-10-231-31/+42
| | | | | | | | | Before this patch we were returning an empty string in case we couldn't create the output file. Now we return an expected string so we can return and print the proper issue. We now return errors instead of bools and defer printing to the call site. llvm-svn: 344983
* [llvm-exegesis] Fix name lookup ambiguity in MSVC after 344922Fangrui Song2018-10-221-1/+1
| | | | llvm-svn: 344927
* [llvm-exegesis] Move namespace exegesis inside llvm::Fangrui Song2018-10-2234-52/+122
| | | | | | | | | | | | | | | | Summary: This allows simplifying references of llvm::foo with foo when the needs come in the future. Reviewers: courbet, gchatelet Reviewed By: gchatelet Subscribers: javed.absar, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D53455 llvm-svn: 344922
* [llvm-mca] Remove a couple of using directives and a bunch of redundant ↵Andrea Di Biagio2018-10-227-16/+13
| | | | | | namespace llvm prefixes. NFC llvm-svn: 344916
* [llvm-mca] Use llvm::ArrayRef in class SourceMgr. NFCIAndrea Di Biagio2018-10-225-33/+31
| | | | | | | Class SourceMgr now uses type ArrayRef<MCInst> to reference the sequence of code from a "CodeRegion". llvm-svn: 344911
* [llvm-exegesis] Crash when assembling invalid OperandGuillaume Chatelet2018-10-221-0/+2
| | | | llvm-svn: 344907
* [llvm-exegesis] Mark x86 segment register instructions as unsupported.Guillaume Chatelet2018-10-221-0/+6
| | | | | | | | | | Reviewers: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D53499 llvm-svn: 344906
* [llvm-exegesis] Reject x86 instructions that use non uniform memory accessesGuillaume Chatelet2018-10-221-25/+64
| | | | | | | | | | Reviewers: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D53438 llvm-svn: 344905
* [llvm-objdump] Fix --file-headers (-f) optionPetar Jovanovic2018-10-191-1/+4
| | | | | | | | | | | | | | | | | Changed the format call to match the surrounding code. Previously it was printing an unsigned int while the return type being printed was long unsigned int or wider. This caused problems for big-endian systems which were discovered on mips64. Also, the printed address had less characters than it should because the character count was directly obtained from the number of bytes in the address. The tests were adapted to fit this fix and now use longer addresses. Patch by Milos Stojanovic. Differential Revision: https://reviews.llvm.org/D53403 llvm-svn: 344818
* [llvm-mca] Remove a stale TODO comment. NFCAndrea Di Biagio2018-10-191-2/+0
| | | | | | | Starting from revision r344334, we can now describe optimizable register-register moves in the machine scheduling models. llvm-svn: 344797
* [llvm-exegesis] Mark second-form X87 instructions as unsupported.Clement Courbet2018-10-191-1/+8
| | | | | | | | | | | | | | Summary: We only support the first form because we rely on information that is only available there. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D53430 llvm-svn: 344782
* [llvm-exegesis] Re-enable liveliness tracker.Clement Courbet2018-10-191-1/+2
| | | | | | | | | | Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D53429 llvm-svn: 344780
* [llvm-exegesis] X87 RFP setup code.Clement Courbet2018-10-191-13/+27
| | | | | | | | | | | | | | | | Summary: This was lost during refactoring in rL342644. Fix and simplify simplify value size handling: always go through a 80 bit value, because the value can be 1 byte). Add unit tests. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D53423 llvm-svn: 344779
* Use llvm::{all,any,none}_of instead std::{all,any,none}_of. NFCFangrui Song2018-10-194-14/+13
| | | | llvm-svn: 344774
* Support of hurd in llvm-shlib Sylvestre Ledru2018-10-181-0/+1
| | | | | | Svante Signell llvm-svn: 344756
* [llvm-exegesis] Fix off by one errorGuillaume Chatelet2018-10-181-1/+1
| | | | llvm-svn: 344731
* [llvm-exegesis] Mark destructor virtual after r344695Krasimir Georgiev2018-10-181-1/+1
| | | | | | This was causing a -Wnon-virtual-dtor warning. llvm-svn: 344721
* [llvm-exegesis] Allow measuring several instructions in a single run.Clement Courbet2018-10-177-84/+157
| | | | | | | | | | | | | | | | Summary: We try to recover gracefully on instructions that would crash the program. This includes some refactoring of runMeasurement() implementations. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D53371 llvm-svn: 344695
* Fix uninitialized variableGuillaume Chatelet2018-10-171-1/+1
| | | | llvm-svn: 344692
* BuildBot fix, compiler complains about array decay to pointerGuillaume Chatelet2018-10-171-11/+10
| | | | llvm-svn: 344690
* [llvm-exegeis] Computing Latency configuration upfront so we can generate ↵Guillaume Chatelet2018-10-178-43/+258
| | | | | | | | | | | | | | | | many CodeTemplates at once. Summary: LatencyGenerator now computes all possible mode of serial execution for an Instruction upfront and generates CodeTemplate for the ones that give the best results (e.g. no need to generate a two instructions snippet when repeating a single one would do). The next step is to generate even more configurations for cases (e.g. for XOR we should generate "XOR EAX, EAX, EAX" and "XOR EAX, EAX, EBX") Reviewers: courbet Reviewed By: courbet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D53320 llvm-svn: 344689
* [NewPM] teach -passes= to emit meaningful error messagesFedor Sergeev2018-10-172-43/+58
| | | | | | | | | | | | | | All the PassBuilder::parse interfaces now return descriptive StringError instead of a plain bool. It allows to make -passes/aa-pipeline parsing errors context-specific and thus less confusing. TODO: ideally we should also make suggestions for misspelled pass names, but that requires some extensions to PassBuilder. Reviewed By: philip.pfaffe, chandlerc Differential Revision: https://reviews.llvm.org/D53246 llvm-svn: 344685
* [LTO] Call InitLLVM from llvm-lto2Teresa Johnson2018-10-161-0/+2
| | | | | | | | | | | | | | Summary: D45602 added this to most tools, including llvm-lto, but not to llvm-lto2. Add it there and test that it works in both lto tools. Reviewers: ruiu Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D53330 llvm-svn: 344631
* [llvm-objcopy] Factor out BufferAlexander Shaposhnikov2018-10-166-74/+120
| | | | | | | | | | | | In this diff we move out the hierarchy of buffers from Object.h/Object.cpp into separate files since it is not ELF-specific and will be reused later. After this change Object.h/Object.cpp are almost exclusively ELF-specific. Test plan: make check-all Differential revision: https://reviews.llvm.org/D53298 llvm-svn: 344585
* [ORC] Rename ORC layers to make the "new" ORC layers the default.Lang Hames2018-10-151-3/+3
| | | | | | | | | | | | | This commit adds a 'Legacy' prefix to old ORC layers and utilities, and removes the '2' suffix from the new ORC layers. If you wish to continue using the old ORC layers you will need to add a 'Legacy' prefix to your classes. If you were already using the new ORC layers you will need to drop the '2' suffix. The legacy layers will remain in-tree until the new layers reach feature parity with them. This will involve adding support for removing code from the new layers, and ensuring that performance is comperable. llvm-svn: 344572
OpenPOWER on IntegriCloud