summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [X86] Don't set exception mask bits when modifying FPCW to change rounding ↵Craig Topper2019-02-1511-264/+278
| | | | | | | | | | | | mode for fp->int conversion When we need to do an fp->int conversion using x87 instructions, we need to temporarily change the rounding mode to 0b11 and perform a store. To do this we save the old value of the fpcw to the stack, then set the fpcw to 0xc7f, do the store, then restore fpcw. But the 0xc7f value forces the exception mask bits 1. While this is what they would be in the default FP environment, as we move to support changing the FP environments, we shouldn't make this assumption. This patch changes the code to explicitly OR 0xc00 with the old value so that only the rounding mode is changed. Unfortunately, this requires two stack temporaries instead of one. One to hold the old value and one to hold the new value. Without two stack temporaries we would need an additional GPR. We already need one to do the OR operation in. This is similar to what gcc and icc do for this operation. Though they are both better at reusing the stack temporaries when there are multiple truncates in a function(or at least in a basic block) Differential Revision: https://reviews.llvm.org/D57788 llvm-svn: 354178
* Revert "Don't include UnixSignals.h from Host."Davide Italiano2019-02-1512-37/+22
| | | | | | It broke the modules green dragon buildbot. llvm-svn: 354177
* Fix implementation of [temp.local]p4.Richard Smith2019-02-159-89/+184
| | | | | | | | | | | | | | | | | | | | | | | | When a template-name is looked up, we need to give injected-class-name declarations of class templates special treatment, as they denote a template rather than a type. Previously we achieved this by applying a filter to the lookup results after completing name lookup, but that is incorrect in various ways, not least of which is that it lost all information about access and how members were named, and the filtering caused us to generally lose all ambiguity errors between templates and non-templates. We now preserve the lookup results exactly, and the few places that need to map from a declaration found by name lookup into a declaration of a template do so explicitly. Deduplication of repeated lookup results of the same injected-class-name declaration is done by name lookup instead of after the fact. This reinstates r354091, which was previously reverted in r354097 because it exposed bugs in lldb and compiler-rt. Those bugs were fixed in r354173 and r354174 respectively. llvm-svn: 354176
* [libFuzzer] form mode: add -ignore_crashes flag, honor the max_total_time ↵Kostya Serebryany2019-02-159-23/+70
| | | | | | flag, print the number of ooms/timeouts/crashes, fix a typo llvm-svn: 354175
* Fix invalid code that Clang trunk will soon diagnose.Richard Smith2019-02-151-1/+1
| | | | | | | | | | | | | There is an ambiguity between ::SizeClassMap (the typedef declared near the start of this file) and __sanitizer::SizeClassMap (found by the 'using namespace __sanitizer;' near the start of this file). Historically a Clang bug has meant that the error was not diagnosed, but soon Clang will start diagnosing it. Explicitly qualify this use of SizeClassMap so that it finds __sanitizer::SizeClassMap rather than being ill-formed due to ambiguity. llvm-svn: 354174
* Fix AST generated for a class template to connect the class inside aRichard Smith2019-02-151-0/+1
| | | | | | | | | | | | | | | | class template back to the template. Previously, when the ASTImporter imported the class, it didn't know that it was the pattern of a class template, so made the class a name lookup result for the name of the template, resulting in ambiguity errors when naming the template. Due to a clang bug (fixed in r354091, reverted and soon to be re-committed), ambiguity errors between a template and a non-template were previously not diagnosed. Once r354091 is re-committed, this will be covered by existing lldb tests. llvm-svn: 354173
* [win] Resolve the module only if there isn't one alreadyStella Stamenova2019-02-153-14/+23
| | | | | | | | | | | | | | | | | | Summary: This commit modifies the OnLoadModule method to resolve the module unless we already have one Change by Hui Huang to fix the failing LLDB tests on Windows Reviewers: labath, asmith Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D58303 llvm-svn: 354172
* [InstCombine] Address a couple stylistic issues pointed out by reviewer [NFC]Philip Reames2019-02-151-6/+6
| | | | | | Better addressing comments from https://reviews.llvm.org/D58290. llvm-svn: 354171
* [InstCombine] Convert atomicrmws to xchg or store where legalPhilip Reames2019-02-152-24/+75
| | | | | | | | | | Implement two more transforms of atomicrmw: 1) We can convert an atomicrmw which produces a known value in memory into an xchg instead. 2) We can convert an atomicrmw xchg w/o users into a store for some orderings. Differential Revision: https://reviews.llvm.org/D58290 llvm-svn: 354170
* Revert r354075 "[clang][FileManager] fillRealPathName even if we aren't ↵Reid Kleckner2019-02-152-17/+0
| | | | | | | | opening the file" The new test doesn't pass on Windows. llvm-svn: 354169
* Don't include UnixSignals.h from Host.Zachary Turner2019-02-1512-22/+37
| | | | | | | | | | | | | | | | | Host had a function to get the UnixSignals instance corresponding to the current host architecture. This means that Host had to include a file from Target. To break this dependency, just make this a static function directly in UnixSignals. We already have the function UnixSignals::Create(ArchSpec) anyway, so we just need to have UnixSignals::CreateForHost() which determines which value to pass for the ArchSpec. The goal here is to eventually break the Host->Target->Host circular dependency. Differential Revision: https://reviews.llvm.org/D57780 llvm-svn: 354168
* [docs] Document LLVM_ENABLE_IDEShoaib Meenai2019-02-151-0/+9
| | | | | | | | | Use some of the wording and the motivating example from r344555. The lack of documentation was pointed out by Roman Lebedev. Differential Revision: https://reviews.llvm.org/D58286 llvm-svn: 354167
* [Driver] Default all Android ARM targets to NEON.Dan Albert2019-02-152-54/+20
| | | | | | | | | | | | | | | | | | | | Summary: There are an insignificant number of ARM Android devices that don't support NEON. Default to using NEON since that will improve performance on the majority of devices. Users that need to target non-NEON devices can still explicitly disable NEON. Reviewers: srhines, pirama, kristof.beyls Reviewed By: pirama Subscribers: efriedma, javed.absar, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58153 llvm-svn: 354166
* Relax assertion to account for private framework modules, too.Adrian Prantl2019-02-152-5/+5
| | | | | | rdar://problem/48116069 llvm-svn: 354165
* [ObjC] Fix non-canonical types preventing type arguments substitution.Volodymyr Sapsai2019-02-152-9/+29
| | | | | | | | | | | | | | | | | `QualType::substObjCTypeArgs` doesn't go past non-canonical types and as the result misses some of the substitutions like `ObjCTypeParamType`. Update `SimpleTransformVisitor` to traverse past the type sugar. Reviewers: ahatanak, erik.pilkington Reviewed By: erik.pilkington Subscribers: jkorous, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D57270 llvm-svn: 354164
* [X86] Fix LowerAsmOutputForConstraint.Nirav Dave2019-02-156-12/+29
| | | | | | | | | | | | | | | | | Summary: Update Flag when generating cc output. Fixes PR40737. Reviewers: rnk, nickdesaulniers, craig.topper, spatel Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58283 llvm-svn: 354163
* [MSVC] Recognize `static_assert` keyword in C and C++98Reid Kleckner2019-02-154-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The main effect is that clang now accepts the following conforming C11 code with MSVC headers: #include <assert.h> static_assert(1, "true"); This is a non-conforming extension (the keyword is outside the implementer's namespace), so it is placed under -fms-compatibility instead of -fms-extensions like most MSVC-specific keyword extensions. Normally, in C11, the compiler is supposed to provide the _Static_assert keyword, and assert.h should define static_assert to _Static_assert. However, that is not what MSVC does, and MSVC doesn't even provide _Static_assert. This also has the less important side effect of enabling static_assert in C++98 mode with -fms-compatibility. It's exceptionally difficult to use modern MSVC headers without C++14 even, so this is relatively unimportant. Fixes PR26672 Patch by Andrey Bokhanko! Reviewers: rsmith, thakis Subscribers: cfe-commits, STL_MSFT Differential Revision: https://reviews.llvm.org/D17444 llvm-svn: 354162
* [X86] Move all the SSE legality checks out of FP_TO_INTHelper and up to ↵Craig Topper2019-02-151-22/+14
| | | | | | | | | | LowerFP_TO_INT. NFCI These checks aren't needed on the call to FP_TO_INTHelper from the type legalizer for splitting i64. We always want to use X87 FIST/FISTT to memory there. Moving up the SSE checks will allow this routine to focus on what it cares about and makes its return semantics cleaner. llvm-svn: 354161
* Recommit "[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support."Jonas Paulsson2019-02-152-0/+42
| | | | | | | | | | | It seems there were some problem with using a .mir test. For some reason doing '-stop-before=codegenprepare' and then '-start-before=codegenprepare' on the output .mir file results in the NoVRegs Property after instruction selection. Recommitting the same test as an .ll file instead. llvm-svn: 354160
* [CodeExtractor] Do not lift lifetime.end markers for region inputsVedant Kumar2019-02-154-22/+60
| | | | | | | | | | | | | | | | | | | | | | | If a lifetime.end marker occurs along one path through the extraction region, but not another, then it's still incorrect to lift the marker, because there is some path through the extracted function which would ordinarily not reach the marker. If the call to the extracted function is in a loop, unrolling can cause inputs to the function to become optimized out as undef after the first iteration. To prevent incorrect stack slot merging in the calling function, it should be sufficient to lift lifetime.start markers for region inputs. I've tested this theory out by doing a stage2 check-all with randomized splitting enabled. This is a follow-up to r353973, and there's additional context for this change in https://reviews.llvm.org/D57834. rdar://47896986 Differential Revision: https://reviews.llvm.org/D58253 llvm-svn: 354159
* [HotColdSplit] Schedule splitting late to fix perf regressionVedant Kumar2019-02-157-36/+43
| | | | | | | | | | | | | | | With or without PGO data applied, splitting early in the pipeline (either before the inliner or shortly after it) regresses performance across SPEC variants. The cause appears to be that splitting hides context for subsequent optimizations. Schedule splitting late again, in effect reversing r352080, which scheduled the splitting pass early for code size benefits (documented in https://reviews.llvm.org/D57082). Differential Revision: https://reviews.llvm.org/D58258 llvm-svn: 354158
* Fix unsymbolized stack history printing.Evgeniy Stepanov2019-02-152-2/+7
| | | | | | | | | | | | | | | | | | | | | Summary: When symbols are unavailable, the current code prints sp: ... pc: ... (null) (null) instead of module name + offset. Change the output to include module name and offset, and also to match the regular sanitizer stack trace format so that it is recognized by symbolize.py out of the box. Reviewers: kcc, pcc Subscribers: kubamracek, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58267 llvm-svn: 354157
* Runtime flags for malloc bisection.Evgeniy Stepanov2019-02-158-19/+141
| | | | | | | | | | | | Reviewers: kcc, pcc Subscribers: kubamracek, mgorny, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58162 llvm-svn: 354156
* Fix false positive when tag_in_malloc=0,tag_in_free=1.Evgeniy Stepanov2019-02-152-4/+61
| | | | | | | | | | | | | | | | Summary: With tag_in_free=1, malloc() can not assume that the memory is untagged, and needs to retag is to 0. Reviewers: pcc, kcc Subscribers: kubamracek, jfb, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58158 llvm-svn: 354155
* [MCA] Improved code comment. NFCAndrea Di Biagio2019-02-152-11/+14
| | | | llvm-svn: 354154
* Revert "[compiler-rt] Cleanup usage of C++ ABI library"Jonas Hahnfeld2019-02-1511-75/+40
| | | | | | | This reverts r354132 because it breaks sanitizer-x86_64-linux: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/19915 llvm-svn: 354153
* Fix 80-column limit in SimplifyDemandedBits/SimplifyDemandedVectorElts. NFCI.Simon Pilgrim2019-02-151-70/+78
| | | | llvm-svn: 354152
* [Sema][NFC] SequenceChecker: Add tests for references/members, and prepare ↵Bruno Ricci2019-02-152-45/+246
| | | | | | | | | | | | | for the C++17 tests Add some tests for unsequenced operations with members and references. For now most of it is unhandled but it shows what work needs to be done. Also merge the tests for the C++17 sequencing rules in warn-unsequenced.cpp since we want to make sure that the appropriate warnings are still present in C++17 without duplicating the whole content of warn-unsequenced.cpp. llvm-svn: 354151
* [MCA][LSUnit] Return the ID of the dependent memory operation from methodAndrea Di Biagio2019-02-153-13/+21
| | | | | | | | isReady(). NFCI This is yet another change in preparation for a fix for PR37494. llvm-svn: 354150
* Disable stop-hook-threads.test on LinuxJorge Gorbe Moya2019-02-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ExecControl/StopHook/stop-hook-threads.test is flaky on Linux (it's consistently failing on my machine, but doesn't fail on a co-worker's). I'm seeing the following assertion failure: ``` CommandObject.cpp:145: bool lldb_private::CommandObject::CheckRequirements(lldb_private::CommandReturnObject&): Assertion `m_exe_ctx.GetTargetPtr() == NULL' failed. ``` Interestingly, this doesn't happen when typing the same commands in interactive mode. The cause seems to be that, in synchronous execution mode continue waits until the process stops again, and that includes running any stop-hooks for that later stop, so we end with a stack trace like this (lots of frames omitted for clarity): ``` abort() CommandObject::CheckRequirements() <-- this is again the same instance of CommandObjectProcessContinue, fails assertion because the previous continue command hasn't finished. Target::RunStopHooks() CommandObjectProcessContinue::DoExecute() Target::RunStopHooks() ``` In general, it seems like using process control commands inside stop-hooks does not have very well defined semantics. You don't even need multiple threads to make that assertion fail, you can build ``` int main() { printf("1\n"); // break1 printf("2\n"); // break2 } ``` and then on lldb ``` target stop-hook add -o continue break set -f stop-hook-simple.cpp -p "break1" break set -f stop-hook-simple.cpp -p "break2" run ``` In this case it's even worse because the presence of multiple threads makes it prone to race conditions. In some tests I ran with a simpler version of this test case, I was hitting either the previous assertion failure or the following issue: 1. Two threads reach a breakpoint 2. First stop-hook does a process continue 3. Threads end 4. Second stop-hook runs, complains about process not existing. This change disables the test on Linux. It's already marked as XFAIL on Windows, so maybe we should just delete it until it's clear what should be the expected behavior in these cases. Or maybe try to come up with a way to write a similar multithreaded test without calling continue from a stop hook, I don't know. Differential Revision: https://reviews.llvm.org/D58257 llvm-svn: 354149
* [pstl] Remove some warnings when compiling with a recent ClangLouis Dionne2019-02-155-30/+26
| | | | | | | | | There were multiple warnings for lambda captures that are unused, so I removed those captures. I also fixed a couple of -Wsign-compare warnings. Note that some warnings still remain, this change is not exhaustive. llvm-svn: 354148
* Variable auto-init of blocks capturing self after init bugfixJF Bastien2019-02-152-12/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Blocks that capture themselves (and escape) after initialization currently codegen wrong because this: bool capturedByInit = Init && emission.IsEscapingByRef && isCapturedBy(D, Init); Address Loc = capturedByInit ? emission.Addr : emission.getObjectAddress(*this); Already adjusts Loc from thr alloca to a GEP. This code: if (emission.IsEscapingByRef) Loc = emitBlockByrefAddress(Loc, &D, /*follow=*/false); Was trying to do the same adjustment, and a GEP on a GEP (returning an int) triggers an assertion. <rdar://problem/47943027> Reviewers: ahatanak Subscribers: jkorous, dexonsmith, cfe-commits, rjmccall Tags: #clang Differential Revision: https://reviews.llvm.org/D58218 llvm-svn: 354147
* [Tests] Demonstrate more missing atomicrmw transformsPhilip Reames2019-02-151-0/+84
| | | | llvm-svn: 354146
* Fix potential UB when target_file directory is nullStefan Granitz2019-02-151-0/+5
| | | | | | | | | | | | | | Summary: As seen in a crash report, the C-string returned for the directory component of `target_file` can null. It should not be assigned to `std::string` directly as this is undefined behavior. Reviewers: jingham Reviewed By: jingham Subscribers: jdoerfert, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D57964 llvm-svn: 354145
* [InstCombine] fix crash while trying to narrow a binop of shuffles (PR40734)Sanjay Patel2019-02-152-1/+17
| | | | | | https://bugs.llvm.org/show_bug.cgi?id=40734 llvm-svn: 354144
* [compiler-rt] Let CMake search for thread supportJonas Hahnfeld2019-02-151-0/+2
| | | | | | This is an educated guess to fix sanitizer-x86_64-linux after r354132. llvm-svn: 354143
* Revert r354137 - OptionalStorage implementation for trivial type, take IIISerge Guelton2019-02-151-50/+2
| | | | | | This still fails on some random platform, and I fail to reproduce the issue. llvm-svn: 354142
* [clang] Add build and install targets for clang librariesShoaib Meenai2019-02-152-0/+23
| | | | | | | | | | | | | | | This is modeled after the existing llvm-libraries target. It's a convenient way to include all clang libraries in a distribution. This differs slightly from the llvm-libraries target in that it adds any library added via add_clang_library, whereas llvm-libraries only includes targets added via add_llvm_library that didn't use the MODULE or BUILDTREE_ONLY arguments. add_clang_library doesn't appear to have any equivalents of those arguments, so the conditions don't apply. Differential Revision: https://reviews.llvm.org/D58269 llvm-svn: 354141
* [clang] Create install targets for non-shared librariesShoaib Meenai2019-02-151-1/+1
| | | | | | | | | | | I don't see a reason for these to not have install targets created, which in turn allows them to be bundled in distributions. This doesn't affect the "install" target, since that just runs all CMake install rules (and we were already creating install rules for these). Differential Revision: https://reviews.llvm.org/D58268 llvm-svn: 354140
* GlobalISel: Fix inadequate verification of g_build_vectorMatt Arsenault2019-02-152-24/+43
| | | | | | | | | | | | | Testing based on the total size of the elements failed to catch a few invalid scenarios, so explicitly check the number of elements/operands and types. This failed to catch situations like <4 x s16> = G_BUILD_VECTOR s32, s32 since the total size added up. This also would fail to catch an implicit conversion between pointers and scalars. llvm-svn: 354139
* Try to organize MachineVerifier testsMatt Arsenault2019-02-1533-8/+20
| | | | | | | | | | The Verifier is separate from the MachineVerifier, so move it to a different directory. Some other verifier tests were scattered in target codegen tests as well (although I'm sure I missed some). Work towards using a more consistent naming scheme to make it clearer where the gaps still are for generic instructions. llvm-svn: 354138
* OptionalStorage implementation for trivial type, take IIISerge Guelton2019-02-151-2/+50
| | | | | | | | | | | | | This is another attempt at implementating optional storage for trivially copyable type, using an union instead of a raw buffer to hold the actual storage. This make it possible to get rid of the reinterpret_cast, and hopefully to fix the UB of the previous attempts. This validates fine on my laptop for gcc 8.2 and gcc 4.8, I'll revert if it breaks the validation. llvm-svn: 354137
* Exteded test of .Yitzhak Mandelbaum2019-02-151-9/+13
| | | | llvm-svn: 354136
* Remove unnecessary expectation.Yitzhak Mandelbaum2019-02-151-1/+0
| | | | llvm-svn: 354135
* Added test for matcher On.Yitzhak Mandelbaum2019-02-151-12/+14
| | | | llvm-svn: 354134
* Add tests for assorted `CXXMemberCallExpr` matchers.Yitzhak Mandelbaum2019-02-151-0/+89
| | | | | | | | | | Summary: Add tests for matchers `on`, `onImplicitObjectArgument` and `hasObjectExpression`. Reviewers: alexfh, steveire, aaron.ballman Differential Revision: https://reviews.llvm.org/D56850 llvm-svn: 354133
* [compiler-rt] Cleanup usage of C++ ABI libraryJonas Hahnfeld2019-02-1510-40/+73
| | | | | | | | | Add missed value "libcxxabi" and introduce SANITIZER_TEST_CXX for linking unit tests. This needs to be a full C++ library and cannot be libcxxabi. Differential Revision: https://reviews.llvm.org/D58012 llvm-svn: 354132
* [MergeICmps] Make base ordering really deterministic.Clement Courbet2019-02-151-87/+107
| | | | | | | | | | | | | | | | | | Summary: The idea is that we now manipulate bases through a `unsigned BaseID` based on order of appearance in the comparison chain rather than through the `Value*`. Fixes 40714. Reviewers: gchatelet Subscribers: mgrang, jfb, jdoerfert, llvm-commits, hans Tags: #llvm Differential Revision: https://reviews.llvm.org/D58274 llvm-svn: 354131
* [MergeICmps][NFC] Improve doc.Clement Courbet2019-02-151-5/+28
| | | | llvm-svn: 354128
* [Analyzer] Fix for test file of bug 40625Adam Balogh2019-02-151-4/+1
| | | | | | Test fixed and changed to true positive, FIXME about false positive removed. llvm-svn: 354127
OpenPOWER on IntegriCloud