summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [gold] Emit a diagnostic in case we fail to remove a file.Davide Italiano2016-03-201-2/+6
| | | | llvm-svn: 263914
* Expose IRBuilder::CreateAtomicCmpXchg as LLVMBuildAtomicCmpXchg in the C API.Mehdi Amini2016-03-191-0/+11
| | | | | | | | | | | | | Summary: Also expose getters and setters in the C API, so that the change can be tested. Reviewers: nhaehnle, axw, joker.eph Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18260 From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> llvm-svn: 263886
* Const-correctness in libLTOMehdi Amini2016-03-191-1/+1
| | | | | | | | Looks like I was sloppy when bridging to C. Thanks D. Blaikie for noticing! From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263885
* Add a dependency from llvm-link to TransformUtils following r263860Mehdi Amini2016-03-192-1/+2
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263873
* [gold] Use early return to simplify.Davide Italiano2016-03-191-10/+5
| | | | llvm-svn: 263872
* Fix a const_cast related warning in GCC in the C API for libLTOMehdi Amini2016-03-191-1/+1
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263870
* Rework linkInModule(), making it oblivious to ThinLTOMehdi Amini2016-03-191-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | Summary: ThinLTO is relying on linkInModule to import selected function. However a lot of "magic" was hidden in linkInModule and the IRMover, who would rename and promote global variables on the fly. This is moving to an approach where the steps are decoupled and the client is reponsible to specify the list of globals to import. As a consequence some test are changed because they were relying on the previous behavior which was importing the definition of *every* single global without control on the client side. Now the burden is on the client to decide if a global has to be imported or not. Reviewers: tejohnson Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D18122 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263863
* Add a test for r263577: "Add missing error handling in llvm-lto"Mehdi Amini2016-03-191-1/+1
| | | | | | | | On Rafael's suggestion! (also fix a discrepancy between this error message format and the others) From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263860
* [sancov] typo fixMike Aizatsky2016-03-181-2/+2
| | | | llvm-svn: 263849
* [sancov] reformat & 1 clang-tidy warning.Mike Aizatsky2016-03-181-40/+40
| | | | llvm-svn: 263846
* [obj2yaml, COFF] Assert that the alignment is not bogusDavid Majnemer2016-03-181-0/+1
| | | | llvm-svn: 263839
* [llvm-objdump] Print <unknown> in place of instruction text if it couldn't ↵Colin LeMahieu2016-03-181-64/+69
| | | | | | be disassembled. llvm-svn: 263793
* Always cache resolved paths as it even saves on StringMap lookups.Pete Cooper2016-03-181-4/+2
| | | | | | | | | | | Now that the resolved path cache stores the StringRef's, its best to just always cache the results, even when realpath isn't used. This way we'll still avoid the StringMap hashing and lookup. This also conveniently reorganises this code in a way I need for a future patch. llvm-svn: 263777
* Use StringRef's in resolved path cache to avoid extra internString lookups. ↵Pete Cooper2016-03-181-11/+16
| | | | | | | | | | | | | | | | NFC. ResolvedPaths was storing std::string's as a cache. We would then take those strings and look them up in the internString pool to get a unique StringRef for each path. This patch changes ResolvedPaths to store the StringRef pointing in to the internString pool itself. This way, when getResolvedPath returns a string, we know we have the StringRef we would find in the pool anyway. We can avoid the duplicate memory of the std::string's, and also the time from the lookup. Unfortunately my profiles show no runtime change here, but it should still save memory allocations which is nice. Reviewed by Frederic Riss. Differential Revision: http://reviews.llvm.org/D18259 llvm-svn: 263774
* [sancov] html report: replacing uncovered functions with function coverage % ↵Mike Aizatsky2016-03-181-44/+69
| | | | | | | | table. Differential Revision: http://reviews.llvm.org/D18256 llvm-svn: 263767
* [llvm-objdump] Add '0x' prefix to a target displacement number to accent its ↵Simon Atanasyan2016-03-171-1/+1
| | | | | | | | | | | hex format It might be hard to recognize a hexadecimal number without '0x' prefix. Besides that '0x' prefix corresponds to GNU objdump behaviour. Differential Revision: http://reviews.llvm.org/D18207 llvm-svn: 263705
* [yaml2obj, COFF] Correctly handle section alignmentDavid Majnemer2016-03-171-2/+12
| | | | | | | | | The section alignment field was marked optional but not provided a default value: initialize it with 0. While we are here, ensure that the section alignment is plausible. llvm-svn: 263692
* llvm-bcanalyzer: Fix handling of attribute group entriesJustin Bogner2016-03-151-0/+4
| | | | | | | These were printing as "UnknownCode3", since we were looking for them inside PARAMATTR blocks instead of PARAMATTR_GROUP blocks. llvm-svn: 263597
* Add missing error handling in llvm-ltoMehdi Amini2016-03-151-0/+1
| | | | | | | | | Annoyingly, ErrorOr allows to *not check* the error when things go well. It will crash badly when there is an error though. It should runtime assert when it is used without being checked! From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263577
* [llvm-readobj] Impl GNU style printing of sections and relocationsHemant Kulkarni2016-03-153-269/+646
| | | | | | Differential Revision: http://reviews.llvm.org/D17523 llvm-svn: 263561
* [llvm-objdump] Add support for dumping the PE TLS directoryDavid Majnemer2016-03-151-0/+51
| | | | | | | | The PE TLS directory contains information about where the TLS data resides in the image, what functions should be executed when threads are created, etc. llvm-svn: 263537
* [MachO] Add MachO alt-entry directive support.Lang Hames2016-03-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the MachO .alt_entry assembly directive, and uses it for global aliases with non-zero GEP offsets. The alt_entry flag indicates that a symbol should be layed out immediately after the preceding symbol. Conceptually it introduces an alternate entry point for a function or data structure. E.g.: safe_foo: // check preconditions for foo .alt_entry fast_foo fast_foo: // body of foo, can assume preconditions. The .alt_entry flag is also implicitly set on assembly aliases of the form: a = b + C where C is a non-zero constant, since these have the same effect as an alt_entry symbol: they introduce a label that cannot be moved relative to the preceding one. Setting the alt_entry flag on aliases of this form fixes http://llvm.org/PR25381. llvm-svn: 263521
* [ThinLTO] Renaming of function index to module summary index (NFC)Teresa Johnson2016-03-154-55/+56
| | | | | | | | | | | | | | | (Resubmitting after fixing missing file issue) With the changes in r263275, there are now more than just functions in the summary. Completed the renaming of data structures (started in r263275) to reflect the wider scope. In particular, changed the FunctionIndex* data structures to ModuleIndex*, and renamed related variables and comments. Also renamed the files to reflect the changes. A companion clang patch will immediately succeed this patch to reflect this renaming. llvm-svn: 263513
* llvm-shlib: Remove the option to override __cxa_atexitJustin Bogner2016-03-141-7/+0
| | | | | | | | | | | | | | If anybody is actually using this, it probably doesn't do what they think it does. This actually causes the dylib to *export* a __cxa_atexit symbol, so anything that links it probably loses their exit time destructors as well as disabling LLVM's. This just removes the option entirely. If somebody does need this behaviour we should figure out a more principled way to do it. This is effectively a revert of r223805. llvm-svn: 263498
* llvm-config: fix --libs on LinuxReid Kleckner2016-03-141-7/+9
| | | | | | | | | | | | | | | | | | | | Summary: llvm-config --libs does not produce correct output since commit r260263 (llvm-config: Add preliminary Windows support) changed naming format of the libraries. This patch updates llvm-config to recognize new naming format and output correct linker flags. Ref: https://llvm.org/bugs/show_bug.cgi?id=26581 Patch by Vedran Miletić Reviewers: ehsan, rnk, pxli168 Subscribers: pxli168 Differential Revision: http://reviews.llvm.org/D17300 llvm-svn: 263497
* Revert "[ThinLTO] Renaming of function index to module summary index (NFC)"Teresa Johnson2016-03-144-56/+55
| | | | | | This reverts commit r263490. Missed a file. llvm-svn: 263493
* [ThinLTO] Renaming of function index to module summary index (NFC)Teresa Johnson2016-03-144-55/+56
| | | | | | | | | | | | | With the changes in r263275, there are now more than just functions in the summary. Completed the renaming of data structures (started in r263275) to reflect the wider scope. In particular, changed the FunctionIndex* data structures to ModuleIndex*, and renamed related variables and comments. Also renamed the files to reflect the changes. A companion clang patch will immediately succeed this patch to reflect this renaming. llvm-svn: 263490
* Add echo test for constant data arrays in the LLVM C APIAmaury Sechet2016-03-131-0/+10
| | | | llvm-svn: 263350
* [sancov] using md5 for anchors in attempt to reduce file size.Mike Aizatsky2016-03-111-6/+18
| | | | | | Differential Revision: http://reviews.llvm.org/D18102 llvm-svn: 263308
* Don't crash sancov if file is unreadable.Mike Aizatsky2016-03-111-6/+10
| | | | | | | | | | | | | | | Summary: Caller can provides the list of .so files where some files are unreadable (e.g linux-vdso.so.1). It's more convenient to handler this in sancov with warning then making all callers to check files. Reviewers: aizatsky Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18103 llvm-svn: 263307
* [ThinLTO] Support for reference graph in per-module and combined summary.Teresa Johnson2016-03-113-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds support for including a full reference graph including call graph edges and other GV references in the summary. The reference graph edges can be used to make importing decisions without materializing any source modules, can be used in the plugin to make file staging decisions for distributed build systems, and is expected to have other uses. The call graph edges are recorded in each function summary in the bitcode via a list of <CalleeValueIds, StaticCount> tuples when no PGO data exists, or <CalleeValueId, StaticCount, ProfileCount> pairs when there is PGO, where the ValueId can be mapped to the function GUID via the ValueSymbolTable. In the function index in memory, the call graph edges reference the target via the CalleeGUID instead of the CalleeValueId. The reference graph edges are recorded in each summary record with a list of referenced value IDs, which can be mapped to value GUID via the ValueSymbolTable. Addtionally, a new summary record type is added to record references from global variable initializers. A number of bitcode records and data structures have been renamed to reflect the newly expanded scope of the summary beyond functions. More cleanup will follow. Reviewers: joker.eph, davidxl Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D17212 llvm-svn: 263275
* [PM] Make the AnalysisManager parameter to run methods a reference.Chandler Carruth2016-03-111-1/+1
| | | | | | | | | | | | This was originally a pointer to support pass managers which didn't use AnalysisManagers. However, that doesn't realistically come up much and the complexity of supporting it doesn't really make sense. In fact, *many* parts of the pass manager were just assuming the pointer was never null already. This at least makes it much more explicit and clear. llvm-svn: 263219
* [gold] Fix common symbols handling.Evgeniy Stepanov2016-03-111-20/+40
| | | | | | | | | | | | LLVM Gold plugin decides which instance of a common symbol it wants based on the symbol size in claim_file_hook. If the file that contains the chosen instance is later dropped from the link, we end up with an undefined reference. This change delays this decision until the set of the included files is known. llvm-svn: 263180
* [CG] Actually hoist up the generic CallGraphPrinter pass from a weirdChandler Carruth2016-03-101-20/+0
| | | | | | | | | | location in the opt tool to live along side the analysis in LLVM's libraries. No functionality changed here, but this will allow me to port the printer to the new pass manager as well. llvm-svn: 263101
* [opt] Fix description of the -disable-verify flagVedant Kumar2016-03-101-1/+1
| | | | llvm-svn: 263096
* [opt] Only create Verifier passes when requestedVedant Kumar2016-03-101-1/+2
| | | | | | | | | | opt adds Verifier passes in AddOptimizationPasses even if -disable-verify is on. Fix it so that the extra verification occurs either when (1) -disable-verifier is off, or (2) -verify-each is on. Thanks to David Jones for pointing out this behavior! llvm-svn: 263090
* Add a flag to the LLVMContext to disable name for Value other than GlobalValueMehdi Amini2016-03-102-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is intended to be a performance flag, on the same level as clang cc1 option "--disable-free". LLVM will never initialize it by default, it will be up to the client creating the LLVMContext to request this behavior. Clang will do it by default in Release build (just like --disable-free). "opt" and "llc" can opt-in using -disable-named-value command line option. When performing LTO on llvm-tblgen, the initial merging of IR peaks at 92MB without this patch, and 86MB after this patch,setNameImpl() drops from 6.5MB to 0.5MB. The total link time goes from ~29.5s to ~27.8s. Compared to a compile-time flag (like the IRBuilder one), it performs very close. I profiled on SROA and obtain these results: 420ms with IRBuilder that preserve name 372ms with IRBuilder that strip name 375ms with IRBuilder that preserve name, and a runtime flag to strip Reviewers: chandlerc, dexonsmith, bogner Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D17946 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263086
* [llvm-readobj] Enable GNU style section group printHemant Kulkarni2016-03-091-34/+87
| | | | | | Differential Revision: http://reviews.llvm.org/D17822 llvm-svn: 263050
* void foo() is not a valid C prototype, one has to write void foo(void)Mehdi Amini2016-03-091-1/+1
| | | | | | | Remove a warning introduced in r262977 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 262990
* Fix library dependency for llvm-lto after r262977Mehdi Amini2016-03-092-1/+2
| | | | | | | | It is a transitive dependency, so static build are OK but not build with individual DSO for each LLVM library. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 262987
* Fix GOLD plugin build after r262976Mehdi Amini2016-03-091-1/+1
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 262981
* libLTO: add a ThinLTOCodeGenerator on the model of LTOCodeGenerator.Mehdi Amini2016-03-093-0/+412
| | | | | | | | | | | | | | | | | This is intended to provide a parallel (threaded) ThinLTO scheme for linker plugin use through the libLTO C API. The intent of this patch is to provide a first implementation as a proof-of-concept and allows linker to start supporting ThinLTO by definiing the libLTO C API. Some part of the libLTO API are left unimplemented yet. Following patches will add support for these. The current implementation can link all clang/llvm binaries. Differential Revision: http://reviews.llvm.org/D17066 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 262977
* [llvm-pdbdump] Dump line table information.Zachary Turner2016-03-083-12/+80
| | | | | | | This patch adds the -lines command line option which will dump source/line information for each compiland and source file. llvm-svn: 262962
* [gold] Avoid assertion failures when taking a pointer to an empty vector.Benjamin Kramer2016-03-081-1/+1
| | | | llvm-svn: 262926
* [llvm-config] Get rid of code related to the Makefile buildsFilipe Cabecinhas2016-03-081-32/+5
| | | | | | | | | | | | Summary: I left --build-system for backwards compat, in case there are scripts using it. Feel free to ask for its removal too. Reviewers: chapuni, tstellarAMD Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17886 llvm-svn: 262924
* [llvm-config] Teach llvm-config about global-isel.Quentin Colombet2016-03-083-0/+5
| | | | | | | | llvm-config can know tell whether or not a build has been configured to support global-isel. Use '--has-global-isel' for that. llvm-svn: 262877
* Fix bot failure from r262721: unintented change in gold-plugin save-tempsTeresa Johnson2016-03-041-1/+3
| | | | | | | The split code gen task ID should not be appended to save-temps output file when the parallelism factor is 1 (not actually splitting). llvm-svn: 262731
* [ThinLTO] Ensure prevailing linkonce emitted as weak in ThinLTO backendsTeresa Johnson2016-03-041-0/+10
| | | | | | | | | | | | | | | | | | | | | | | Summary: Since IR files are all compiled into separate independent object files in ThinLTO mode, the prevailing linkonce symbols must be emitted in its object file even if it is no longer referenced there, e.g. if no references remain in the module after inlining, since it may be referenced by another ThinLTO compiled object file. This is done by changing LDPR_PREVAILING_DEF_IRONLY* symbols to LDPR_PREVAILING_DEF, which converts the prevailing linkonce to weak. We also don't need the other prevailing IRONLY handling for internalization, which is not currently performed for ThinLTO. Test case included. Reviewers: davidxl, rafael Subscribers: rafael, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16173 llvm-svn: 262727
* [ThinLTO] Launch importing backends in parallel threads from gold pluginTeresa Johnson2016-03-041-13/+202
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Launch ThinLTO backends (LTO and codegen pipelines with importing) in parallel using a ThreadPool, after creating the combined index. The number of threads is controlled by the existing -jobs gold plugin option, or the hardware concurrency if not specified. The old behavior of exiting after creating the combined index can be invoked via a new thinlto-index-only plugin option. This commit involves just the ThinLTO-specific pieces of D15390, the NFC and other restructuring pieces were committed independently: r262677: Add hardware_concurrency interface to llvm::thread (NFC) r262719: Change split code gen to use ThreadPool r262721: Refactor gold-plugin codegen to prepare for ThinLTO threads (NFC) Reviewers: pcc, joker.eph, rafael Subscribers: rafael, davidxl, llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D15390 llvm-svn: 262724
* Refactor gold-plugin codegen to prepare for ThinLTO threads (NFC)Teresa Johnson2016-03-041-92/+181
| | | | | | | | This is the NFC part remaining from D15390, which refactors the current codegen() into a CodeGen class with various modular methods and other helper functions that will be used by the follow-on ThinLTO piece. llvm-svn: 262721
OpenPOWER on IntegriCloud