summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* [ThinLTO] Move loading of cache entry to clientTeresa Johnson2016-08-262-6/+11
| | | | | | | | | | | | | | | | | | | | | | Summary: Have the cache pass back the path to the cache entry when it is ready to be loaded, instead of a buffer. For gold-plugin we can simply pass this file back to gold directly, which avoids expensive writing of a separate tmp file. Ensure the cache entry is not deleted on cleanup by adjusting the setting of the IsTemporary flags. Moved the loading of the buffer into llvm-lto2 to maintain current behavior. Reviewers: mehdi_amini Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23946 llvm-svn: 279883
* llvm-objdump: ELF: Handle code and data mix in all scenariosHemant Kulkarni2016-08-251-11/+94
| | | | | | Differential Revision: https://reviews.llvm.org/D23621 llvm-svn: 279770
* [ThinLTO/gold] Add caching support to gold-pluginTeresa Johnson2016-08-241-2/+14
| | | | | | | | | | | | | | Summary: With support now in the new LTO API for caching (r279576), add optional ThinLTO caching in the gold-plugin. Reviewers: mehdi_amini Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D23836 llvm-svn: 279631
* [llvm-cov] Add the project summary to each source file coverage report.Ying Yi2016-08-248-36/+194
| | | | | | | | | | | | This patch includes the following changes: - Included header "Code coverage report" and include the date that the report was created. - Included title (as specified in a command line option, (i.e llvm-cov -project-title="Simple Test") - In the summary, list the elf files that the source code file has contributed to. - Used column heading for "Line No.", "Count No.", Source". Differential Revision: https://reviews.llvm.org/D23345 llvm-svn: 279628
* CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePassesMatthias Braun2016-08-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | Re-apply this patch, hopefully I will get away without any warnings in the constructor now. This patch removes the MachineFunctionAnalysis. Instead we keep a map from IR Function to MachineFunction in the MachineModuleInfo. This allows the insertion of ModulePasses into the codegen pipeline without breaking it because the MachineFunctionAnalysis gets dropped before a module pass. Peak memory should stay unchanged without a ModulePass in the codegen pipeline: Previously the MachineFunction was freed at the end of a codegen function pipeline because the MachineFunctionAnalysis was dropped; With this patch the MachineFunction is freed after the AsmPrinter has finished. Differential Revision: http://reviews.llvm.org/D23736 llvm-svn: 279602
* MachineModuleInfo: Avoid dummy constructor, use INITIALIZE_TM_PASSMatthias Braun2016-08-241-1/+1
| | | | | | | | | | | Change this pass constructor to just accept a const TargetMachine * and use INITIALIZE_TM_PASS, that way we can get rid of the dummy constructor. The pass will still fail when calling the default constructor leading to TM == nullptr, this is no different than before but is more in line what other codegen passes are doing and avoids the dummy constructor. llvm-svn: 279598
* Revert r279564. It introduces undefined behavior (binding a reference to aRichard Smith2016-08-231-1/+2
| | | | | | | dereferenced null pointer) in MachineModuleInfo::MachineModuleInfo that causes -Werror builds (including several buildbots) to fail. llvm-svn: 279580
* [ThinLTO] Add caching to the new LTO APIMehdi Amini2016-08-231-2/+13
| | | | | | | | | | | | Add the ability to plug a cache on the LTO API. I tried to write such that a linker implementation can control the cache backend. This is intrusive and I'm not totally happy with it, but I can't figure out a better design right now. Differential Revision: https://reviews.llvm.org/D23599 llvm-svn: 279576
* CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePassesMatthias Braun2016-08-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | Re-apply this commit with the deletion of a MachineFunction delegated to a separate pass to avoid use after free when doing this directly in AsmPrinter. This patch removes the MachineFunctionAnalysis. Instead we keep a map from IR Function to MachineFunction in the MachineModuleInfo. This allows the insertion of ModulePasses into the codegen pipeline without breaking it because the MachineFunctionAnalysis gets dropped before a module pass. Peak memory should stay unchanged without a ModulePass in the codegen pipeline: Previously the MachineFunction was freed at the end of a codegen function pipeline because the MachineFunctionAnalysis was dropped; With this patch the MachineFunction is freed after the AsmPrinter has finished. Differential Revision: http://reviews.llvm.org/D23736 llvm-svn: 279564
* Revert "(HEAD -> master, origin/master, origin/HEAD) CodeGen: Remove ↵Matthias Braun2016-08-231-1/+2
| | | | | | | | | | MachineFunctionAnalysis => Enable (Machine)ModulePasses" Reverting while tracking down a use after free. This reverts commit r279502. llvm-svn: 279503
* CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePassesMatthias Braun2016-08-231-2/+1
| | | | | | | | | | | | | | | | | | | This patch removes the MachineFunctionAnalysis. Instead we keep a map from IR Function to MachineFunction in the MachineModuleInfo. This allows the insertion of ModulePasses into the codegen pipeline without breaking it because the MachineFunctionAnalysis gets dropped before a module pass. Peak memory should stay unchanged without a ModulePass in the codegen pipeline: Previously the MachineFunction was freed at the end of a codegen function pipeline because the MachineFunctionAnalysis was dropped; With this patch the MachineFunction is freed after the AsmPrinter has finished. Differential Revision: http://reviews.llvm.org/D23736 llvm-svn: 279502
* Fix Gold Plugin after API change in the LTO API (constify callback type)Mehdi Amini2016-08-221-2/+2
| | | | llvm-svn: 279440
* [LTO] Handles commons in monolithic LTOMehdi Amini2016-08-221-58/+1
| | | | | | | | | The gold-plugin was doing this internally, now the API is handling commons correctly based on the given resolution. Differential Revision: https://reviews.llvm.org/D23739 llvm-svn: 279417
* [gold/ThinLTO] Restore ThinLTO file management in gold pluginTeresa Johnson2016-08-201-1/+10
| | | | | | | | | | | | | | | | | | Summary: The gold-plugin changes added along with the new LTO API in r278338 had the effect of removing the management of the PluginInputFile that ensured the files weren't released back to gold until the backend threads were complete. Add back the old file handling. Fixes PR29020. Reviewers: mehdi_amini Subscribers: mehdi_amini, llvm-commits, hjl.tools Differential Revision: https://reviews.llvm.org/D23721 llvm-svn: 279356
* [LTO] Add the ability to test -thinlto-emit-imports-files through llvm-lto2Mehdi Amini2016-08-191-1/+15
| | | | | | | | | | | | | | Summary: Start bringing llvm-lto2 to a level where we can test the LTO API a bit deeper. Reviewers: tejohnson Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23681 llvm-svn: 279349
* llvm-objdump: Add Hexagon printer changes for -S/-l optionsHemant Kulkarni2016-08-181-0/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D23521 llvm-svn: 279161
* [CMake] Minor fix to regex in r279152Chris Bieneman2016-08-181-1/+1
| | | | | | The third version component is optional in Xcode's version spew, so we need to make it optional in the regex. llvm-svn: 279153
* [CMake] Support for generating Xcode 8 compatible toolchainsChris Bieneman2016-08-181-1/+30
| | | | | | Xcode 8 requires toolchain compatibility version 2. This allows us to select the correct compatibility version based on the installed version of Xcode. llvm-svn: 279152
* Resubmit "Write the TPI stream from a PDB to Yaml."Zachary Turner2016-08-189-10/+678
| | | | | | | | The original patch was breaking some buildbots due to an incorrect ordering of function definitions which caused some compilers to recognize a definition but others to not. llvm-svn: 279089
* llvm-objdump: add coff import library symbol listing supportSaleem Abdulrasool2016-08-183-0/+43
| | | | | | | | | | This adds behaviour similar to binutils' objdump which can show symbols in an import library. Differences from that stem around the fact that we do not create section symbols nor the all import import descriptor symbol reference. However, this does mean that the tool can serve as a possible replacement for the existing tool. llvm-svn: 279088
* llvm-readobj: handle import libraries with -coff-exportsSaleem Abdulrasool2016-08-181-0/+2
| | | | | | | | `link -dump -exports` lists exported symbols from import libraries as well as normal dlls. Ensure that we can handle import libraries as well in llvm-readobj. llvm-svn: 279069
* [ThinLTO] Keep common symbols in ThinLTO modulesTeresa Johnson2016-08-181-1/+4
| | | | | | | | | | | | | | | | | | | | Summary: Skip the merging of common symbols for ThinLTO modules, they will be merged by the final native object link. Trying to merge the symbols and add to a combined module will incorrectly enable the common symbol to be internalized in the ThinLTO module. Additionally, we will not want to create a combined module for ThinLTO distributed builds. This fixes failures in 7 cpu2006 benchmarks from the new LTO API in ThinLTO mode. Reviewers: mehdi_amini Subscribers: pcc, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23637 llvm-svn: 279023
* [LTO] Change addSaveTemps API: do not add dot to the supplied prefix pathMehdi Amini2016-08-182-2/+4
| | | | | | | | | | | | | | | | Summary: It does not play well with directories (end up with a bunch of hidden files). Also, do not strip the 0 suffix for the first task, especially since 0 can be used by ThinLTO as well now. Reviewers: tejohnson Subscribers: mehdi_amini, pcc, llvm-commits Differential Revision: https://reviews.llvm.org/D23612 llvm-svn: 279014
* Make llvm-pdbdump print column info when availableAdrian McCarthy2016-08-171-0/+9
| | | | | | | | | | llvm-pdbdump already had code to retrieve column information in the line tables, but it wasn't using it. Most Microsoft PDBs don't seem to have column info, so this wasn't missed. But Clang includes column info by default (at least for now), and being able to see that is useful for ensuring we get the column info correct. Differential Revision: https://reviews.llvm.org/D23629 llvm-svn: 279001
* Replace a few more "fall through" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-172-2/+2
| | | | | | Follow up to r278902. I had missed "fall through", with a space. llvm-svn: 278970
* [AMDGPU] llvm-objdump: Skip amd_kernel_code_t only at the begining of kernel ↵Sam Kolton2016-08-171-20/+47
| | | | | | | | | | | | | | symbol. Summary: This change fix bug in AMDGPU disassembly. Previously, presence of symbols other than kernel symbols caused objdump to skip begining of those symbols. Reviewers: tstellarAMD, vpykhtin, Bigcheese, ruiu Subscribers: kzhuravl, arsenm Differential Revision: http://reviews.llvm.org/D21966 llvm-svn: 278921
* [LTO] Fix a use-after-free introduced in r278907 and caught by ASan.Chandler Carruth2016-08-171-3/+3
| | | | | | | | | The ASan build bot caught this right away: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/15580/steps/check-llvm%20asan/logs/stdio This was also breaking a Windows build bot I'm pretty sure. llvm-svn: 278912
* [LTO] Introduce an Output class to wrap the output stream creation (NFC)Mehdi Amini2016-08-172-26/+50
| | | | | | | | | | | | | | | | | Summary: While NFC for now, this will allow more flexibility on the client side to hold state necessary to back up the stream. Also when adding caching, this class will grow in complexity. Note I blindly modified the gold-plugin as I can't compile it. Reviewers: tejohnson Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D23542 llvm-svn: 278907
* Replace "fallthrough" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-172-2/+2
| | | | | | | This is a mechanical change of comments in switches like fallthrough, fall-through, or fall-thru to use the LLVM_FALLTHROUGH macro instead. llvm-svn: 278902
* [PM] Port the always inliner to the new pass manager in a much moreChandler Carruth2016-08-172-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | minimal and boring form than the old pass manager's version. This pass does the very minimal amount of work necessary to inline functions declared as always-inline. It doesn't support a wide array of things that the legacy pass manager did support, but is alse ... about 20 lines of code. So it has that going for it. Notably things this doesn't support: - Array alloca merging - To support the above, bottom-up inlining with careful history tracking and call graph updates - DCE of the functions that become dead after this inlining. - Inlining through call instructions with the always_inline attribute. Instead, it focuses on inlining functions with that attribute. The first I've omitted because I'm hoping to just turn it off for the primary pass manager. If that doesn't pan out, I can add it here but it will be reasonably expensive to do so. The second should really be handled by running global-dce after the inliner. I don't want to re-implement the non-trivial logic necessary to do comdat-correct DCE of functions. This means the -O0 pipeline will have to be at least 'always-inline,global-dce', but that seems reasonable to me. If others are seriously worried about this I'd like to hear about it and understand why. Again, this is all solveable by factoring that logic into a utility and calling it here, but I'd like to wait to do that until there is a clear reason why the existing pass-based factoring won't work. The final point is a serious one. I can fairly easily add support for this, but it seems both costly and a confusing construct for the use case of the always inliner running at -O0. This attribute can of course still impact the normal inliner easily (although I find that a questionable re-use of the same attribute). I've started a discussion to sort out what semantics we want here and based on that can figure out if it makes sense ta have this complexity at O0 or not. One other advantage of this design is that it should be quite a bit faster due to checking for whether the function is a viable candidate for inlining exactly once per function instead of doing it for each call site. Anyways, hopefully a reasonable starting point for this pass. Differential Revision: https://reviews.llvm.org/D23299 llvm-svn: 278896
* Revert "Write the TPI stream from a PDB to Yaml."Justin Bogner2016-08-169-678/+10
| | | | | | | | | This is hitting a "use of undeclared identifier 'skipPadding' error locally and on some bots. This reverts r278869. llvm-svn: 278871
* Write the TPI stream from a PDB to Yaml.Zachary Turner2016-08-169-10/+678
| | | | | | | Reviewed By: ruiu, rnk Differential Revision: https://reviews.llvm.org/D23226 llvm-svn: 278869
* [ThinLTO] Fix temp file dumping, enable via llvm-lto and test itTeresa Johnson2016-08-151-0/+7
| | | | | | | | | | | | | | | | | | | Summary: Fixed a bug in ThinLTOCodeGenerator's temp file dumping. The Twine needs to be passed directly as an argument, or a copy saved into a std::string. It doesn't seem there are any consumers of this, so I added a new option to llvm-lto to enable saving of temp files during ThinLTO, and augmented a test to use it to check post-import but pre-opt bitcode. Reviewers: mehdi_amini Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23525 llvm-svn: 278761
* llvm-objdump: Implement source[line numbers] interleavingHemant Kulkarni2016-08-152-15/+113
| | | | | | Differential Revsion: https://reviews.llvm.org/D22932 llvm-svn: 278725
* Revert "gold: add a cast to appease std::max NFC"Saleem Abdulrasool2016-08-141-2/+1
| | | | | | This was fixed differently by Teresa and this should no longer be needed. llvm-svn: 278622
* gold: add a cast to appease std::max NFCSaleem Abdulrasool2016-08-121-1/+2
| | | | llvm-svn: 278567
* [sancov] MachO indirect symbols support.Mike Aizatsky2016-08-121-8/+56
| | | | | | Differential Revision: https://reviews.llvm.org/D23338 llvm-svn: 278551
* [PM] Port ModuleSummaryIndex analysis to new pass managerTeresa Johnson2016-08-123-5/+8
| | | | | | | | | | | | | | | | | | | Summary: Port the ModuleSummaryAnalysisWrapperPass to the new pass manager. Use it in the ported BitcodeWriterPass (similar to how we use the legacy ModuleSummaryAnalysisWrapperPass in the legacy WriteBitcodePass). Also, pass the -module-summary opt flag through to the new pass manager pipeline and through to the bitcode writer pass, and add a test that uses it. Reviewers: mehdi_amini Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23439 llvm-svn: 278508
* Use the range variant of transform instead of unpacking begin/endDavid Majnemer2016-08-121-3/+3
| | | | | | No functionality change is intended. llvm-svn: 278477
* Use the range variant of find/find_if instead of unpacking begin/endDavid Majnemer2016-08-122-15/+14
| | | | | | | | | If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278469
* Use the range variant of find_if instead of unpacking begin/endDavid Majnemer2016-08-122-19/+14
| | | | | | No functionality change is intended. llvm-svn: 278443
* Use the range variant of find instead of unpacking begin/endDavid Majnemer2016-08-113-10/+5
| | | | | | | | | If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278433
* Add (hopefully last) remaining missing dependences to llvm-lto2Teresa Johnson2016-08-112-1/+3
| | | | | | | | | | There are still a few missing symbols reported by: http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15535/steps/build_llvmclang/logs/stdio http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15535/steps/build_llvmclang/logs/stdio This should hopefully take care of them. llvm-svn: 278353
* More missing llvm-lto2 dependenciesTeresa Johnson2016-08-111-0/+2
| | | | | | Follow-on to r278341: Update CMakeLists.txt to match LLVMBuild.txt llvm-svn: 278349
* Fix bot failure from r278338 due to missing dependencesTeresa Johnson2016-08-111-1/+1
| | | | | | | | Add some missing dependences to the llvm-lto2 tool to attempt to appease missing symbols in link from bot: http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/15527 llvm-svn: 278341
* Restore "Resolution-based LTO API."Teresa Johnson2016-08-114-944/+427
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This restores commit r278330, with fixes for a few bot failures: - Fix a late change I had made to the save temps output file that I missed due to existing files sitting on my disk - Fix a bunch of Windows bot failures with "ambiguous call to overloaded function" due to confusion between llvm::make_unique vs std::make_unique (preface the new make_unique calls with "llvm::") - Attempt to fix a modules bot failure by adding a missing include to LTO/Config.h. Original change: Resolution-based LTO API. Summary: This introduces a resolution-based LTO API. The main advantage of this API over existing APIs is that it allows the linker to supply a resolution for each symbol in each object, rather than the combined object as a whole. This will become increasingly important for use cases such as ThinLTO which require us to process symbol resolutions in a more complicated way than just adjusting linkage. Patch by Peter Collingbourne. Reviewers: rafael, tejohnson, mehdi_amini Subscribers: lhames, tejohnson, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D20268 llvm-svn: 278338
* Revert "Resolution-based LTO API."Teresa Johnson2016-08-114-427/+944
| | | | | | | | | | This reverts commit r278330. I made a change to the save temps output that is causing issues with the bots. Didn't realize this because I had older output files sitting on disk in my test output directory. llvm-svn: 278331
* Resolution-based LTO API.Teresa Johnson2016-08-114-944/+427
| | | | | | | | | | | | | | | | | | | | | | Summary: This introduces a resolution-based LTO API. The main advantage of this API over existing APIs is that it allows the linker to supply a resolution for each symbol in each object, rather than the combined object as a whole. This will become increasingly important for use cases such as ThinLTO which require us to process symbol resolutions in a more complicated way than just adjusting linkage. Patch by Peter Collingbourne. Reviewers: rafael, tejohnson, mehdi_amini Subscribers: lhames, tejohnson, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D20268 Address review comments llvm-svn: 278330
* [sancov] Port sancov -print-coverage-pcs to COFFReid Kleckner2016-08-101-5/+26
| | | | | | | | | | | The export table is not considered part of the object file symbol table, so we have to look through it separately. Reviewers: kcc Differential Revision: https://reviews.llvm.org/D23321 llvm-svn: 278284
* [llvm-cov] Swapped the line and count columns.Ying Yi2016-08-091-2/+2
| | | | | | | | | In the coverage report, the line and count columns have been swapped to make it more readable. A follow-up commit in compiler-rt is needed Differential Revision: https://reviews.llvm.org/D23281 llvm-svn: 278152
OpenPOWER on IntegriCloud