summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[SCEV] Clarify behavior around max backedge taken count"Sanjoy Das2017-05-214-58/+27
| | | | | | | This reverts commit r303497 since it breaks the msan bootstrap bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/1379/ llvm-svn: 303498
* [SCEV] Clarify behavior around max backedge taken countSanjoy Das2017-05-214-27/+58
| | | | | | | | | | | | | | | | | | | This change makes the split between the "exact" backedge taken count and the "maximum" backedge taken count a bit more obvious. Both of these are upper bounds on the number of times the loop header executes (since SCEV does not account for most kinds of abnormal control flow), but the latter is guaranteed to be a constant. There were a few places where the max backedge taken count *was* a non-constant; I've changed those to compute constants instead. At this point, I'm not sure if the constant max backedge count can be computed by calling `getUnsignedRange(Exact).getUnsignedMax()` without losing precision. If it can, we can simplify even further by making `getMaxBackedgeTakenCount` a thin wrapper around `getBackedgeTakenCount` and `getUnsignedRange`. llvm-svn: 303497
* Revert "Add pthread_self function prototype and make it speculatable."Xin Tong2017-05-215-67/+3
| | | | | | | | This reverts commit 143d7445b5dfa2f6d6c45bdbe0433d9fc531be21. Build breaking llvm-svn: 303496
* Add pthread_self function prototype and make it speculatable.Xin Tong2017-05-205-3/+67
| | | | | | | | | | | | | | Summary: This allows pthread_self to be pulled out of a loop by LICM. Reviewers: hfinkel, arsenm, davide Reviewed By: davide Subscribers: davide, wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D32782 llvm-svn: 303495
* COFF: Fix another StringRef return errorMartell Malone2017-05-201-1/+1
| | | | | | | This should appease the lld build bot regression Following up on rL303493 llvm-svn: 303494
* COFF: Fix single StringRef return errorMartell Malone2017-05-201-2/+2
| | | | | | | This should appease the lld build bot regression Intrroduced by rL303490 llvm-svn: 303493
* Fix PR25627: constant expressions being odr-used in template arguments.Faisal Vali2017-05-205-11/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch ensures that clang processes the expression-nodes that are generated when disambiguating between types and expressions within template arguments as constant-expressions by installing the ConstantEvaluated ExpressionEvaluationContext just before attempting the disambiguation - and then making sure that Context carries through into ParseConstantExpression (by refactoring it out into a function that does not create its own EvaluationContext: ParseConstantExpressionInExprEvalContext) Note, prior to this patch, trunk would correctly disambiguate and identify the expression as an expression - and while it would annotate the token with the expression - it would fail to complete the odr-use processing (specifically, failing to trigger Sema::UpdateMarkingForLValueToRValue as is done for all Constant Expressions, which would remove it from being considered odr-used). By installing the ConstantExpression Evaluation Context prior to disambiguation, and making sure it carries though, we ensure correct processing of the expression-node. For e.g: template<int> struct X { }; void f() { const int N = 10; X<N> x; // should be OK. [] { return X<N>{}; }; // Should be OK - no capture - but clang errors! } See a related bug: https://bugs.llvm.org//show_bug.cgi?id=25627 In summary (and reiteration), the fix is as follows: - Remove the EnteredConstantEvaluatedContext action from ParseTemplateArgumentList (relying on ParseTemplateArgument getting it right) - Add the EnteredConstantEvaluatedContext action just prior to undergoing the disambiguating parse, and if the parse succeeds for an expression, carry the context though into a refactored version of ParseConstantExpression that does not create its own ExpressionEvaluationContext. See https://reviews.llvm.org/D31588 for additional context regarding some of the more fragile and complicated approaches attempted, and Richard's feedback that eventually shaped the simpler and more robust rendition that is being committed. Thanks Richard! llvm-svn: 303492
* COFF: migrate def parser from LLD to LLVM [2/2]Martell Malone2017-05-205-824/+83
| | | | | | | | | | | | This is split up into two commits. This commit removes the DEF parser from LLD See the previous commit for the creation in LLVM. Reviewers: ruiu Differential Revision: https://reviews.llvm.org/D32689 llvm-svn: 303491
* COFF: migrate def parser from LLD to LLVM [1/2]Martell Malone2017-05-205-1/+930
| | | | | | | | | | | | This is split up into two commits. The will create the DEF parser in LLVM. Check the following commit to see the removal from LLD Reviewers: ruiu Differential Revision: https://reviews.llvm.org/D32689 llvm-svn: 303490
* Fix test typo. NFCXin Tong2017-05-201-2/+2
| | | | llvm-svn: 303489
* [Devirtualization] insert placement new barrier with -O0Piotr Padlewski2017-05-201-1/+2
| | | | | | | | | | | | | | | | Summary: To not break LTO with different optimizations levels, we should insert the barrier regardles of optimization level. Reviewers: rjmccall, rsmith, mehdi_amini Reviewed By: mehdi_amini Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D32401 llvm-svn: 303488
* Docs: Fix pluralization in CMake docsDuncan P. N. Exon Smith2017-05-201-2/+2
| | | | | | | Fixed "most platform" to read "most platforms", and changed "are not using the same" to "use different" as a drive-by. llvm-svn: 303487
* [docs] Small style nits.George Burgess IV2017-05-201-3/+3
| | | | llvm-svn: 303486
* Fix buildbots after r303429Tobias Grosser2017-05-201-8/+3
| | | | | | | | A test case with a GPU runline was added without setting 'REQUIRES=pollyacc'. We drop the GPU run line, as the basic functionality can already be tested with the normal code generation. llvm-svn: 303485
* [index] Fix forward declarations interfering with USR generation of external ↵Argyrios Kyrtzidis2017-05-206-21/+33
| | | | | | | | | source symbols Patch by Nathan Hawes. https://reviews.llvm.org/D33346 llvm-svn: 303484
* Fix -Wunneeded-internal-declaration by removing constant arrays only used in ↵David Blaikie2017-05-201-6/+4
| | | | | | sizeof expressions, in favor of constants containing the size directly llvm-svn: 303483
* llvm-symbolizer: Support multiple CUs in a single DWO fileDavid Blaikie2017-05-205-7/+19
| | | | llvm-svn: 303482
* Revert "[compiler-rt] Change default of allow_user_segv_handler to true"Vitaly Buka2017-05-203-14/+14
| | | | | | | | Failed libFuzzer tests on Windows. This reverts commit r303476. llvm-svn: 303481
* Add functionality to cvtres to parse all entries in res file.Eric Beckmann2017-05-2015-6/+340
| | | | | | | | | | | Summary: Added the new modules in the Object/ folder. Updated the llvm-cvtres interface as well, and added additional tests. Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D33180 llvm-svn: 303480
* Rename RAII objects for performing eager instantiation to have names thatRichard Smith2017-05-202-62/+34
| | | | | | | describe what they're for, not how they do it, and factor out a bit more common code into them. llvm-svn: 303479
* CodeGenModule: Always output wchar_size, check LLVM assumptions.Matthias Braun2017-05-204-9/+24
| | | | | | | | | | | | | | Re-commit r303463 now that LLVM is fixed and adjust some lit tests. llvm::TargetLibraryInfo needs to know the size of wchar_t to work on functions like `wcslen`. This patch changes clang to always emit the wchar_size module flag (it would only do so for ARM previously). This also adds an `assert()` to ensure the LLVM defaults based on the target triple are in sync with clang. Differential Revision: https://reviews.llvm.org/D32982 llvm-svn: 303478
* Fix breakage after r303461Matthias Braun2017-05-202-4/+5
| | | | | | | - Improve wchar_t size predicitions based on target triple. - Be less strict in wchar_t size verifier. llvm-svn: 303477
* [compiler-rt] Change default of allow_user_segv_handler to trueVitaly Buka2017-05-203-14/+14
| | | | | | | | | | Reviewers: eugenis Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32443 llvm-svn: 303476
* [NewGVN] Create a StoreExpression instead of a VariableExpression.Davide Italiano2017-05-202-1/+27
| | | | | | | | | | | | | In the case where we have an operand defined by a lod of the same memory location. Historically this was a VariableExpression because we wanted to make sure they ended up in the same class, but if we create the right expression, they end up in the same class anyway. Fixes PR32897. Thanks to Dan for the detailed discussion and the fix suggestion. llvm-svn: 303475
* Revert "CodeGenModule: Always output wchar_size, check LLVM assumptions."Matthias Braun2017-05-202-21/+6
| | | | | | | | | Let's revert this for now (and with it the assert()) to get the bots back to green until I have LLVM synced up properly. This reverts commit r303463. llvm-svn: 303474
* [NewGVN] Get rid of an assertion.Davide Italiano2017-05-201-1/+0
| | | | | | | | | | This was here because we don't want to switch leaders too much, in order to avoid fixpoint(ing) issue, but it's not sure if it matters in practice. A first step towards fixing PR32897. llvm-svn: 303473
* Fix valid-for-expr ellipses eaten as invalid declHubert Tong2017-05-202-12/+39
| | | | | | | | | | | | | | | | | | | | | | Summary: The trial parse for declarative syntax accepts an invalid pack declaration syntax, which is ambiguous with valid pack expansions of expressions. This commit removes the invalid pack declaration syntax to avoid mistaking valid pack expansions as invalid declarator components. Additionally, the trial parse of a //template-argument-list// then needs to handle the optional ellipsis that is part of that grammar, as opposed to relying on the trial parse for declarators accepting stray ellipses. Reviewers: rsmith, rcraik, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33339 llvm-svn: 303472
* Cosmetic. Added braces to address gcc warning: suggest explicit braces to ↵Galina Kistanova2017-05-201-2/+4
| | | | | | avoid ambiguous 'else' [-Wdangling-else]. llvm-svn: 303471
* Revert "Revert "ThinLTO: Verify bitcode before lauching the ↵Adrian Prantl2017-05-205-5/+96
| | | | | | | | | | | | | ThinLTOCodeGenerator."" This reapplies commit r303438 modified to not verify cross-imported bitcode in FunctionImporter. rdar://problem/31233625 Differential Revision: https://reviews.llvm.org/D33370 llvm-svn: 303470
* Remove last (unnecessary) use of mapping from SourceLocation to Module andRichard Smith2017-05-195-59/+7
| | | | | | | | | remove the mechanism for doing so. This mechanism was incorrect in the presence of preprocessed modules (and #pragma clang module begin/end). llvm-svn: 303469
* [modules] Simplify module macro handling in non-local-submodule-visibility mode.Richard Smith2017-05-192-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When reaching the end of a module, we used to convert its macros to ModuleMacros but also leave them in the MacroDirective chain for the identifier. This meant that every lookup of such a macro would find two (identical) definitions. It also made it difficult to determine the correct owner for a macro when reaching the end of a module: the most recent MacroDirective in the chain could be from an #included submodule rather than the current module. Simplify this: whenever we convert a MacroDirective to a ModuleMacro when leaving a module, clear out the MacroDirective chain for that identifier, and just rely on the ModuleMacro to provide the macro definition information. (We don't want to do this for local submodule visibility mode, because in that mode we maintain a distinct MacroDirective chain for each submodule, and we need to keep around the prior MacroDirective in case we re-enter the submodule -- for instance, if its header is #included more than once in a module build, we need the include guard directive to stick around. But the problem doesn't arise in this case for the same reason: each submodule has its own MacroDirective chain, so the macros don't leak out of submodules in the first place.) This reinstates r302932, reverted in r302947, with a fix for a bug that resulted in us sometimes losing macro definitions due to failing to clear out the overridden module macro list when promoting a directive to a module macro. llvm-svn: 303468
* Revert "ThinLTO: Verify bitcode before lauching the ThinLTOCodeGenerator."Adrian Prantl2017-05-196-102/+7
| | | | | | This reverts commit r303438 while deliberating buildbot breakage. llvm-svn: 303467
* [test] Add support for Objective-C++ testsErik Pilkington2017-05-197-4/+87
| | | | | | Differential revision: https://reviews.llvm.org/D33049 llvm-svn: 303466
* Don't override the SDKs and force the use of /System/Library/Frameworks toJason Molenda2017-05-191-1/+1
| | | | | | | find the python headers when buiding crashinfo.c <rdar://problem/32288076> llvm-svn: 303465
* [compiler-rt] Switch handle_<signal> flags from bool to enum.Vitaly Buka2017-05-195-15/+62
| | | | | | | | | | | | Summary: We are going to make it tri-state and remove allow_user_segv_handler. Reviewers: eugenis, alekseys, kcc Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D33159 llvm-svn: 303464
* CodeGenModule: Always output wchar_size, check LLVM assumptions.Matthias Braun2017-05-192-6/+21
| | | | | | | | | | | | llvm::TargetLibraryInfo needs to know the size of wchar_t to work on functions like `wcslen`. This patch changes clang to always emit the wchar_size module flag (it would only do so for ARM previously). This also adds an `assert()` to ensure the LLVM defaults based on the target triple are in sync with clang. Differential Revision: https://reviews.llvm.org/D32982 llvm-svn: 303463
* [compiler-rt] Add negative test for boolean flags.Vitaly Buka2017-05-191-0/+8
| | | | | | | | | | Reviewers: eugenis, alekseyshl Subscribers: kubamracek, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D33344 llvm-svn: 303462
* SimplifyLibCalls: Optimize wcslenMatthias Braun2017-05-1913-89/+653
| | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the strlen optimization code to work for both strlen and wcslen. This especially helps with programs in the wild where people pass L"string"s to const std::wstring& function parameters and the wstring constructor gets inlined. This also fixes a lingerind API problem/bug in getConstantStringInfo() where zeroinitializers would always give you an empty string (without a length) back regardless of the actual length of the initializer which did not work well in the TrimAtNul==false causing the PR mentioned below. Note that the fixed getConstantStringInfo() needed fixes to SelectionDAG memcpy lowering and may lead to some cases for out-of-bounds zeroinitializer accesses not getting optimized anymore. So some code with UB may produce out of bound memory reads now instead of just producing zeros. The refactoring "accidentally" fixes http://llvm.org/PR32124 Differential Revision: https://reviews.llvm.org/D32839 llvm-svn: 303461
* Verifier: Check wchar_size module flag.Matthias Braun2017-05-191-0/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D32974 llvm-svn: 303460
* [ODRHash] Revert r303450 to fix buildbotRichard Trieu2017-05-192-192/+2
| | | | | | | r303450 [ODRHash] Support TemplateName and TemplateArgument llvm-svn: 303459
* Fix off-by-one bug in AttributeList::addAttributes index handlingReid Kleckner2017-05-192-1/+20
| | | | | | | | | | getParamAlignment expects an argument number, not an AttributeList index. Johan Englan, who works on LDC, found this bug and told me about it off list. llvm-svn: 303458
* Added LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.Galina Kistanova2017-05-191-0/+1
| | | | llvm-svn: 303457
* [safestack] Disable stack coloring by default.Evgeniy Stepanov2017-05-195-7/+8
| | | | | | Workaround for apparent miscompilation of PR32143. llvm-svn: 303456
* Added missing break.Galina Kistanova2017-05-191-0/+1
| | | | llvm-svn: 303454
* NewGVN: Fix PR32838.Daniel Berlin2017-05-193-22/+222
| | | | | | | | | | This is a complicated bug involving two issues: 1. What do we do with phi nodes when we prove all arguments are not live? 2. When is it safe to use value leaders to determine if we can ignore an argumnet? llvm-svn: 303453
* NewGVN: Print out the StoredValue of a StoreExpressionDaniel Berlin2017-05-191-1/+3
| | | | llvm-svn: 303452
* Do not issue -Wnullability-completeness for dependent types that are not ↵Richard Smith2017-05-195-25/+27
| | | | | | written as pointer types. llvm-svn: 303451
* [ODRHash] Support TemplateName and TemplateArgumentRichard Trieu2017-05-192-2/+192
| | | | llvm-svn: 303450
* Fix line-endings.Simon Pilgrim2017-05-191-1/+1
| | | | llvm-svn: 303448
* [InstCombine] *Actually* commit the test showing the miscompile.Davide Italiano2017-05-191-1/+13
| | | | | | Clarify a comment while I'm here. llvm-svn: 303447
OpenPOWER on IntegriCloud