summaryrefslogtreecommitdiffstats
path: root/llvm/test/ThinLTO/X86
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[ThinLTO] Keep available_externally symbols live"Eric Christopher2018-03-091-9/+0
| | | | | | This reverts commit r327041 and the followup attempts at fixing the testcase as they're still failing. llvm-svn: 327094
* [ThinLTO] Keep available_externally symbols liveVlad Tsyrklevich2018-03-081-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change fixes PR36483. The bug was originally introduced by a change that marked non-prevailing symbols dead. This broke LowerTypeTests handling of available_externally functions, which are non-prevailing. LowerTypeTests uses liveness information to avoid emitting thunks for unused functions. Marking available_externally functions dead is incorrect, the functions are used though the function definitions are not. This change keeps them live, and lets the EliminateAvailableExternally/GlobalDCE passes remove them later instead. I've also enabled EliminateAvailableExternally for all optimization levels, I believe it being disabled for O1 was an oversight. Reviewers: pcc, tejohnson Reviewed By: tejohnson Subscribers: grimar, mehdi_amini, inglorion, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D43690 llvm-svn: 327041
* Revert "[LTO] Support filtering by hotness threshold"Bob Haarman2018-03-081-24/+3
| | | | | | | | This reverts commit 1f3bd185c53beb6aa68446974b7e80837abd6ef0 (r326107) because it fails ThinLTO/X86/diagnostic-handler-remarks-with-hotness.ll. llvm-svn: 326975
* [ThinLTO] Revert r325320: Import global variablesChandler Carruth2018-03-022-27/+0
| | | | | | | | | | | | | | This caused some links to fail with ThinLTO due to missing symbols as well as causing some binaries to have failures at runtime. We're working with the author to get a test case, but want to get the tree green again. Further, it appears to introduce a data race. While the test usage of threads was disabled in r325361 & r325362, that isn't an acceptable fix. I've reverted both of these as well. This code needs to be thread safe. Test cases for this are already on the original commit thread. llvm-svn: 326638
* [ThinLTO] Added a couple of C LTO API interfaces to control the cache policy.Ekaterina Romanova2018-03-021-0/+34
| | | | | | | | | | - thinlto_codegen_set_cache_size_bytes to control the absolute size of cache directory. - thinlto_codegen_set_cache_size_files the size and amount of files in cache directory. These functions have been supported in C++ LTO API for a long time, but were absent in C LTO API. Differential Revision: https://reviews.llvm.org/D42446 llvm-svn: 326537
* [LTO] Support filtering by hotness thresholdAdam Nemet2018-02-261-3/+24
| | | | | | | | | | | This wires up -pass-remarks-hotness-threshold to LTO and ThinLTO. Next is to change the clang driver to pass this with -fdiagnostics-hotness-threshold. Differential Revision: https://reviews.llvm.org/D41465 llvm-svn: 326107
* [ThinLTO] Add GraphTraits for FunctionSummariesCharles Saternos2018-02-191-0/+58
| | | | | | | | Add GraphTraits definitions to the FunctionSummary and ModuleSummaryIndex classes. These GraphTraits will be used to construct find SCC's in ThinLTO analysis passes. Third attempt - moved function from lambda to static function due to build failures. llvm-svn: 325506
* Revert: [llvm] r325448 - [ThinLTO] Add GraphTraits for FunctionSummaries Simon Pilgrim2018-02-181-58/+0
| | | | | | | | | | Add GraphTraits definitions to the FunctionSummary and ModuleSummaryIndex classes. These GraphTraits will be used to construct find SCC's in ThinLTO analysis passes. Second attempt, since last patch caused stage2 build to fail (now using function_ref rather than std::function). Reverted due to buildbot failures llvm-svn: 325454
* [ThinLTO] Add GraphTraits for FunctionSummariesCharles Saternos2018-02-171-0/+58
| | | | | | | | Add GraphTraits definitions to the FunctionSummary and ModuleSummaryIndex classes. These GraphTraits will be used to construct find SCC's in ThinLTO analysis passes. Second attempt, since last patch caused stage2 build to fail (now using function_ref rather than std::function). llvm-svn: 325448
* [ThinLTO] Import global variablesEugene Leviant2018-02-162-0/+27
| | | | | | Differential revision: https://reviews.llvm.org/D43077 llvm-svn: 325320
* Allow 0 to be a valid value pruning interval in C LTO API. Value 0 will ↵Ekaterina Romanova2018-02-151-0/+21
| | | | | | cause garbage collector to run. This matches the behavior in C++ LTO API. llvm-svn: 325303
* [ThinLTO/CFI] Include TYPE_ID summaries into GLOBALVAL_SUMMARY_BLOCKVitaly Buka2018-02-141-1/+2
| | | | | | | | | | | | | | Summary: TypeID summaries are used by CFI and need to be serialized by ThinLTO indexing for later use by LTO Backend. Reviewers: tejohnson, pcc Subscribers: mehdi_amini, inglorion, eraman, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D42611 llvm-svn: 325182
* Revert "Follow on to rL324854 (Added tests)" as part of r324854 revert.Volodymyr Sapsai2018-02-121-58/+0
| | | | | | r324854 caused broken build on the second stage build bots. llvm-svn: 324931
* Follow on to rL324854 (Added tests)Charles Saternos2018-02-121-0/+58
| | | | llvm-svn: 324859
* [ThinLTO] Teach ThinLTO about auto hide symbolsSteven Wu2018-02-092-1/+11
| | | | | | | | | | | | | | | | | | Summary: For symbols that has linkonce_odr linkage and unnamed_addr, it can be auto hide by linker to avoid weak external symbols. Teach ThinLTO to perform auto hide so it can safely promote linkonce_odr to weak symbols without breaking this nice property. Reviewers: tejohnson, mehdi_amini Reviewed By: tejohnson Subscribers: inglorion, eraman, rnk, pcc, llvm-commits Differential Revision: https://reviews.llvm.org/D43130 llvm-svn: 324757
* [ThinLTO] Remove dead and dropped symbol declarations when possibleTeresa Johnson2018-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Removing the dropped symbols will prevent indirect call promotion in the ThinLTO Backend from adding a new reference to a symbol, which can result in linker unsats. This can happen when we compile with a sample profile collected from one binary by used for another, which may have profiled targets that aren't used in the new binary. Note that until dropDeadSymbols handles variables and aliases (in progress), we may not be able to remove the declaration and can still have an issue. Reviewers: grimar, davidxl Subscribers: mehdi_amini, inglorion, llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D42816 llvm-svn: 324299
* Teach ValueMapper to use ODR uniqued types when availableTeresa Johnson2018-01-302-0/+101
| | | | | | | | | | | | | | | | | Summary: This is exposed during ThinLTO compilation, when we import an alias by creating a clone of the aliasee. Without this fix the debug type is unnecessarily cloned and we get a duplicate, undoing the uniquing. Fixes PR36089. Reviewers: mehdi_amini, pcc Subscribers: eraman, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D41669 llvm-svn: 323813
* [ThinLTO] - Stop internalizing and drop non-prevailing symbols.George Rimar2018-01-292-1/+2
| | | | | | | | | | | Implementation marks non-prevailing symbols as not live in the summary. Then them are dropped in backends. Fixes https://bugs.llvm.org/show_bug.cgi?id=35938 Differential revision: https://reviews.llvm.org/D42107 llvm-svn: 323633
* [ThinLTO] Re-commit of dot dumper after test fixEugene Leviant2018-01-222-0/+78
| | | | llvm-svn: 323116
* Temporarily revert r323062 to investigate buildbot failuresEugene Leviant2018-01-212-74/+0
| | | | llvm-svn: 323065
* An attempt to fix buildbot after rL323062Eugene Leviant2018-01-211-9/+9
| | | | llvm-svn: 323063
* [ThinLTO] Implement summary visualizerEugene Leviant2018-01-212-0/+74
| | | | | | Differential revision: https://reviews.llvm.org/D41297 llvm-svn: 323062
* Make GlobalValues with non-default visibilility dso_local.Rafael Espindola2018-01-184-13/+13
| | | | | | | | | | | | This is similar to r322317, but for visibility. It is not as neat because we have to special case extern_weak. The idea is the same as the previous change, make the transition to explicit dso_local easier for the frontends. With this they only have to add dso_local to symbols where we need some external information to decide if it is dso_local (like it being part of an ELF executable). llvm-svn: 322806
* Make internal/private GVs implicitly dso_local.Rafael Espindola2018-01-117-24/+24
| | | | | | | | | | | | | | | | While updating clang tests for having clang set dso_local I noticed that: - There are *a lot* of tests to update. - Many of the updates are redundant. They are redundant because a GV is "obviously dso_local". This patch starts formalizing that a bit by requiring that internal and private GVs be dso_local too. Since they all are, we don't have to print dso_local to the textual representation, making it a bit more compact and easier to read. llvm-svn: 322317
* Fix crash when linking metadata with ODR type uniquingTeresa Johnson2018-01-092-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With DebugTypeODRUniquing enabled, during IR linking debug metadata in the destination module may be reached from the source module. This means that ConstantAsMetadata nodes (e.g. on DITemplateValueParameter) may contain a value the destination module. When trying to map such metadata nodes, we will attempt to map a GV already in the dest module. linkGlobalValueProto will end up with a source GV that is the same as the dest GV as well as the new GV. Trying to access the TypeMap for the source GV type, which is actually a dest GV type, hits an assertion since it appears that we have mapped into the source module (because the type is the value not a key into the map). Detect that we don't need to access the TypeMap in this case, since there is no need to create a bitcast from the new GV to the source GV type as they GV are the same. Fixes PR35722. Reviewers: mehdi_amini, pcc Subscribers: probinson, llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D41624 llvm-svn: 322103
* [ThinLTO] Don't import functions with noinline attributeEugene Leviant2017-12-252-0/+34
| | | | | | Differential revision: https://reviews.llvm.org/D41489 llvm-svn: 321443
* [Support][CachePruning] Disable cache pruning regression fixBen Dunbobbin2017-12-191-3/+19
| | | | | | | | | | borked by: rL284966 (see: https://reviews.llvm.org/D25730). Previously, Interval was unsigned (see: CachePruning.h), replacing the type with std::chrono::seconds (which is signed) causes a regression in behaviour because the c-api intends negative values to translate to large positive intervals to *effectively* disable the pruning (see comments on: setCachePruningInterval()). Differential Revision: https://reviews.llvm.org/D41231 llvm-svn: 321077
* [ThinLTO] Make distributed indexes test more robustTeresa Johnson2017-12-181-7/+7
| | | | | | | | | Modify test so that it passes in the reverse-iteration bot. We use DenseMap instead of std::map for the summaries to emit into distributed index files. The iteration order is not defined, but it is deterministic, which is good enough. llvm-svn: 321000
* [LTO] Update tests for r320905Vitaly Buka2017-12-162-2/+2
| | | | llvm-svn: 320909
* Remove trailing whitespaceVitaly Buka2017-12-161-1/+1
| | | | llvm-svn: 320907
* [LTO] Make processing of combined module more consistentVitaly Buka2017-12-1611-14/+33
| | | | | | | | | | | | | | | | | Summary: 1. Use stream 0 only for combined module. Previously if combined module was not processes ThinLTO used the stream for own output. However small changes in input, could trigger combined module and shuffle outputs making life of llvm::LTO harder. 2. Always process combined module and write output to stream 0. Processing empty combined module is cheap and allows llvm::LTO users to avoid implementing processing which is already done in llvm::LTO. Subscribers: mehdi_amini, inglorion, eraman, hiraditya Differential Revision: https://reviews.llvm.org/D41267 llvm-svn: 320905
* Add another missing -enable-import-metadata to testTeresa Johnson2017-12-161-1/+1
| | | | | | | | r320895 modified a test so that it needs -enable-import-metadata which is false by default for NDEBUG, found another place that needs this added. llvm-svn: 320903
* Add -enable-import-metadata to testTeresa Johnson2017-12-161-1/+1
| | | | | | | r320895 modified a test so that it needs -enable-import-metadata which is false by default for NDEBUG. llvm-svn: 320899
* [ThinLTO] Enable importing of aliases as copy of aliaseeTeresa Johnson2017-12-166-46/+83
| | | | | | | | | | | | | | | | | | | | | | | Summary: This implements a missing feature to allow importing of aliases, which was previously disabled because alias cannot be available_externally. We instead import an alias as a copy of its aliasee. Some additional work was required in the IndexBitcodeWriter for the distributed build case, to ensure that the aliasee has a value id in the distributed index file (i.e. even when it is not being imported directly). This is a performance win in codes that have many aliases, e.g. C++ applications that have many constructor and destructor aliases. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D40747 llvm-svn: 320895
* [ThinLTO] Disallow multiple prevailing defsEugene Leviant2017-12-151-2/+2
| | | | | | https://reviews.llvm.org/D41291 llvm-svn: 320825
* [LLVMgold] Don't set undefined symbol as prevailingEugene Leviant2017-12-151-2/+2
| | | | | | Differential revision: https://reviews.llvm.org/D41113 llvm-svn: 320794
* [LTO][ThinLTO] Use the linker resolutions to mark global values as dso_local.Sean Fertile2017-11-044-17/+28
| | | | | | | | | | | | | Now that we have a way to mark GlobalValues as local we can use the symbol resolutions that the linker plugin provides as part of lto/thinlto link step to refine the compilers view on what symbols will end up being local. Originally commited as r317374, but reverted in r317395 to update some missed tests. Differential Revision: https://reviews.llvm.org/D35702 llvm-svn: 317408
* Revert "[LTO][ThinLTO] Use the linker resolutions to mark global values ..."Sean Fertile2017-11-044-28/+17
| | | | | | | | | Changes more tests then expected on one of the build bots. reverting to investigate. This reverts https://llvm.org/svn/llvm-project/llvm/trunk@317374 llvm-svn: 317395
* [LTO][ThinLTO] Use the linker resolutions to mark global values as dso_local.Sean Fertile2017-11-034-17/+28
| | | | | | | | | | Now that we have a way to mark GlobalValues as local we can use the symbol resolutions that the linker plugin provides as part of lto/thinlto link step to refine the compilers view on what symbols will end up being local. Differential Revision: https://reviews.llvm.org/D35702 llvm-svn: 317374
* Irreducible loop metadata for more accurate block frequency under PGO.Hiroshi Yamauchi2017-11-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: Currently the block frequency analysis is an approximation for irreducible loops. The new irreducible loop metadata is used to annotate the irreducible loop headers with their header weights based on the PGO profile (currently this is approximated to be evenly weighted) and to help improve the accuracy of the block frequency analysis for irreducible loops. This patch is a basic support for this. Reviewers: davidxl Reviewed By: davidxl Subscribers: mehdi_amini, llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D39028 llvm-svn: 317278
* [ThinLTO] Make test for promoted names more specificTeresa Johnson2017-10-251-1/+1
| | | | | | | | With r314527, promoted values get a suffix that is a decimal value of the module hash instead of hex. Change the regex to match only decimal suffix values. llvm-svn: 316544
* Add !callees metadataMatthew Simpson2017-10-161-2/+2
| | | | | | | | | This patch adds a new kind of metadata that indicates the possible callees of indirect calls. Differential Revision: https://reviews.llvm.org/D37354 llvm-svn: 315944
* ModuleSummaryAnalysis: Correctly handle all function operand references.Peter Collingbourne2017-09-072-0/+47
| | | | | | | | | | | | | | | | | | | The current code that handles personality functions when creating a module summary does not correctly handle the case where a function's personality function operand refers to the function indirectly (e.g. via a bitcast). This patch handles such cases by treating personality function references like any other reference, i.e. by adding them to the function's reference list. This has the minor side benefit of allowing personality functions to participate in early dead stripping. We do this by calling findRefEdges on the function itself. This way we also end up handling other function operands (specifically prefix data and prologue data) for free. Differential Revision: https://reviews.llvm.org/D37553 llvm-svn: 312698
* Canonicalize the representation of empty an expression in ↵Adrian Prantl2017-08-303-3/+3
| | | | | | | | | | | | | | | | DIGlobalVariableExpression This change simplifies code that has to deal with DIGlobalVariableExpression and mirrors how we treat DIExpressions in debug info intrinsics. Before this change there were two ways of representing empty expressions on globals, a nullptr and an empty !DIExpression(). If someone needs to upgrade out-of-tree testcases: perl -pi -e 's/(!DIGlobalVariableExpression\(var: ![0-9]*)\)/\1, expr: !DIExpression())/g' <MYTEST.ll> will catch 95%. llvm-svn: 312144
* [lib/Analysis] - Mark personality functions as live.George Rimar2017-08-224-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | This is PR33245. Case I am fixing is next: Imagine we have 2 BC files, one defines and uses personality routine, second has only declaration and also uses it. Previously algorithm computing dead symbols (llvm::computeDeadSymbols) did not know about personality routines and leaved them dead even if function that has routine was live. As a result thinLTOInternalizeAndPromoteGUID() method changed binding for such symbol to local. Later when LLD tried to link these objects it failed because one object had undefined global symbol for routine and second object contained local definition instead of global. Patch set the live root flag on the corresponding FunctionSummary for personality routines when we build the per-module summaries during the compile step. Differential revision: https://reviews.llvm.org/D36834 llvm-svn: 311432
* Emit only A Single Opt Remark When InliningSam Elliott2017-08-212-0/+20
| | | | | | | | | | | | | | | | | | | Summary: This updates the Inliner to only add a single Optimization Remark when Inlining, rather than an Analysis Remark and an Optimization Remark. Fixes https://bugs.llvm.org/show_bug.cgi?id=33786 Reviewers: anemet, davidxl, chandlerc Reviewed By: anemet Subscribers: haicheng, fhahn, mehdi_amini, dblaikie, llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D36054 llvm-svn: 311349
* Revert "Emit only A Single Opt Remark When Inlining"Sam Elliott2017-08-202-20/+0
| | | | | | Reverting due to clang build failure llvm-svn: 311274
* Emit only A Single Opt Remark When InliningSam Elliott2017-08-202-0/+20
| | | | | | | | | | | | | | | | | | | Summary: This updates the Inliner to only add a single Optimization Remark when Inlining, rather than an Analysis Remark and an Optimization Remark. Fixes https://bugs.llvm.org/show_bug.cgi?id=33786 Reviewers: anemet, davidxl, chandlerc Reviewed By: anemet Subscribers: haicheng, fhahn, mehdi_amini, dblaikie, llvm-commits, eraman Differential Revision: https://reviews.llvm.org/D36054 llvm-svn: 311273
* [llvm] Get rid of "%T" expansionsKuba Mracek2017-08-151-6/+6
| | | | | | | | | | The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in llvm. Differential Revision: https://reviews.llvm.org/D36495 llvm-svn: 310953
* Fix thinlto cache key computation for cfi-icall.Evgeniy Stepanov2017-08-092-0/+64
| | | | | | | | | | | | | | | | | | Summary: Fixed PR33966. CFI code generation for users (not just callers) of a function depends on whether this function has a jumptable entry or not. This information needs to be encoded in of thinlto cache key. We filter the jumptable list against functions that are actually referenced in the current module. Subscribers: mehdi_amini, inglorion, eraman, hiraditya Differential Revision: https://reviews.llvm.org/D36346 llvm-svn: 310536
OpenPOWER on IntegriCloud