Derek Schuff [Mon, 17 Apr 2017 20:28:28 +0000 (20:28 +0000)]
[WebAssembly] Encode block signatures as SLEB instead of ULEB
Use SLEB (varint) for block_type immediates in accordance with the spec.
Patch by Yury Delendik
llvm-svn: 300490
Eric Fiselier [Mon, 17 Apr 2017 20:20:27 +0000 (20:20 +0000)]
Fix passing incorrectly value-category when constructing unique_ptr's deleter
llvm-svn: 300489
Casey Carter [Mon, 17 Apr 2017 20:15:16 +0000 (20:15 +0000)]
[optional] Update synopsis for LWG2934
(comment-only change)
llvm-svn: 300488
Yaxun Liu [Mon, 17 Apr 2017 20:10:44 +0000 (20:10 +0000)]
CodeGen: Let byval parameter use alloca address space
Differential Revision: https://reviews.llvm.org/D32133
llvm-svn: 300487
Dehao Chen [Mon, 17 Apr 2017 20:10:39 +0000 (20:10 +0000)]
Add GNU_discriminator support for inline callsites in llvm-symbolizer.
Summary: LLVM symbolize cannot recognize GNU_discriminator for inline callsites. This patch adds support for it.
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32134
llvm-svn: 300486
Yaxun Liu [Mon, 17 Apr 2017 20:03:11 +0000 (20:03 +0000)]
CodeGen: Let lifetime intrinsic use alloca address space
Differential Revision: https://reviews.llvm.org/D31717
llvm-svn: 300485
Benjamin Kramer [Mon, 17 Apr 2017 19:55:12 +0000 (19:55 +0000)]
[tsan] Add missing include for uint64_t in test.
llvm-svn: 300484
Kuba Mracek [Mon, 17 Apr 2017 19:51:58 +0000 (19:51 +0000)]
Fixup for r300473: Use %lu on Linux for tid_t in format strings.
llvm-svn: 300483
Matt Arsenault [Mon, 17 Apr 2017 19:48:30 +0000 (19:48 +0000)]
AMDGPU: Use MachineRegisterInfo to find max used register
Avoid looping through program to determine register counts.
This avoids needing to look at regmask operands.
Also fixes some counting errors with flat_scr when there
are no stack objects.
llvm-svn: 300482
Matt Arsenault [Mon, 17 Apr 2017 19:48:24 +0000 (19:48 +0000)]
AMDGPU: Change stack alignment
While the incoming stack for a kernel is 256-byte aligned,
this refers to the base address of the entire wave. This isn't
useful information for most of codegen. Fixes unnecessarily
aligning stack objects in callees.
llvm-svn: 300481
Brendon Cahoon [Mon, 17 Apr 2017 19:11:04 +0000 (19:11 +0000)]
[CodeGenPrepare] Fix crash due to an invalid CFG
The splitIndirectCriticalEdges function generates and invalid CFG when the
'Target' basic block is a loop to itself. When this occurs, the code that
updates the predecessor terminator needs to update the terminator in the split
basic block.
This occurs when there is an edge from block D back to D. Since D is split in
to D0 and D1, the code needs to update the terminator in D1. But D1 is not in
the OtherPreds vector, so it was not getting updated.
Differential Revision: https://reviews.llvm.org/D32126
llvm-svn: 300480
Benjamin Kramer [Mon, 17 Apr 2017 19:08:41 +0000 (19:08 +0000)]
Unbreak build of the wasm backend after r300463.
llvm-svn: 300479
Peter Collingbourne [Mon, 17 Apr 2017 18:53:27 +0000 (18:53 +0000)]
Bitcode: Add missing build dep to fix shlib build.
llvm-svn: 300478
Craig Topper [Mon, 17 Apr 2017 18:44:27 +0000 (18:44 +0000)]
[APInt] Remove self move check from move assignment operator
This was added to work around a bug in MSVC 2013's implementation of stable_sort. That bug has been fixed as of MSVC 2015 so we shouldn't need this anymore.
Technically the current implementation has undefined behavior because we only protect the deleting of the pVal array with the self move check. There is still a memcpy of that.VAL to VAL that isn't protected. In the case of self move those are the same local and memcpy is undefined for src and dst overlapping.
This reduces the size of the opt binary on my local x86-64 build by about 4k.
Differential Revision: https://reviews.llvm.org/D32116
llvm-svn: 300477
Davide Italiano [Mon, 17 Apr 2017 18:24:18 +0000 (18:24 +0000)]
[ClangASTContext] Placate `casts away qualifiers` warnings from GCC.
llvm-svn: 300476
Craig Topper [Mon, 17 Apr 2017 18:22:36 +0000 (18:22 +0000)]
[IR] Implement DataLayout::getPointerTypeSizeInBits using getPointerSizeInBits directly
Currently we use getTypeSizeInBits which contains a switch statement to dispatch based on what the Type is. We know we always have a pointer type here, but the compiler isn't able to figure out that out to remove the switch.
This patch changes it to just call handle the pointer type directly by calling getPointerSizeInBits without going through a switch.
getPointerTypeSizeInBits is called pretty often, particularly by getOrEnforceKnownAlignment which is used by InstCombine. This should speed that up a little bit.
Differential Revision: https://reviews.llvm.org/D31841
llvm-svn: 300475
Tim Northover [Mon, 17 Apr 2017 18:18:47 +0000 (18:18 +0000)]
AArch64: put nonlazybind special handling behind a flag for now.
It's basically a terrible idea anyway but objc_msgSend gets emitted like that.
We can decide on a better way to deal with it in the unlikely event that anyone
actually uses it.
llvm-svn: 300474
Kuba Mracek [Mon, 17 Apr 2017 18:17:38 +0000 (18:17 +0000)]
[sanitizer] Introduce tid_t as a typedef for OS-provided thread IDs
We seem to assume that OS-provided thread IDs are either uptr or int, neither of which is true on Darwin. This introduces a tid_t type, which holds a OS-provided thread ID (gettid on Linux, pthread_threadid_np on Darwin, pthread_self on FreeBSD).
Differential Revision: https://reviews.llvm.org/D31774
llvm-svn: 300473
Konstantin Zhuravlyov [Mon, 17 Apr 2017 18:12:45 +0000 (18:12 +0000)]
AMDGPU: Test handling of R_AMDGPU_ABS64 in RelocVisitor
llvm-svn: 300472
Craig Topper [Mon, 17 Apr 2017 18:12:30 +0000 (18:12 +0000)]
[IR] Put the Use list waymarking bits in the bit positions documentation says they are using
The documentation for the waymarking algorithm says that we use the lower 2 bits of Use::Prev to store the way marking bits. But because we use a PointerIntPair with the default PointerLikeTypeTraits, we're using bits 2:1 on 64-bit targets.
There's also a trick employed for distinguishing Users that have Uses stored with them and Users that have Uses stored in a separate array. The documentation says we use the LSB of the first byte of the real User object or the User* that occurs at the end of the Use array. But again due to the PointerLikeTypeTraits we're really using bit 2(64-bit) or bit 1(32-bit) and not the LSB. This is a little worrying because the first byte of the User object is the vtable ptr so we're assuming the vtable has 8 byte or 4 byte alignment where what is documented would only require 2 byte alignment.
This patch provides a custom traits override for these two cases to put the bits where the documentation says they are. It also has the side effect of removing some shifts from the waymarking traversal implementation.
Differential Revision: https://reviews.llvm.org/D31733
llvm-svn: 300471
Konstantin Zhuravlyov [Mon, 17 Apr 2017 18:02:09 +0000 (18:02 +0000)]
AMDGPU: Set CodePointerSize to 8 for amdgcn
llvm-svn: 300470
Adrian Prantl [Mon, 17 Apr 2017 17:57:05 +0000 (17:57 +0000)]
Add additional CHECKs to safestack.c.
llvm-svn: 300469
Adrian Prantl [Mon, 17 Apr 2017 17:57:03 +0000 (17:57 +0000)]
Revert "Revert "Add a test for debug info with the safestack sanitizer enabled.""
This reapplies commit r299730 with an additional REQUIRES line.
llvm-svn: 300468
Adrian Prantl [Mon, 17 Apr 2017 17:57:01 +0000 (17:57 +0000)]
Revert "Revert "Add a test for __block variables + asan.""
This reapplies commit r300228.
llvm-svn: 300467
Adrian Prantl [Mon, 17 Apr 2017 17:56:59 +0000 (17:56 +0000)]
Revert "Revert "Add an end-to-end testcase for address sanitizer.""
This reapplies r299731 and adds an appropriate REQUIRES line.
llvm-svn: 300466
Peter Collingbourne [Mon, 17 Apr 2017 17:55:24 +0000 (17:55 +0000)]
Object: Use offset+size as the irsymtab string representation.
This is consistent with the bitcode string table.
Differential Revision: https://reviews.llvm.org/D31922
llvm-svn: 300465
Peter Collingbourne [Mon, 17 Apr 2017 17:51:36 +0000 (17:51 +0000)]
Bitcode: Add a string table to the bitcode format.
Add a top-level STRTAB block containing a string table blob, and start storing
strings for module codes FUNCTION, GLOBALVAR, ALIAS, IFUNC and COMDAT in
the string table.
This change allows us to share names between globals and comdats as well
as between modules, and improves the efficiency of loading bitcode files by
no longer using a bit encoding for symbol names. Once we start writing the
irsymtab to the bitcode file we will also be able to share strings between
it and the module.
On my machine, link time for Chromium for Linux with ThinLTO decreases by
about 7% for no-op incremental builds or about 1% for full builds. Total
bitcode file size decreases by about 3%.
As discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2017-April/111732.html
Differential Revision: https://reviews.llvm.org/D31838
llvm-svn: 300464
Konstantin Zhuravlyov [Mon, 17 Apr 2017 17:41:25 +0000 (17:41 +0000)]
Distinguish between code pointer size and DataLayout::getPointerSize() in DWARF info generation
llvm-svn: 300463
Tim Northover [Mon, 17 Apr 2017 17:27:56 +0000 (17:27 +0000)]
AArch64: support nonlazybind
It's almost certainly not a good idea to actually use it in most cases (there's
a pretty large code size overhead on AArch64), but we can't do those
experiments until it's supported.
llvm-svn: 300462
David Blaikie [Mon, 17 Apr 2017 17:16:19 +0000 (17:16 +0000)]
Use default ref capture to simplify local lambdas, use a template to avoid std::function overhead, other cleanup
llvm-svn: 300461
Ahmed Bougacha [Mon, 17 Apr 2017 16:59:29 +0000 (16:59 +0000)]
Revert "Add a test for debug info with the safestack sanitizer enabled."
This reverts commit r299730.
It's causing failures on a bot because of missing compiler-rt:
http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan_check
llvm-svn: 300460
Ahmed Bougacha [Mon, 17 Apr 2017 16:59:27 +0000 (16:59 +0000)]
Revert "Add an end-to-end testcase for address sanitizer."
This reverts commit r299731.
It's causing failures on a bot because of missing compiler-rt:
http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan_check
llvm-svn: 300459
Ahmed Bougacha [Mon, 17 Apr 2017 16:59:25 +0000 (16:59 +0000)]
Revert "Add a test for __block variables + asan."
This reverts commit r300228.
It's causing failures on a bot because of missing compiler-rt:
http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan_check
llvm-svn: 300458
Craig Topper [Mon, 17 Apr 2017 16:38:20 +0000 (16:38 +0000)]
Introduce APInt::isSignBitSet/isSignBitClear. Use in place isSignBitSet in place of isNegative in known bits tracking.
This makes statements like KnownZero.isNegative() (which means the value we're tracking is positive) less confusing.
llvm-svn: 300457
Francis Ricci [Mon, 17 Apr 2017 16:34:38 +0000 (16:34 +0000)]
Don't read non-readable address ranges during lsan pointer scanning
Summary: This specifically addresses the Mach-O zero page, which we cannot read from.
Reviewers: kubamracek, samsonov, alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32044
llvm-svn: 300456
Greg Clayton [Mon, 17 Apr 2017 16:20:22 +0000 (16:20 +0000)]
Don't ever reduce the timeout of a packet, only increase it.
Differential Revision: https://reviews.llvm.org/D32087
llvm-svn: 300455
Akira Hatanaka [Mon, 17 Apr 2017 15:21:55 +0000 (15:21 +0000)]
[ObjC] Mark loads from __NSArray0 and __NSDictionary0 as invariant.load.
Also, simplify code by calling MakeNaturalAlignAddrLValue.
This is a follow-up to r300396.
llvm-svn: 300454
Matt Arsenault [Mon, 17 Apr 2017 15:12:44 +0000 (15:12 +0000)]
AMDGPU: SimplifyDemandedElts for image intrinsics
Causes some VGPR usage improvements in shaderdb, but
introduces some SGPR spilling regressions due to random
scheduling changes later.
llvm-svn: 300453
Davide Italiano [Mon, 17 Apr 2017 14:32:05 +0000 (14:32 +0000)]
[LCSSA] Don't insert tokens into the worklist at all.
We're gonna skip them anyway, so there's no point in inserting them
in the first place.
llvm-svn: 300452
Marshall Clow [Mon, 17 Apr 2017 14:18:44 +0000 (14:18 +0000)]
Sigh. Once again forgot about the 'no exceptions' bots.
llvm-svn: 300451
Francis Ricci [Mon, 17 Apr 2017 14:07:06 +0000 (14:07 +0000)]
Scan Kernel Alloc Once page for global pointers
Summary: libxpc stashes some pointers here.
Reviewers: kubamracek, alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32045
llvm-svn: 300450
Marshall Clow [Mon, 17 Apr 2017 13:19:14 +0000 (13:19 +0000)]
Mark LWG#2853 as complete. No code changes required, but added a couple of extra tests
llvm-svn: 300449
Andrey Churbanov [Mon, 17 Apr 2017 11:58:20 +0000 (11:58 +0000)]
Fix crash in invoking microtask on ios arm64.
Patch by Ni Hui.
Differential Revision: https://reviews.llvm.org/D31923
llvm-svn: 300448
Amaury Sechet [Mon, 17 Apr 2017 11:52:54 +0000 (11:52 +0000)]
Introducing LLVMMetadataRef
Summary:
This seems like an uncontroversial first step toward providing access to the metadata hierarchy that now exists in LLVM. This should allow for good debug info support from C.
Future plans are to deprecate API that take mixed bags of values and metadata (mainly the LLVMMDNode family of functions) and migrate the rest toward the use of LLVMMetadataRef.
Once this is in place, mapping of DIBuilder will be able to start.
Reviewers: mehdi_amini, echristo, whitequark, jketema, Wallbraker
Reviewed By: Wallbraker
Subscribers: Eugene.Zelenko, axw, mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D19448
llvm-svn: 300447
Max Kazantsev [Mon, 17 Apr 2017 09:52:02 +0000 (09:52 +0000)]
[LoopPeeling] Get rid of Phis that become invariant after N steps
This patch is a generalization of the improvement introduced in rL296898.
Previously, we were able to peel one iteration of a loop to get rid of a Phi that becomes
an invariant on the 2nd iteration. In more general case, if a Phi becomes invariant after
N iterations, we can peel N times and turn it into invariant.
In order to do this, we for every Phi in loop's header we define the Invariant Depth value
which is calculated as follows:
Given %x = phi <Inputs from above the loop>, ..., [%y, %back.edge].
If %y is a loop invariant, then Depth(%x) = 1.
If %y is a Phi from the loop header, Depth(%x) = Depth(%y) + 1.
Otherwise, Depth(%x) is infinite.
Notice that if we peel a loop, all Phis with Depth = 1 become invariants,
and all other Phis with finite depth decrease the depth by 1.
Thus, peeling N first iterations allows us to turn all Phis with Depth <= N
into invariants.
Reviewers: reames, apilipenko, mkuper, skatkov, anna, sanjoy
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31613
llvm-svn: 300446
George Rimar [Mon, 17 Apr 2017 09:04:07 +0000 (09:04 +0000)]
[ELF] - Add compress-debug-output-i386.s testcase.
This is for --compress-debug-sections (r300444), we have
x64 testcase, but did not have i386 one.
llvm-svn: 300445
George Rimar [Mon, 17 Apr 2017 08:58:12 +0000 (08:58 +0000)]
[ELF] - Implemented --compress-debug-sections option.
Patch implements --compress-debug-sections=zlib.
In compare with D20211 (a year old patch, abandoned), it implementation
uses streaming and fully reimplemented, does not support zlib-gnu for
simplification.
This is PR32308.
Differential revision: https://reviews.llvm.org/D31941
llvm-svn: 300444
Yaron Keren [Mon, 17 Apr 2017 08:51:20 +0000 (08:51 +0000)]
Address bugs.llvm.org/pr30994 so that a non-friend can properly replace a friend, and a visible friend can properly replace an invisible friend but not vice verse, and definitions are not replaced. This fixes the two FIXME in SemaTemplate/friend-template.cpp.
The code implements Richard Smith suggestion in comment 3 of the PR.
reviewer: Vassil Vassilev
Differential Revision: https://reviews.llvm.org/D31540
llvm-svn: 300443
Serguei Katkov [Mon, 17 Apr 2017 06:39:47 +0000 (06:39 +0000)]
[BPI] NFC: reorder ifs to bail out earlier
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
Max Kazantsev [Mon, 17 Apr 2017 05:38:28 +0000 (05:38 +0000)]
[LoopPeeling] Fix condition for phi-eliminating peeling
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
Serguei Katkov [Mon, 17 Apr 2017 04:33:04 +0000 (04:33 +0000)]
[BPI] Use metadata info before any other heuristics
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
Craig Topper [Mon, 17 Apr 2017 03:41:47 +0000 (03:41 +0000)]
[InstCombine] Simplify 1/X for vectors.
llvm-svn: 300439
Craig Topper [Mon, 17 Apr 2017 03:41:44 +0000 (03:41 +0000)]
[InstCombine] Add test cases for missing support for simplifying 1/X for vectors. NFC
llvm-svn: 300438
Craig Topper [Mon, 17 Apr 2017 01:51:24 +0000 (01:51 +0000)]
[InstCombine] Add support for vector srem->urem.
llvm-svn: 300437
Craig Topper [Mon, 17 Apr 2017 01:51:21 +0000 (01:51 +0000)]
[InstCombine] Add missing testcases for srem->urem conversion. The vector version isn't currently supported. NFC
llvm-svn: 300436
Craig Topper [Mon, 17 Apr 2017 01:51:19 +0000 (01:51 +0000)]
[InstCombine] Add support for turning vector sdiv into udiv.
llvm-svn: 300435
Craig Topper [Mon, 17 Apr 2017 01:51:16 +0000 (01:51 +0000)]
[InstCombine] Add test cases for missing support for turning vector sdiv into udiv. NFC
llvm-svn: 300434
Davide Italiano [Mon, 17 Apr 2017 00:02:45 +0000 (00:02 +0000)]
[LCSSA] Simplify a loop. NFCI.
llvm-svn: 300433
Craig Topper [Sun, 16 Apr 2017 21:46:12 +0000 (21:46 +0000)]
[InstCombine][ValueTracking] When computing known bits for Srem make sure we 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
Davide Italiano [Sun, 16 Apr 2017 21:07:04 +0000 (21:07 +0000)]
[LCSSA] Fix non-determinism due to iterating over a SmallPtrSet.
Use a SmallSetVector instead.
llvm-svn: 300431
Craig Topper [Sun, 16 Apr 2017 20:55:58 +0000 (20:55 +0000)]
[InstCombine] In SimplifyDemandedUseBits, don't bother to mask known bits of constants with DemandedMask.
Just because we didn't demand them doesn't mean they aren't known.
llvm-svn: 300430
Benjamin Kramer [Sun, 16 Apr 2017 20:13:08 +0000 (20:13 +0000)]
[X86] Remove special handling for 16 bit for A asm constraints.
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
Bryant Wong [Sun, 16 Apr 2017 19:45:51 +0000 (19:45 +0000)]
MemorySSA: Stop tracking def-or-use blocks.
The tracking is unused, since MemoryPhis are not pruned as of r282419.
Differential Revision: https://reviews.llvm.org/D32121
llvm-svn: 300428
Alexander Shaposhnikov [Sun, 16 Apr 2017 19:05:17 +0000 (19:05 +0000)]
[clang] Register isConstexpr matcher
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
Sanjay Patel [Sun, 16 Apr 2017 17:43:11 +0000 (17:43 +0000)]
[InstSimplify] improve getTrue/getFalse; NFCI
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
Dimitry Andric [Sun, 16 Apr 2017 17:22:44 +0000 (17:22 +0000)]
Garbage collect HAVE_EXECINFO_H from config.h.cmake after r300062. NFCI.
llvm-svn: 300425
Sanjay Patel [Sun, 16 Apr 2017 17:00:21 +0000 (17:00 +0000)]
[Constants] simplify get true/false code; NFCI
llvm-svn: 300424
Yaron Keren [Sun, 16 Apr 2017 15:53:19 +0000 (15:53 +0000)]
Use setUsedForHeaderGuard() accessor function instead of direcly accessing UsedForHeaderGuard.
llvm-svn: 300423
Michael Zuckerman [Sun, 16 Apr 2017 13:26:08 +0000 (13:26 +0000)]
[X86][X86 intrinsics]Folding cmp(sub(a,b),0) into cmp(a,b) optimization
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
Eric Fiselier [Sun, 16 Apr 2017 09:34:28 +0000 (09:34 +0000)]
Revert r300420 - [coroutines] Fix building of new/delete expressions when get_return_object_on_allocation_failure() is present
llvm-svn: 300421
Eric Fiselier [Sun, 16 Apr 2017 09:19:59 +0000 (09:19 +0000)]
[coroutines] Fix building of new/delete expressions when 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
Petr Hosek [Sun, 16 Apr 2017 06:08:44 +0000 (06:08 +0000)]
[CMake][libunwind] Fix the -target and -gcc-toolchain flag handling
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
Petr Hosek [Sun, 16 Apr 2017 06:08:34 +0000 (06:08 +0000)]
[CMake][libcxxabi] Fix the -target and -gcc-toolchain flag handling
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
Eric Fiselier [Sun, 16 Apr 2017 04:05:15 +0000 (04:05 +0000)]
Cleanup one more <forward_list> test
llvm-svn: 300417
Kuba Mracek [Sun, 16 Apr 2017 04:02:45 +0000 (04:02 +0000)]
ThreadSanitizer plugin: Support Swift access races and fix how external races are displayed.
llvm-svn: 300416
Eric Fiselier [Sun, 16 Apr 2017 04:02:01 +0000 (04:02 +0000)]
Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <forward_list>
llvm-svn: 300415
Eric Fiselier [Sun, 16 Apr 2017 03:45:35 +0000 (03:45 +0000)]
Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <list>
llvm-svn: 300414
Eric Fiselier [Sun, 16 Apr 2017 03:17:01 +0000 (03:17 +0000)]
Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in deque
llvm-svn: 300413
Eric Fiselier [Sun, 16 Apr 2017 02:50:40 +0000 (02:50 +0000)]
Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <array>
llvm-svn: 300412
Eric Fiselier [Sun, 16 Apr 2017 02:47:46 +0000 (02:47 +0000)]
Workaround Clang bug regarding template template parameters
llvm-svn: 300411
Eric Fiselier [Sun, 16 Apr 2017 02:40:45 +0000 (02:40 +0000)]
Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector.
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
Petr Hosek [Sun, 16 Apr 2017 02:25:55 +0000 (02:25 +0000)]
[CMake][libcxx] Fix the --target and --gcc-toolchain flag handling
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
Eric Fiselier [Sun, 16 Apr 2017 02:14:31 +0000 (02:14 +0000)]
Cleanup and better scope unique_ptr internals
llvm-svn: 300408
Eric Fiselier [Sun, 16 Apr 2017 02:06:25 +0000 (02:06 +0000)]
Cleanup default_delete specializations
llvm-svn: 300407
Eric Fiselier [Sun, 16 Apr 2017 01:51:04 +0000 (01:51 +0000)]
Overhaul unique_ptr - Implement LWG 2801, 2905, 2520.
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
Craig Topper [Sun, 16 Apr 2017 01:03:51 +0000 (01:03 +0000)]
[APInt] Fix a bug in lshr by a value more than 64 bits above the bit width.
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
Dimitry Andric [Sat, 15 Apr 2017 22:15:01 +0000 (22:15 +0000)]
Use correct registers for "A" inline asm constraint
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
Eric Fiselier [Sat, 15 Apr 2017 19:32:02 +0000 (19:32 +0000)]
Implement LWG 2857 for variant. Tests from Casey Carter @ Microsoft.
Also mark LWG 2857 as complete, since the changes to optional and
any were completed by Marshall earlier.
llvm-svn: 300403
Sanjay Patel [Sat, 15 Apr 2017 17:55:06 +0000 (17:55 +0000)]
[InstCombine] allow (X != C1 && X != C2) and similar patterns to match splat vector constants
llvm-svn: 300402
Sanjay Patel [Sat, 15 Apr 2017 17:50:45 +0000 (17:50 +0000)]
[InstCombine] add tests to show missing transforms for vectors; NFC
llvm-svn: 300401
Aaron Ballman [Sat, 15 Apr 2017 12:53:20 +0000 (12:53 +0000)]
Add isStaticStorageClass to the dynamic matcher registry so that it can be used from clang-query.
Patch by Dave Lee.
llvm-svn: 300400
Eric Fiselier [Sat, 15 Apr 2017 12:05:11 +0000 (12:05 +0000)]
Simplify test helper
llvm-svn: 300399
Tobias Grosser [Sat, 15 Apr 2017 08:15:54 +0000 (08:15 +0000)]
Update isl bindings to latest version (+ Polly extensions)
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
Eric Fiselier [Sat, 15 Apr 2017 06:49:02 +0000 (06:49 +0000)]
Fix PR32642 - string::insert and string::append don't work with move_iterator.
llvm-svn: 300397
Akira Hatanaka [Sat, 15 Apr 2017 06:42:00 +0000 (06:42 +0000)]
[ObjC] Use empty Objective-C collection literal constants when
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
Eric Christopher [Sat, 15 Apr 2017 06:15:00 +0000 (06:15 +0000)]
When we turn on vsx it should also turn on altivec explicitly, same
with disabling it as well as disabling all vsx specific features when
turning off altivec.
Fixes PR32663.
llvm-svn: 300395
Eric Christopher [Sat, 15 Apr 2017 06:14:52 +0000 (06:14 +0000)]
Tidy checking for the soft float attribute.
llvm-svn: 300394
Eric Christopher [Sat, 15 Apr 2017 06:14:50 +0000 (06:14 +0000)]
Cache the DataLayout rather than looking it up frequently.
llvm-svn: 300393
Serge Pavlov [Sat, 15 Apr 2017 05:53:49 +0000 (05:53 +0000)]
Do not run tests for crash recovery if libstdc++ safe mode is enabled
If expensive checks are enabled, safe mode of libstdc++ is enabled too.
In this mode the library uses more complex data that allow additional
checks, for instance, a container may keep list of iterators that points
to it. If a code crashes it can leave these complex library objects in
inconsistent state. It occurs in a few tests that check error recovery
if compiler crashes. These test hang in expensive check mode, as the
library tries to synchronize access to the iterators pointing to some
container, but corresponding mutex remains locked after the crash.
This fix marks these tests as unsupported if clang is built with
libstdc++ safe mode enabled.
Differential Revision: https://reviews.llvm.org/D31126
llvm-svn: 300392
Akira Hatanaka [Sat, 15 Apr 2017 05:44:27 +0000 (05:44 +0000)]
Revert "[ObjC] Use empty Objective-C collection literal constants when"
This reverts commit r300389. There were mistakes in the changes I made
to CodeGen.
llvm-svn: 300391