summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-mca] Pass the InstrBuilder to the constructor of Backend.Andrea Di Biagio2018-03-233-8/+10
| | | | | | | This is done in preparation for the fix for PR36784. No functional change. llvm-svn: 328306
* [llvm-mca] Add flag -resource-pressure to enable/disable printing of the ↵Andrea Di Biagio2018-03-231-1/+7
| | | | | | | | | resource pressure view. By default, the tool always enables the resource pressure view. This flag lets user specify whether they want to add that view or not. llvm-svn: 328305
* For llvm-nm and Mach-O files also use function starts info in someKevin Enderby2018-03-221-2/+90
| | | | | | | | | | | | | | cases when printing symbols. As an improvement to: r305733 - Change llvm-nm for Mach-O files to use dyld info in some cases when printing symbols it could be made a bit better if it also read the function starts and faked up nlist entries to those address not already faked up by the other dyld info. This would help with stripped static functions. rdar://38761029 llvm-svn: 328274
* [llvm-mca] Minor refactoring. NFCIAndrea Di Biagio2018-03-225-28/+31
| | | | | | Also, removed a couple of unused methods from class Instruction. llvm-svn: 328198
* [llvm-mca] Simplify (and better standardize) the Instruction interface.Andrea Di Biagio2018-03-226-31/+29
| | | | llvm-svn: 328190
* [llvm-mca] Simplify code. NFCAndrea Di Biagio2018-03-2211-85/+69
| | | | llvm-svn: 328187
* Fix a couple of layering violations in TransformsDavid Blaikie2018-03-211-1/+1
| | | | | | | | | | | | | Remove #include of Transforms/Scalar.h from Transform/Utils to fix layering. Transforms depends on Transforms/Utils, not the other way around. So remove the header and the "createStripGCRelocatesPass" function declaration (& definition) that is unused and motivated this dependency. Move Transforms/Utils/Local.h into Analysis because it's used by Analysis/MemoryBuiltins.cpp. llvm-svn: 328165
* [llvm-objcopy] Implement support for section groupsAlexander Shaposhnikov2018-03-212-45/+137
| | | | | | | | | | | | | | | | | | | This diff adds support for SHT_GROUP sections to llvm-objcopy. Some sections are interrelated and comprise a group. For example, a definition of an inline function might require, in addition to the section containing its instructions, a read-only data section containing literals referenced inside the function. A section of the type SHT_GROUP contains the indices of the group members, therefore, it needs to be updated whenever the indices change. Similarly, the fields sh_link, sh_info should be recalculated as well. [Resubmit r328012 with the proper handling of endianness] Test plan: make check-all Differential revision: https://reviews.llvm.org/D43996 llvm-svn: 328143
* typoAdrian Prantl2018-03-211-1/+1
| | | | llvm-svn: 328141
* [llvm-mca] Move the logic that computes the register file usage to the ↵Andrea Di Biagio2018-03-217-75/+103
| | | | | | | | | | | | | | | | | | | | | | | BackendStatistics view. With this patch, the "instruction dispatched" event now provides information related to the number of microarchitectural registers used in each register file. Similarly, the "instruction retired" event is now able to tell how may registers are freed in each register file. Currently, the BackendStatistics view is the only consumer of register usage/pressure information. BackendStatistics uses that info to print out a few general statistics (i.e. max number of mappings used; total mapping created). Before this patch, the BackendStatistics was forced to query the Backend to obtain the register pressure information. This helps removes that dependency. Now views are completely independent from the Backend. As a consequence, it should be easier to address PR36663 and further modularize the pipeline. Added a couple of test cases in the BtVer2 specific directory. llvm-svn: 328129
* Change DT_* value definitions to macros in a separate fileAlexander Richardson2018-03-211-69/+25
| | | | | | | | | | | | | | | | | | | | Summary: I recently added a new dynamic tag to our fork of LLVM and when adding it to llvm-readobj I noticed that not all DT_ values were being handled there. Using macros in a .def file that can be included by both ELFDumper.cpp and the ELF.h header ensures that the two don't get out of sync when new values are added. Reviewers: grimar, pcc, davide, espindola Reviewed By: grimar, espindola Subscribers: srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D44558 llvm-svn: 328099
* [llvm-mca] Clean up some code. NFCAndrea Di Biagio2018-03-212-15/+4
| | | | | | Removed a couple of methods from DispatchUnit. llvm-svn: 328094
* [llvm-readobj] - Teach llvm-readobj to dump .note.gnu.property sections.George Rimar2018-03-211-1/+52
| | | | | | | | | | | | NT_GNU_PROPERTY_TYPE_0 is a recently added type of .note.gnu.property section specified in Linux Extensions to gABI. (https://github.com/hjl-tools/linux-abi/wiki/Linux-Extensions-to-gABI) Patch teach tool to print such notes properly. Differential revision: https://reviews.llvm.org/D44469 llvm-svn: 328078
* For llvm-objdump and Mach-O files, fix the printing of module init andKevin Enderby2018-03-201-9/+43
| | | | | | | | | | | term sections from .o files to look to see if the pointers have a relocation entry and if so print the symbol name from the relocation entry. If not fall back to the existing code and use the pointer value to look up that value in the symbol table. rdar://38337506 llvm-svn: 328037
* [llvm-mca] add keyword override to a couple of methods in BackendStatistics.Andrea Di Biagio2018-03-201-2/+2
| | | | | | This should fix the buildbots after r328011. llvm-svn: 328029
* [llvm-objcopy] Revert r328012Alexander Shaposhnikov2018-03-202-120/+43
| | | | | | | Temporarily revert r328012 (since it broke down the big-endian bots), will resubmit an updated version later. llvm-svn: 328024
* [llvm-mca] Remove const from a bunch of ArrayRef. NFCAndrea Di Biagio2018-03-206-14/+14
| | | | llvm-svn: 328018
* Revert "Resubmit "Support embedding natvis files in PDBs.""Zachary Turner2018-03-204-35/+0
| | | | | | | | This is still failing on a different bot this time due to some issue related to hashing absolute paths. Reverting until I can figure it out. llvm-svn: 328014
* [llvm-objcopy] Implement support for section groupsAlexander Shaposhnikov2018-03-202-43/+120
| | | | | | | | | | | | | | | | | This diff adds support for SHT_GROUP sections to llvm-objcopy. Some sections are interrelated and comprise a group. For example, a definition of an inline function might require, in addition to the section containing its instructions, a read-only data section containing literals referenced inside the function. A section of the type SHT_GROUP contains the indices of the group members, therefore, it needs to be updated whenever the indices change. Similarly, the fields sh_link, sh_info should be recalculated as well. Test plan: make check-all Differential revision: https://reviews.llvm.org/D43996 llvm-svn: 328012
* [llvm-mca] Move the logic that computes the scheduler's queue usage to the ↵Andrea Di Biagio2018-03-207-59/+119
| | | | | | | | | | | | | | | | | | | | | | BackendStatistics view. This patch introduces two new callbacks in the event listener interface to handle the "buffered resource reserved" event and the "buffered resource released" event. Every time a buffered resource is used, an event is generated. Before this patch, the Scheduler (with the help of the ResourceManager) was responsible for tracking the scheduler's queue usage. However, that design forced the Scheduler to 'publish' scheduler's queue pressure information through the Backend interface. The goal of this patch is to break the dependency between the BackendStatistics view, and the Backend. Now the Scheduler knows how to notify "buffer reserved/released" events. The scheduler's queue usage analysis has been moved to the BackendStatistics. Differential Revision: https://reviews.llvm.org/D44686 llvm-svn: 328011
* Resubmit "Support embedding natvis files in PDBs."Zachary Turner2018-03-204-0/+35
| | | | | | | | | | | The issue causing this to fail in certain configurations should be fixed. It was due to the fact that DIA apparently expects there to be a null string at ID 1 in the string table. I'm not sure why this is important but it seems to make a difference, so set it. llvm-svn: 328002
* [llvm-mca] Use llvm::make_unique in a few places. NFCAndrea Di Biagio2018-03-204-23/+19
| | | | | | Also, clang-format a couple of DEBUG functions. llvm-svn: 327978
* [llvm-mca] Move the routine that computes processor resource masks to its ↵Andrea Di Biagio2018-03-209-89/+137
| | | | | | | | | | | | | | | | | | own file. Function computeProcResourceMasks is used by the ResourceManager (owned by the Scheduler) to compute resource masks for processor resources. Before this refactoring, there was an implicit dependency between the Scheduler and the InstrBuilder. That is because InstrBuilder has to know about resource masks when computing the set of processor resources consumed by a new instruction. With this patch, the functionality that computes resource masks has been extracted from the ResourceManager, and moved to a separate file (Support.h). This helps removing the dependency between the Scheduler and the InstrBuilder. No functional change intended. llvm-svn: 327973
* Revert "Support embedding natvis files in PDBs."Zachary Turner2018-03-194-35/+0
| | | | | | | This is causing a test failure on a certain bot, so I'm removing this temporarily until we can figure out the source of the error. llvm-svn: 327903
* Support embedding natvis files in PDBs.Zachary Turner2018-03-194-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | Natvis is a debug language supported by Visual Studio for specifying custom visualizers. The /NATVIS option is an undocumented link.exe flag which will take a .natvis file and "inject" it into the PDB. This way, you can ship the debug visualizers for a program along with the PDB, which is very useful for postmortem debugging. This is implemented by adding a new "named stream" to the PDB with a special name of /src/files/<natvis file name> and simply copying the contents of the xml into this file. Additionally, we need to emit a single stream named /src/headerblock which contains a hash table of embedded files to records describing them. This patch adds this functionality, including the /NATVIS option to lld-link. Differential Revision: https://reviews.llvm.org/D44328 llvm-svn: 327895
* [llvm-mca] Remove unused method from ResourceManager. NFCAndrea Di Biagio2018-03-191-2/+0
| | | | llvm-svn: 327888
* [llvm-mca] Simplify code. NFCAndrea Di Biagio2018-03-193-48/+51
| | | | llvm-svn: 327886
* [llvm-mca] Add pipeline stall events.Andrea Di Biagio2018-03-197-118/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a new class named HWStallEvent (see HWEventListener.h), and updates the event listener interface. A HWStallEvent represents a pipeline stall caused by the lack of hardware resources. Similarly to HWInstructionEvent, the event type is an unsigned, and the exact meaning depends on the subtarget. At the moment, HWStallEvent supports a few generic dispatch events. The main goals of this patch is to remove the logic that counts dispatch stalls from the DispatchUnit to the BackendStatistics view. Previously, DispatchUnit was responsible for counting and classifying dispatch stall events. With this patch, we delegate the task of counting and classifying stall events to the listeners (i.e. in our case, it is view "BackendStatistics"). So, the DispatchUnit doesn't have to do extra (unnecessary) bookkeeping. This patch also helps futher simplifying the Backend interface. Now class BackendStatistics no longer has to query the Backend interface to obtain the number of dispatch stalls. As a consequence, we can get rid of all the 'getNumXXX()' methods from class Backend. The long term goal is to remove all the remaining dependencies between the Backend and the BackendStatistics interface. Differential Revision: https://reviews.llvm.org/D44621 llvm-svn: 327837
* [llvm-mca] Allow the definition of multiple register files.Andrea Di Biagio2018-03-182-100/+249
| | | | | | | | | | | | | | | | | | | | This is a refactoring in preparation for other two changes that will allow scheduling models to define multiple register files. This is the first step towards fixing PR36662. class RegisterFile (in Dispatch.h) now can emulate multiple register files. Internally, it tracks the number of available physical registers in each register file (described by class RegisterFileInfo). Each register file is associated to a list of MCRegisterClass indices. Knowing the register class indices allows to map physical registers to register files. The long term goal is to allow processor models to optionally specify how many register files are implemented via tablegen. Differential Revision: https://reviews.llvm.org/D44488 llvm-svn: 327798
* [dsymutil] Fix add_llvm_tool_symlinkJonas Devlieghere2018-03-181-1/+1
| | | | | | | Update the arguments to add_llvm_tool_symlink to symlink llvm-dsymutil to dsymutil. llvm-svn: 327792
* [dsymutil] Rename llvm-dsymutil -> dsymutilJonas Devlieghere2018-03-183-9/+8
| | | | | | | | | | | Now that almost all functionality of Apple's dsymutil has been upstreamed, the open source variant can be used as a drop in replacement. Hence we feel it's no longer necessary to have the llvm prefix. Differential revision: https://reviews.llvm.org/D44527 llvm-svn: 327790
* [llvm-mca] Remove method getSchedModel() from the Backend.Andrea Di Biagio2018-03-163-7/+7
| | | | llvm-svn: 327756
* [llvm-mca] Remove unused methods from Backend. NFCAndrea Di Biagio2018-03-161-17/+0
| | | | llvm-svn: 327749
* Refactor the PDB HashTable class.Zachary Turner2018-03-151-1/+1
| | | | | | | | | It previously only worked when the key and value types were both 4 byte integers. We now have a use case for a non trivial value type, so we need to extend it to support arbitrary value types, which means templatizing it. llvm-svn: 327647
* [llvm-mca] Simplify code. NFC.Andrea Di Biagio2018-03-153-5/+7
| | | | | | | | Now both method DispatchUnit::checkRAT() and DispatchUnit::canDispatch take as input an Instruction refrence instead of an instruction descriptor. This was requested by Simon in D44488 to simplify the diff. llvm-svn: 327640
* [ORC] Re-apply r327566 with a fix for test-global-ctors.ll.Lang Hames2018-03-152-22/+21
| | | | | | Also clang-formats the patch, which I should have done the first time around. llvm-svn: 327594
* Revert "[ORC] Switch from shared_ptr to unique_ptr for addModule methods."Reid Kleckner2018-03-142-7/+7
| | | | | | | | | | | | | This reverts commit r327566, it breaks test/ExecutionEngine/OrcMCJIT/test-global-ctors.ll. The test doesn't crash with a stack trace, unfortunately. It merely returns 1 as the exit code. ASan didn't produce a report, and I reproduced this on my Linux machine and Windows box. llvm-svn: 327576
* [ORC] Switch from shared_ptr to unique_ptr for addModule methods.Lang Hames2018-03-142-7/+7
| | | | | | | Layer implementations typically mutate module state, and this is better reflected by having layers own the Module they are operating on. llvm-svn: 327566
* [WebAssembly] Identify COMDATs by index rather than string. NFCNicholas Wilson2018-03-141-10/+6
| | | | | | | | This will enable an optimisation in LLD. Differential Revision: https://reviews.llvm.org/D44343 llvm-svn: 327522
* [llvm-mca] Remove unused variable from InstrBuilder.cpp. NFCAndrea Di Biagio2018-03-141-1/+0
| | | | | | This was causing a buildbot failure. llvm-svn: 327517
* [llvm-mca] Move the logic that updates the register files from InstrBuilder ↵Andrea Di Biagio2018-03-146-58/+65
| | | | | | | | | | | | | | | | | | | to DispatchUnit. NFCI Before this patch, the register file was always updated at instruction creation time. That means, new read-after-write dependencies, and new temporary registers were allocated at instruction creation time. This patch refactors the code in InstrBuilder, and move all the logic that updates the register file into the dispatch unit. We only want to update the register file when instructions are effectively dispatched (not before). This refactoring also helps removing a bad dependency between the InstrBuilder and the DispatchUnit. No functional change intended. llvm-svn: 327514
* [mips] Add support for CRC ASEPetar Jovanovic2018-03-141-1/+2
| | | | | | | | | | | | | | | | | | | This includes Instructions: crc32b, crc32h, crc32w, crc32d, crc32cb, crc32ch, crc32cw, crc32cd Assembler directives: .set crc, .set nocrc, .module crc, .module nocrc Attribute: crc .MIPS.abiflags: CRC (0x8000) Patch by Vladimir Stefanovic. Differential Revision: https://reviews.llvm.org/D44176 llvm-svn: 327511
* [LTO/gold] Fix workaround for old plugin-api.h in --wrap supportTeresa Johnson2018-03-141-1/+1
| | | | | | | | | | | | The workaround for older plugin-api.h in r327506 unfortunately used another union member that is also fairly new and not available in the plugin-api.h on some of the bots, leading to: http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/9121/steps/build-stage2-LLVMgold.so/logs/stdio Change to use a different member that we will definitely have (as it is used elsewhere in gold-plugin.cpp already). llvm-svn: 327509
* [LTO/gold] Support --wrapTeresa Johnson2018-03-141-0/+48
| | | | | | | | | | | | | | | | | | | | Summary: (Restores r327459 with handling for old plugin-api.h) Utilize new gold plugin api interface for obtaining --wrap option arguments, and LTO API handling (added for --wrap support in lld LTO), to mark symbols so that LTO does not optimize them inappropriately. Note the test cases will be in a new gold test subdirectory that is dependent on the next release of gold which will contain the new interfaces. Reviewers: pcc, tmsriram Subscribers: mehdi_amini, llvm-commits, inglorion Differential Revision: https://reviews.llvm.org/D44235 llvm-svn: 327506
* DWARF: Unify form size handling codePavel Labath2018-03-141-1/+1
| | | | | | | | | | | | | | | | | Summary: This patch replaces the two switches which are deducing the size of various forms with a single implementation. I have put the new implementation into BinaryFormat, to avoid introducing dependencies between the two independent libraries (DebugInfo and CodeGen) that need this functionality. Reviewers: aprantl, JDevlieghere, dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44418 llvm-svn: 327486
* [dsymutil] Print architecture in warningJonas Devlieghere2018-03-141-11/+17
| | | | | | | Make the architecture part of the warning in the DebugMapParser. This makes things consistent with the Apple's internal version of dsymutil. llvm-svn: 327485
* [LLVM-C] Redo unnamed_address attribute bindingsRobert Widmann2018-03-141-1/+1
| | | | | | | | | | | | | | | | | | | Summary: The old bindings should have used an enum instead of a boolean. This deprecates LLVMHasUnnamedAddr and LLVMSetUnnamedAddr , replacing them with LLVMGetUnnamedAddress and LLVMSetUnnamedAddress respectively that do. Though it is unlikely LLVM will gain more supported global value linker hints, the new API can scale to accommodate this. Reviewers: deadalnix, whitequark Reviewed By: whitequark Subscribers: llvm-commits, harlanhaskins Differential Revision: https://reviews.llvm.org/D43448 llvm-svn: 327479
* Revert "[LTO/gold] Support --wrap"Teresa Johnson2018-03-131-35/+0
| | | | | | | | This reverts commit r327459. The new gold plugin interface is not available with older gold installations, leading to compile failures: http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/9109/steps/build-stage2-LLVMgold.so/logs/stdio llvm-svn: 327465
* [LTO/gold] Support --wrapTeresa Johnson2018-03-131-0/+35
| | | | | | | | | | | | | | | | | | | Summary: Utilize new gold plugin api interface for obtaining --wrap option arguments, and LTO API handling (added for --wrap support in lld LTO), to mark symbols so that LTO does not optimize them inappropriately. Note the test cases will be in a new gold test subdirectory that is dependent on the next release of gold which will contain the new interfaces. Reviewers: pcc, tmsriram Subscribers: mehdi_amini, llvm-commits, inglorion Differential Revision: https://reviews.llvm.org/D44235 llvm-svn: 327459
* [PDB] Support dumping injected sources via the DIA reader.Zachary Turner2018-03-131-0/+78
| | | | | | | | | | | | | | | | | | Injected sources are basically a way to add actual source file content to your PDB. Presumably you could use this for shipping your source code with your debug information, but in practice I can only find this being used for embedding natvis files inside of PDBs. In order to effectively test LLVM's natvis file injection, we need a way to dump the injected sources of a PDB in a way that is authoritative (i.e. based on Microsoft's understanding of the PDB format, and not LLVM's). To this end, I've added support for dumping injected sources via DIA. I made a PDB file that used the /natvis option to generate a test case. Differential Revision: https://reviews.llvm.org/D44405 llvm-svn: 327428
OpenPOWER on IntegriCloud