summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* [dsymutil] Rename conflicting declarationJonas Devlieghere2018-06-292-9/+9
| | | | | | | Using MemoryBuffer as member name clashed with the llvm::MemoryBuffer class. llvm-svn: 335995
* [dsymutil] Make the CachedBinaryHolder the defaultJonas Devlieghere2018-06-299-377/+120
| | | | | | | | Replaces all uses of the old binary holder with its cached variant. Differential revision: https://reviews.llvm.org/D48770 llvm-svn: 335991
* [dsymutil] Introduce a new CachedBinaryHolderJonas Devlieghere2018-06-296-32/+409
| | | | | | | | | | | | | | | | | | | | | | | | The original binary holder has an optimization where it caches a static library (archive) between consecutive calls to GetObjects. However, the actual memory buffer wasn't cached between calls. This made sense when dsymutil was processing objects one after each other, but when processing them in parallel, several binaries have to be in memory at the same time. For this reason, every link context contained a binary holder. Having one binary holder per context is problematic, because the same static archive was cached for every object file. Luckily, when the file is mmap'ed, this was only costing us virtual memory. This patch introduces a new BinaryHolder variant that is fully cached, for all the object files it load, as well as the static archives. This way, we don't have to give up on this optimization of bypassing the file system. Differential revision: https://reviews.llvm.org/D48501 llvm-svn: 335990
* [llvm-mca] Remove field HasReadAdvanceEntries from class ReadDescriptor.Andrea Di Biagio2018-06-293-15/+0
| | | | | | | | | | | | This simplifies the logic that updates RAW dependencies in the DispatchStage. There is no advantage in storing that flag in the ReadDescriptor; we should simply rely on the call to `STI.getReadAdvanceCycles()` to obtain the ReadAdvance cycles. If there are no read-advance entries, then method `getReadAdvanceCycles()` quickly returns 0. No functional change intended. llvm-svn: 335977
* [llvm-readobj] Add experimental support for SHT_RELR sectionsJake Ehrlich2018-06-284-19/+119
| | | | | | | | | | | | | | | This change adds experimental support for SHT_RELR sections, proposed here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg Definitions for the new ELF section type and dynamic array tags, as well as the encoding used in the new section are all under discussion and are subject to change. Use with caution! Author: rahulchaudhry Differential Revision: https://reviews.llvm.org/D47919 llvm-svn: 335922
* Handle absolute symbols as branch targets in disassembly.Sterling Augustine2018-06-281-21/+35
| | | | | | https://reviews.llvm.org/D48554 llvm-svn: 335903
* [Debugify] Do not report line 0 locations as errorsVedant Kumar2018-06-281-5/+7
| | | | | | | | | | The checking logic should not treat artificial locations as being somehow problematic. Producing these locations can be the desired behavior of some passes. See llvm.org/PR37961. llvm-svn: 335897
* [llvm-mca] Delete Pipeline's copy ctor and assignement operator.Matt Davis2018-06-281-0/+3
| | | | | | Prevent copying of the Pipeline. llvm-svn: 335885
* [llvm-mca] Use a WriteRef to describe register writes in class RegisterFile.Andrea Di Biagio2018-06-286-50/+103
| | | | | | | | | | | This patch introduces a new class named WriteRef. A WriteRef is used by the RegisterFile to keep track of register definitions. Internally it wraps a WriteState, as well as the source index of the defining instruction. This patch allows the tool to propagate additional information to support future analysis on data dependencies. llvm-svn: 335867
* [dsymutil] Use UnitListTy consistently (NFC)Jonas Devlieghere2018-06-282-18/+15
| | | | | | | Use the UnitListTy typedef consistently throughout the Dwarf linker and pass it by const reference where possible. llvm-svn: 335860
* [llvm-mca] Refactor method RegisterFile::collectWrites(). NFCIAndrea Di Biagio2018-06-281-7/+13
| | | | | | | | | | | | Rather than calling std::find in a loop, just sort the vector and remove duplicate entries at the end of the function. Also, move the debug print at the end of the function, and query the MCRegisterInfo to print register names rather than physreg IDs. No functional change intended. llvm-svn: 335837
* [llvm-exegesis] Add partial X87 support.Clement Courbet2018-06-285-69/+135
| | | | | | | | | | | | | | Summary: This enables the X86-specific X86FloatingPointStackifierPass, and allow llvm-exegesis to generate and measure X87 latency/uops for some FP ops. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48592 llvm-svn: 335815
* [cmake][xcode-toolchain] add support for major Xcode version >= 10Alex Lorenz2018-06-281-1/+1
| | | | | | | | | The regex that extracts the Xcode version should support major versions with two digits. rdar://41465184 llvm-svn: 335801
* [llvm-objdump] Add -x --all-headers optionsFangrui Song2018-06-272-0/+10
| | | | | | | | | | Reviewers: paulsemel, echristo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48622 llvm-svn: 335785
* [dsymutil] Move abstractions into separate files (NFC)Jonas Devlieghere2018-06-2717-2020/+2225
| | | | | | | | | | | This patch splits off some abstractions used by dsymutil's dwarf linker and moves them into separate header and implementation files. This almost halves the number of LOC in DwarfLinker.cpp and makes it a lot easier to understand what functionality lives where. Differential revision: https://reviews.llvm.org/D48647 llvm-svn: 335749
* [llvm-mca] Register listeners with stages; remove Pipeline dependency from ↵Matt Davis2018-06-2711-71/+49
| | | | | | | | | | | | | | | | | | | | | | | | Stage. Summary: This patch removes a few callbacks from Pipeline. It comes at the cost of registering Listeners with all Stages. Not all stages need listeners or issue callbacks, this registration is a bit redundant. However, as we build-out the API, this redundancy can disappear. The main purpose here is to move callback code from the Pipeline and into the stages that actually issue those callbacks. This removes the back-pointer to the Pipeline that was put into a few Stage subclasses. Reviewers: andreadb, courbet, RKSimon Reviewed By: andreadb, courbet Subscribers: tschuett, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D48576 llvm-svn: 335748
* [llvm-mca] Avoid calling method update() on instructions that are already in ↵Andrea Di Biagio2018-06-273-15/+25
| | | | | | | | | | the IS_READY state. NFCI When promoting instructions from the wait queue to the ready queue, we should check if an instruction has already reached the IS_READY state before calling method update(). llvm-svn: 335722
* [llvm-mca] Add a comment to Stage::execute and fix a spelling error. NFC.Matt Davis2018-06-271-1/+3
| | | | llvm-svn: 335697
* [Debugify] Handle failure to get fragment size when checking dbg.valuesVedant Kumar2018-06-271-4/+7
| | | | | | | | | | It's not possible to get the fragment size of some dbg.values. Teach the mis-sized dbg.value diagnostic to detect this scenario and bail out. Tested with: $ find test/Transforms -print -exec opt -debugify-each -instcombine {} \; llvm-svn: 335695
* [Debugify] Diagnose mis-sized dbg.valuesVedant Kumar2018-06-261-4/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Report an error in -check-debugify when the size of a dbg.value operand doesn't match up with the size of the variable it describes. Eventually this check should be moved into the IR verifier. For the moment, it's useful to include the check in -check-debugify as a means of catching regressions and finding existing bugs. Here are some instances of bugs the new check finds in the -O2 pipeline (all in InstCombine): 1) A float is used where a double is expected: ERROR: dbg.value operand has size 32, but its variable has size 64: call void @llvm.dbg.value(metadata float %expf, metadata !12, metadata !DIExpression()), !dbg !15 2) An i8 is used where an i32 is expected: ERROR: dbg.value operand has size 8, but its variable has size 32: call void @llvm.dbg.value(metadata i8 %t4, metadata !14, metadata !DIExpression()), !dbg !24 3) A <4 x i32> is used where something twice as large is expected (perhaps a <4 x i64>, I haven't double-checked): ERROR: dbg.value operand has size 128, but its variable has size 256: call void @llvm.dbg.value(metadata <4 x i32> %4, metadata !40, metadata !DIExpression()), !dbg !95 Differential Revision: https://reviews.llvm.org/D48408 llvm-svn: 335682
* [ORC] Add LLJIT and LLLazyJIT, and replace OrcLazyJIT in LLI with LLLazyJIT.Lang Hames2018-06-264-410/+141
| | | | | | | | | | | | | | | | | | | LLJIT is a prefabricated ORC based JIT class that is meant to be the go-to replacement for MCJIT. Unlike OrcMCJITReplacement (which will continue to be supported) it is not API or bug-for-bug compatible, but targets the same use cases: Simple, non-lazy compilation and execution of LLVM IR. LLLazyJIT extends LLJIT with support for function-at-a-time lazy compilation, similar to what was provided by LLVM's original (now long deprecated) JIT APIs. This commit also contains some simple utility classes (CtorDtorRunner2, LocalCXXRuntimeOverrides2, JITTargetMachineBuilder) to support LLJIT and LLLazyJIT. Both of these classes are works in progress. Feedback from JIT clients is very welcome! llvm-svn: 335670
* [Debugify] Don't treat missing dbg.values as an error (PR37942)Vedant Kumar2018-06-261-2/+1
| | | | | | | | | When checking the debug info in a module, don't treat a missing dbg.value as an error. The dbg.value may simply have been DCE'd, in which case the debugger has enough information to display the variable as <optimized out>. llvm-svn: 335647
* [ThinLTO] Parse module summary index from assemblyTeresa Johnson2018-06-261-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds assembly parsing support for the module summary index (follow on to r333335 which added the assembly writing support). I added support to llvm-as to invoke the index parsing, so that it can create either a bitcode file with a Module and a per-module index, or a combined index without a Module. I will send follow on patches soon to do the following: - add support to tools such as llvm-lto2 to parse the per-module indexes from assembly instead of bitcode when testing the thin link. - verification support. Depends on D47844 and D47842. Reviewers: pcc, dexonsmith, mehdi_amini Subscribers: inglorion, eraman, steven_wu, llvm-commits Differential Revision: https://reviews.llvm.org/D47905 llvm-svn: 335602
* [llvm-mca] Removed wrong NDEBUG guards introduced by my last commit.Andrea Di Biagio2018-06-264-10/+0
| | | | | | This partially reverts r335589. llvm-svn: 335592
* [llvm-exegesis][NFC] Fix windows warning in rL335465.Clement Courbet2018-06-261-1/+1
| | | | llvm-svn: 335591
* [llvm-mca] Remove unused header files and correctly guard some include ↵Andrea Di Biagio2018-06-267-8/+19
| | | | | | headers under NDEBUG. NFC llvm-svn: 335589
* [llvm-exegesis] Get the BenchmarkRunner from the ExegesisTarget.Clement Courbet2018-06-2617-162/+177
| | | | | | | | | | | | | | | Summary: This allows targets to override code generation for some instructions. As an example of override, this also moves ad-hoc instruction filtering for X86 into the X86 ExegesisTarget. Reviewers: gchatelet Subscribers: mgorny, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48587 llvm-svn: 335582
* [llvm-mca] Rename Backend to Pipeline. NFC.Matt Davis2018-06-2522-96/+97
| | | | | | | | | | | | | | | | | | Summary: This change renames the Backend and BackendPrinter to Pipeline and PipelinePrinter respectively. Variables and comments have also been updated to reflect this change. The reason for this rename, is to be slightly more correct about what MCA is modeling. MCA models a Pipeline, which implies some logical sequence of stages. Reviewers: andreadb, courbet, RKSimon Reviewed By: andreadb, courbet Subscribers: mgorny, javed.absar, tschuett, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D48496 llvm-svn: 335496
* [llvm-exegesis][NFC] Remove unnecessary member variables.Clement Courbet2018-06-254-12/+9
| | | | llvm-svn: 335470
* [llvm-exegesis] Fix warning in r22752: Initialize IsSnippetSetupComplete.Clement Courbet2018-06-251-1/+1
| | | | llvm-svn: 335467
* [llvm-exegesis] Generate snippet setup code.Clement Courbet2018-06-2510-23/+220
| | | | | | | | | | | | | | | Summary: This ensures that the snippet always sees the same values for registers, making measurements reproducible. This will also allow exploring different values. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48542 llvm-svn: 335465
* [llvm-exegesis][NFC] Simplify BenchmarkRunner ctor.Clement Courbet2018-06-251-2/+1
| | | | llvm-svn: 335456
* [llvm-exegesis][NFC] clang-formatClement Courbet2018-06-256-20/+19
| | | | llvm-svn: 335452
* [llvm-exegesis][NFC] Fix `Operand` class comments.Clement Courbet2018-06-251-2/+2
| | | | llvm-svn: 335450
* [CMake] Support building shared library for OpenBSDBrad Smith2018-06-231-0/+1
| | | | llvm-svn: 335424
* [llc] Fix sanitizer failure.Jonas Devlieghere2018-06-231-1/+1
| | | | | | | | | | | Store the string on the stack rather than just the StringRef. Fix sanitizer bots: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/19948 http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/5500 llvm-svn: 335423
* [llc] Use WithColor for printing errors/warningsJonas Devlieghere2018-06-231-19/+27
| | | | | | Use the WithColor helper from support to print errors and warnings. llvm-svn: 335418
* [llvm-config] Use WithColor for printing errors.Jonas Devlieghere2018-06-231-7/+9
| | | | | | Use the WithColor helper from support to print errors. llvm-svn: 335417
* [llvm-mt] Use WithColor for printing errors.Jonas Devlieghere2018-06-231-1/+2
| | | | | | Use the WithColor helper from support to print errors. llvm-svn: 335416
* [llvm-size] Make global variables staticFangrui Song2018-06-221-2/+2
| | | | llvm-svn: 335397
* [llvm-mca] Remove unnecessary include and forward decl in RCU. NFC.Matt Davis2018-06-222-5/+3
| | | | | | | The DispatchUnit is no longer a dependency of RCU, so this patch removes a stale include and forward decl. This patch also cleans up some comments. llvm-svn: 335392
* [llvm-mca] Remove redundant call. NFCAndrea Di Biagio2018-06-221-2/+0
| | | | llvm-svn: 335368
* [llvm-mca] Set the operand ID for implicit register reads/writes. NFCAndrea Di Biagio2018-06-222-36/+43
| | | | | | | Also, move the definition of InstRef at the end of Instruction.h to avoid a forward declaration. llvm-svn: 335363
* [llvm-mca] Introduce a sequential container of StagesMatt Davis2018-06-2210-74/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Remove explicit stages and introduce a list of stages. A pipeline should be composed of an arbitrary list of stages, and not any predefined list of stages in the Backend. The Backend should not know of any particular stage, rather it should only be concerned that it has a list of stages, and that those stages will fulfill the contract of what it means to be a Stage (namely pre/post/execute a given instruction). For now, we leave the original set of stages defined in the Backend ctor; however, I imagine these will be moved out at a later time. This patch makes an adjustment to the semantics of Stage::isReady. Specifically, what the Backend really needs to know is if a Stage has unfinished work. With that said, it is more appropriately renamed Stage::hasWorkToComplete(). This change will clean up the check in Backend::run(), allowing us to query each stage to see if there is unfinished work, regardless of what subclass a stage might be. I feel that this change simplifies the semantics too, but that's a subjective statement. Given how RetireStage and ExecuteStage handle data in their preExecute(), I've had to change the order of Retire and Execute in our stage list. Retire must complete any of its preExecute actions before ExecuteStage's preExecute can take control. This is mainly because both stages utilize the RCU. In the meantime, I want to see if I can adjust that or remove that coupling. Reviewers: andreadb, RKSimon, courbet Reviewed By: andreadb Subscribers: tschuett, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D46907 llvm-svn: 335361
* [dsymutil] Force mmap'ing of binariesJonas Devlieghere2018-06-211-2/+2
| | | | | | | | | | | | | | | | | | | | | After the recent refactoring that introduced parallel handling of different object, the binary holder became unique per object file. This defeats its optimization of caching archives, leading to an archive being opened for every binary it contains. This is obviously unfortunate and will need to be refactored soon. Luckily in practice, the impact of this is limited as most files are mmap'ed instead of memcopy'd. There's a caveat however: when the memory buffer requires a null terminator and it's a multiple of the page size, we allocate instead of mmap'ing. If this happens for a static archive, we end up with N copies of it in memory, where N is the number of objects in the archive, leading to exuberant memory usage. This provided a stopgap solution to ensure that all the files it loads are mmap in memory by removing the requirement for a terminating null byte. Differential revision: https://reviews.llvm.org/D48397 llvm-svn: 335293
* [llvm-exegesis][NFC] Simplify BenchmarkRunner.Clement Courbet2018-06-211-21/+12
| | | | | | Get rid of createExecutableFunction(). llvm-svn: 335240
* [llvm-exegesis][NFC] Simplify LLVMState.Clement Courbet2018-06-213-34/+39
| | | | | | | | | | | | Summary: Pretty much everything we need is in llvm::TargetMachine. Reviewers: gchatelet Subscribers: llvm-commits, tschuett Differential Revision: https://reviews.llvm.org/D48428 llvm-svn: 335237
* [llvm-mca] Updates comment in code, and remove some stale comments. NFCAndrea Di Biagio2018-06-214-145/+81
| | | | | | | Also, rename fields `TotalMappings` and `NumUsedMappings` in struct RegisterMappingTracker into `NumPhysRegs` and `NumUsedPhysRegs`. llvm-svn: 335219
* [DWARF] Improved error reporting for range lists. Wolfgang Pieb2018-06-202-4/+20
| | | | | | | | | | | Errors found processing the DW_AT_ranges attribute are propagated by lower level routines and reported by their callers. Reviewer: JDevlieghere Differential Revision: https://reviews.llvm.org/D48344 llvm-svn: 335188
* [llvm-mca] use APint::operator[] to obtain the bit value. NFCAndrea Di Biagio2018-06-201-4/+2
| | | | llvm-svn: 335131
OpenPOWER on IntegriCloud