summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [BPI] NFC: reorder ifs to bail out earlierSerguei Katkov2017-04-171-19/+18
| | | | | | | | | | | | | | | This is non-functional change to re-order if statements to bail out earlier from unreachable and ColdCall heuristics. Reviewers: sanjoy, reames, junbuml, vsk, chandlerc Reviewed By: chandlerc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31704 llvm-svn: 300442
* [LoopPeeling] Fix condition for phi-eliminating peelingMax Kazantsev2017-04-173-2/+31
| | | | | | | | | | | | | | | | | When peeling loops basing on phis becoming invariants, we make a wrong loop size check. UP.Threshold should be compared against the total numbers of instructions after the transformation, which is equal to 2 * LoopSize in case of peeling one iteration. We should also check that the maximum allowed number of peeled iterations is not zero. Reviewers: sanjoy, anna, reames, mkuper Reviewed By: mkuper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31753 llvm-svn: 300441
* [BPI] Use metadata info before any other heuristicsSerguei Katkov2017-04-172-19/+306
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Metadata potentially is more precise than any heuristics we use, so it makes sense to use first metadata info if it is available. However it makes sense to examine it against other strong heuristics like unreachable one. If edge coming to unreachable block has higher probability then it is expected by unreachable heuristic then we use heuristic and remaining probability is distributed among other reachable blocks equally. An example where metadata might be more strong then unreachable heuristic is as follows: it is possible that there are two branches and for the branch A metadata says that its probability is (0, 2^25). For the branch B the probability is (1, 2^25). So the expectation is that first edge of B is hotter than first edge of A because first edge of A did not executed at least once. If first edge of A points to the unreachable block then using the unreachable heuristics we'll set the probability for A to (1, 2^20) and now edge of A becomes hotter than edge of B. This is unexpected behavior. This fixed the biggest part of https://bugs.llvm.org/show_bug.cgi?id=32214 Reviewers: sanjoy, junbuml, vsk, chandlerc Reviewed By: chandlerc Subscribers: llvm-commits, reames, davidxl Differential Revision: https://reviews.llvm.org/D30631 llvm-svn: 300440
* [InstCombine] Simplify 1/X for vectors.Craig Topper2017-04-172-18/+20
| | | | llvm-svn: 300439
* [InstCombine] Add test cases for missing support for simplifying 1/X for ↵Craig Topper2017-04-171-0/+18
| | | | | | vectors. NFC llvm-svn: 300438
* [InstCombine] Add support for vector srem->urem.Craig Topper2017-04-172-8/+6
| | | | llvm-svn: 300437
* [InstCombine] Add missing testcases for srem->urem conversion. The vector ↵Craig Topper2017-04-171-0/+22
| | | | | | version isn't currently supported. NFC llvm-svn: 300436
* [InstCombine] Add support for turning vector sdiv into udiv.Craig Topper2017-04-173-26/+21
| | | | llvm-svn: 300435
* [InstCombine] Add test cases for missing support for turning vector sdiv ↵Craig Topper2017-04-172-0/+26
| | | | | | into udiv. NFC llvm-svn: 300434
* [LCSSA] Simplify a loop. NFCI.Davide Italiano2017-04-171-7/+3
| | | | llvm-svn: 300433
* [InstCombine][ValueTracking] When computing known bits for Srem make sure we ↵Craig Topper2017-04-162-10/+7
| | | | | | | | don't compute known bits for the LHS twice. If we already called computeKnownBits for the RHS being a constant power of 2, we've already computed everything we can and should just stop. I think previously we would still recurse if we had determined the result was negative or had not determined the sign bit at all. llvm-svn: 300432
* [LCSSA] Fix non-determinism due to iterating over a SmallPtrSet.Davide Italiano2017-04-161-3/+3
| | | | | | Use a SmallSetVector instead. llvm-svn: 300431
* [InstCombine] In SimplifyDemandedUseBits, don't bother to mask known bits of ↵Craig Topper2017-04-161-3/+3
| | | | | | | | constants with DemandedMask. Just because we didn't demand them doesn't mean they aren't known. llvm-svn: 300430
* [X86] Remove special handling for 16 bit for A asm constraints.Benjamin Kramer2017-04-163-8/+11
| | | | | | | | | | Our 16 bit support is assembler-only + the terrible hack that is .code16gcc. Simply using 32 bit registers does the right thing for the latter. Fixes PR32681. llvm-svn: 300429
* MemorySSA: Stop tracking def-or-use blocks.Bryant Wong2017-04-161-3/+0
| | | | | | | | The tracking is unused, since MemoryPhis are not pruned as of r282419. Differential Revision: https://reviews.llvm.org/D32121 llvm-svn: 300428
* [clang] Register isConstexpr matcherAlexander Shaposhnikov2017-04-161-0/+1
| | | | | | | | | | | | | This diff registers isConstexpr matcher. Test plan: make check-all check that "match varDecl(isConstexpr())" works in clang-query Differential revision: https://reviews.llvm.org/D32112 llvm-svn: 300427
* [InstSimplify] improve getTrue/getFalse; NFCISanjay Patel2017-04-161-10/+6
| | | | | | | | The ConstantInt version has the same assert, and using null/allOnes is likely less efficient. The only advantage of these local variants (and there's probably a better way to achieve this?) is to save typing "ConstantInt::" over and over. llvm-svn: 300426
* Garbage collect HAVE_EXECINFO_H from config.h.cmake after r300062. NFCI.Dimitry Andric2017-04-161-3/+0
| | | | llvm-svn: 300425
* [Constants] simplify get true/false code; NFCISanjay Patel2017-04-161-18/+10
| | | | llvm-svn: 300424
* Use setUsedForHeaderGuard() accessor function instead of direcly accessing ↵Yaron Keren2017-04-161-3/+2
| | | | | | UsedForHeaderGuard. llvm-svn: 300423
* [X86][X86 intrinsics]Folding cmp(sub(a,b),0) into cmp(a,b) optimizationMichael Zuckerman2017-04-162-0/+212
| | | | | | | | | This patch adds new optimization (Folding cmp(sub(a,b),0) into cmp(a,b)) to instCombineCall pass and was written specific for X86 CMP intrinsics. Differential Revision: https://reviews.llvm.org/D31398 llvm-svn: 300422
* Revert r300420 - [coroutines] Fix building of new/delete expressions when ↵Eric Fiselier2017-04-164-152/+12
| | | | | | get_return_object_on_allocation_failure() is present llvm-svn: 300421
* [coroutines] Fix building of new/delete expressions when ↵Eric Fiselier2017-04-164-12/+152
| | | | | | | | | | | | | | | | | | | | | | get_return_object_on_allocation_failure() is present. Summary: This patch implements [dcl.fct.def.coroutine]p8: > The unqualified-id get_return_object_on_allocation_failure is looked up in the scope of > class P by class member access lookup (3.4.5). If a declaration is found, ..., and if a > global allocation function is selected, the ::operator new(size_t, nothrow_t) form shall be used. > [...] > The allocation function used in this case must have a non-throwing noexcept-specification. Reviewers: GorNishanov, rsmith, majnemer, aaron.ballman Reviewed By: GorNishanov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31562 llvm-svn: 300420
* [CMake][libunwind] Fix the -target and -gcc-toolchain flag handlingPetr Hosek2017-04-162-4/+4
| | | | | | | | | | | | | CMake has the problem with the single dash variant because of the space, so use the double dash with equal sign version. The compile flag handling had a typo which caused these flag not to be properly include. We also don't have to pass the target triple when checking for compiler-rt since that flag is already included in compile flags now. Differential Revision: https://reviews.llvm.org/D32071 llvm-svn: 300419
* [CMake][libcxxabi] Fix the -target and -gcc-toolchain flag handlingPetr Hosek2017-04-162-3/+4
| | | | | | | | | | | | CMake has the problem with the single dash variant because of the space, so use the double dash with equal sign version. These flag need to be included in compile flags to propagate correctly. We also don't have to pass the target triple when checking for compiler-rt since that flag is already included in compile flags now. Differential Revision: https://reviews.llvm.org/D32069 llvm-svn: 300418
* Cleanup one more <forward_list> testEric Fiselier2017-04-162-35/+5
| | | | llvm-svn: 300417
* ThreadSanitizer plugin: Support Swift access races and fix how external ↵Kuba Mracek2017-04-162-17/+39
| | | | | | races are displayed. llvm-svn: 300416
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <forward_list>Eric Fiselier2017-04-1612-124/+69
| | | | llvm-svn: 300415
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <list>Eric Fiselier2017-04-1610-100/+62
| | | | llvm-svn: 300414
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in dequeEric Fiselier2017-04-1611-144/+98
| | | | llvm-svn: 300413
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <array>Eric Fiselier2017-04-162-3/+5
| | | | llvm-svn: 300412
* Workaround Clang bug regarding template template parametersEric Fiselier2017-04-161-5/+11
| | | | llvm-svn: 300411
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector.Eric Fiselier2017-04-1620-146/+103
| | | | | | | | | | | | | This patch cleans up all usages of the following feature test macros inside <vector> and its tests: * _LIBCPP_HAS_NO_RVALUE_REFERENCES * _LIBCPP_HAS_NO_VARIADICS * _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS Where needed the above guards were replaced with _LIBCPP_CXX03_LANG. llvm-svn: 300410
* [CMake][libcxx] Fix the --target and --gcc-toolchain flag handlingPetr Hosek2017-04-162-3/+3
| | | | | | | | | | | CMake has the problem with the single dash variant because of the space, so use the double dash with equal sign version. We also don't have to pass the target triple when checking for compiler-rt since that flag is already included in compile flags now. Differential Revision: https://reviews.llvm.org/D32068 llvm-svn: 300409
* Cleanup and better scope unique_ptr internalsEric Fiselier2017-04-161-25/+20
| | | | llvm-svn: 300408
* Cleanup default_delete specializationsEric Fiselier2017-04-161-55/+43
| | | | llvm-svn: 300407
* Overhaul unique_ptr - Implement LWG 2801, 2905, 2520.Eric Fiselier2017-04-1619-428/+1278
| | | | | | | | | | | | | | | | | | | | | This patch overhauls both specializations of unique_ptr while implementing the following LWG issues: * LWG 2801 - This issue constrains unique_ptr's constructors when the deleter type is not default constructible. Additionally it adds SFINAE conditions to unique_ptr<T[]>::unique_ptr(Up). * LWG 2905 - This issue reworks the unique_ptr(pointer, /* see below */ deleter) constructors so that they correctly SFINAE when the deleter argument cannot be used to construct the stored deleter. * LWG 2520 - This issue fixes initializing unique_ptr<T[]> from nullptr. Libc++ had previously implemented this issue, but the suggested resolution still broke initialization from NULL. This patch re-works the unique_ptr<T[]>(Up, deleter) overloads so that they accept NULL as well as nullptr. llvm-svn: 300406
* [APInt] Fix a bug in lshr by a value more than 64 bits above the bit width.Craig Topper2017-04-162-1/+6
| | | | | | This was throwing an assert because we determined the intra-word shift amount by subtracting the size of the full word shift from the total shift amount. But we failed to account for the fact that we clipped the full word shifts by total words first. To fix this just calculate the intra-word shift as the remainder of dividing by bits per word. llvm-svn: 300405
* Use correct registers for "A" inline asm constraintDimitry Andric2017-04-153-4/+51
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: In PR32594, inline assembly using the 'A' constraint on x86_64 causes llvm to crash with a "Cannot select" stack trace. This is because `X86TargetLowering::getRegForInlineAsmConstraint` hardcodes that 'A' means the EAX and EDX registers. However, on x86_64 it means the RAX and RDX registers, and on 16-bit x86 (ia16?) it means the old AX and DX registers. Add new register classes in `X86RegisterInfo.td` to support these cases, and amend the logic in `getRegForInlineAsmConstraint` to cope with different subtargets. Also add a test case, derived from PR32594. Reviewers: craig.topper, qcolombet, RKSimon, ab Reviewed By: ab Subscribers: ab, emaste, royger, llvm-commits Differential Revision: https://reviews.llvm.org/D31902 llvm-svn: 300404
* Implement LWG 2857 for variant. Tests from Casey Carter @ Microsoft.Eric Fiselier2017-04-156-47/+102
| | | | | | | Also mark LWG 2857 as complete, since the changes to optional and any were completed by Marshall earlier. llvm-svn: 300403
* [InstCombine] allow (X != C1 && X != C2) and similar patterns to match splat ↵Sanjay Patel2017-04-152-28/+26
| | | | | | vector constants llvm-svn: 300402
* [InstCombine] add tests to show missing transforms for vectors; NFCSanjay Patel2017-04-151-0/+26
| | | | llvm-svn: 300401
* Add isStaticStorageClass to the dynamic matcher registry so that it can be ↵Aaron Ballman2017-04-151-0/+1
| | | | | | | | used from clang-query. Patch by Dave Lee. llvm-svn: 300400
* Simplify test helperEric Fiselier2017-04-151-7/+1
| | | | llvm-svn: 300399
* Update isl bindings to latest version (+ Polly extensions)Tobias Grosser2017-04-152-83/+87
| | | | | | | | | After the isl C++ binding generator is now close to being upstreamed to isl, we synchronize the latest changes to Polly. These are mostly formatting changes plus a small interface change for the foreach callback function and some naming changes in isl::boolean. llvm-svn: 300398
* Fix PR32642 - string::insert and string::append don't work with move_iterator.Eric Fiselier2017-04-153-6/+51
| | | | llvm-svn: 300397
* [ObjC] Use empty Objective-C collection literal constants whenAkira Hatanaka2017-04-154-2/+91
| | | | | | | | | | | | | available. Original patch by Douglas Gregor with minor modifications. This recommits r300389, which broke bots because there have been API changes since the original patch was written. rdar://problem/20689633 llvm-svn: 300396
* When we turn on vsx it should also turn on altivec explicitly, sameEric Christopher2017-04-152-19/+29
| | | | | | | | | with disabling it as well as disabling all vsx specific features when turning off altivec. Fixes PR32663. llvm-svn: 300395
* Tidy checking for the soft float attribute.Eric Christopher2017-04-151-10/+1
| | | | llvm-svn: 300394
* Cache the DataLayout rather than looking it up frequently.Eric Christopher2017-04-151-20/+14
| | | | llvm-svn: 300393
OpenPOWER on IntegriCloud