Lei Zhang [Sun, 26 Jan 2020 15:19:24 +0000 (10:19 -0500)]
[mlir][spirv] Add spv.GroupNonUniformElect and spv.GroupNonUniformIAdd
Differential Revision: https://reviews.llvm.org/D73349
Simon Pilgrim [Sun, 26 Jan 2020 14:35:56 +0000 (14:35 +0000)]
[X86][AVX] Add tests showing combineCommutableSHUFP failure to handle v8f32 and v16f32 commutable shufps patterns
Simon Pilgrim [Sun, 26 Jan 2020 14:31:26 +0000 (14:31 +0000)]
[X86][SSE] combineCommutableSHUFP - permilps(shufps(load(),x)) --> permilps(shufps(x,load()))
Pull out combineTargetShuffle code added in rG3fd5d1c6e7db into a helper function and extend it to handle shufps(shufps(load(),x),y) and shufps(y,shufps(load(),x)) cases as well.
Serge Pavlov [Wed, 7 Aug 2019 16:31:26 +0000 (23:31 +0700)]
[FPEnv] Extended FPOptions with new attributes
This change added two new attributes, rounding mode and exception
behavior to the structure FPOptions. These attributes allow more
flexible treatment of specific floating point environment than it is
provided by #pragma STDC FENV_ACCESS.
Differential Revision: https://reviews.llvm.org/D65994
Simon Pilgrim [Sun, 26 Jan 2020 10:01:21 +0000 (10:01 +0000)]
[TargetLowering] Respect recursive depth in SimplifyDemandedBits call to ComputeNumSignBits
Maheaha Shivamallappa [Sun, 26 Jan 2020 08:01:53 +0000 (13:31 +0530)]
AMDGPU/GlobalISel: Clean-up code around ISel for Intrinsics.
Summary:
A minor code clean-up around ISel for intrinsic llvm.amdgcn.end.cf()
Reviewers: arsenm, mshivama
Reviewed By: arsenm
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73358
Fangrui Song [Sun, 26 Jan 2020 02:58:54 +0000 (18:58 -0800)]
[ELF][PPC32] Support range extension thunks with addends
* Generalize the code added in D70637 and D70937. We should eventually remove the EM_MIPS special case.
* Handle R_PPC_LOCAL24PC the same way as R_PPC_REL24.
Reviewed By: Bdragon28
Differential Revision: https://reviews.llvm.org/D73424
George Burgess IV [Sun, 26 Jan 2020 05:44:59 +0000 (21:44 -0800)]
[Support] `const`ify a method; NFC
Pointed out by Stepan on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2020-January/138617.html
Mehdi Amini [Sun, 26 Jan 2020 03:58:30 +0000 (03:58 +0000)]
Mass update the MLIR license header to mention "Part of the LLVM project"
This is an artifact from merging MLIR into LLVM, the file headers are
now aligned with the rest of the project.
Craig Topper [Sun, 26 Jan 2020 02:25:45 +0000 (18:25 -0800)]
[X86] Use a macro to convert X86ISD names to strings in getTargetNodeName.
Every case in the switch had a string version of themselves. Two
of them had a typo that used : instead of ::
By using a macro we can automate the string creation and avoid
the possibility of typos like this.
This is similar to what is done on the AMDGPU target.
Fangrui Song [Sat, 25 Jan 2020 01:49:59 +0000 (17:49 -0800)]
[ELF][PPC32] Support canonical PLT
-fno-pie produces a pair of non-GOT-non-PLT relocations R_PPC_ADDR16_{HA,LO} (R_ABS) referencing external
functions.
```
lis 3, func@ha
la 3, func@l(3)
```
In a -no-pie/-pie link, if func is not defined in the executable, a canonical PLT entry (st_value>0, st_shndx=0) will be needed.
References to func in shared objects will be resolved to this address.
-fno-pie -pie should fail with "can't create dynamic relocation ... against ...", so we just need to think about -no-pie.
On x86, the PLT entry passes the JMP_SLOT offset to the rtld PLT resolver.
On x86-64: the PLT entry passes the JUMP_SLOT index to the rtld PLT resolver.
On ARM/AArch64: the PLT entry passes &.got.plt[n]. The PLT header passes &.got.plt[fixed-index]. The rtld PLT resolver can compute the JUMP_SLOT index from the two addresses.
For these targets, the canonical PLT entry can just reuse the regular PLT entry (in PltSection).
On PPC32: PltSection (.glink) consists of `b PLTresolve` instructions and `PLTresolve`. The rtld PLT resolver depends on r11 having been set up to the .plt (GotPltSection) entry.
On PPC64 ELFv2: PltSection (.glink) consists of `__glink_PLTresolve` and `bl __glink_PLTresolve`. The rtld PLT resolver depends on r12 having been set up to the .plt (GotPltSection) entry.
We cannot reuse a `b PLTresolve`/`bl __glink_PLTresolve` in PltSection as a canonical PLT entry. PPC64 ELFv2 avoids the problem by using TOC for any external reference, even in non-pic code, so the canonical PLT entry scenario should not happen in the first place.
For PPC32, we have to create a PLT call stub as the canonical PLT entry. The code sequence sets up r11.
Reviewed By: Bdragon28
Differential Revision: https://reviews.llvm.org/D73399
Saar Raz [Sat, 25 Jan 2020 20:54:27 +0000 (22:54 +0200)]
[Concepts] Transform constraints of non-template functions to ConstantEvaluated
We would previously try to evaluate atomic constraints of non-template functions as-is,
and since they are now unevaluated at first, this would cause incorrect evaluation (bugs #44657, #44656).
Substitute into atomic constraints of non-template functions as we would atomic constraints
of template functions, in order to rebuild the expressions in a constant-evaluated context.
Simon Pilgrim [Sat, 25 Jan 2020 20:20:37 +0000 (20:20 +0000)]
[SelectionDAG] ComputeNumSignBits - add DemandedElts support for MIN/MAX ops
Fangrui Song [Thu, 23 Jan 2020 05:39:16 +0000 (21:39 -0800)]
[ELF] Rename relocateOne() to relocate() and pass `Relocation` to it
Symbol information can be used to improve out-of-range/misalignment diagnostics.
It also helps R_ARM_CALL/R_ARM_THM_CALL which has different behaviors with different symbol types.
There are many (67) relocateOne() call sites used in thunks, {Arm,AArch64}errata, PLT, etc.
Rename them to `relocateNoSym()` to be clearer that there is no symbol information.
Reviewed By: grimar, peter.smith
Differential Revision: https://reviews.llvm.org/D73254
Simon Pilgrim [Sat, 25 Jan 2020 19:28:57 +0000 (19:28 +0000)]
[X86] Add tests showing ComputeNumSignBits's failure to use DemandedElts for MIN/MAX opcodes
Simon Pilgrim [Sat, 25 Jan 2020 19:15:05 +0000 (19:15 +0000)]
[SelectionDAG] ComputeNumSignBits - add support for rotate non-uniform vector amounts
Simon Pilgrim [Sat, 25 Jan 2020 18:55:47 +0000 (18:55 +0000)]
[SelectionDAG] ComputeNumSignBits - add support for rotate uniform vector amounts
Simon Pilgrim [Sat, 25 Jan 2020 18:24:15 +0000 (18:24 +0000)]
[X86] Add tests showing ComputeNumSignBits's failure to see through rotate vector amounts
Jacques Pienaar [Sat, 25 Jan 2020 17:52:46 +0000 (09:52 -0800)]
[mlir] Revert MSVC specific part of whole_archive_link
Revert the MSVC specific parts in whole_archive_link to previous form to
potentially address https://bugs.llvm.org/show_bug.cgi?id=44660.
Simon Pilgrim [Sat, 25 Jan 2020 17:36:21 +0000 (17:36 +0000)]
[TargetLowering] SimplifyDemandedBits - Remove ashr if all our demandedbits already match the sign bit
Differential Revision: https://reviews.llvm.org/D73412
Jacques Pienaar [Sat, 25 Jan 2020 17:17:31 +0000 (09:17 -0800)]
[mlir] Bootstrap doxygen config
Add basic doxygen config following clang and llvm example with minimal
changes.
Francis Visoiu Mistrih [Sat, 25 Jan 2020 17:14:24 +0000 (09:14 -0800)]
[perf-training] Update ' (in-process)' prefix handling
A recent change added a new line after the prefix, so it's now part of
the prefix list.
serge-sans-paille [Thu, 12 Dec 2019 17:38:31 +0000 (18:38 +0100)]
Improve static checks for sprintf and __builtin___sprintf_chk
Implement a pessimistic evaluator of the minimal required size for a buffer
based on the format string, and couple that with the fortified version to emit a
warning when the buffer size is lower than the lower bound computed from the
format string.
Differential Revision: https://reviews.llvm.org/D71566
Sam McCall [Sat, 25 Jan 2020 14:31:55 +0000 (15:31 +0100)]
[clangd] Make Notification a little safer.
I just fixed a test involving a similar Notification class:
18e6a65bae93a
The pattern (notify() on one thread, wait() and then destroy the Notification
on the other) seems innocuous enough. I'm not sure we actually use it in clangd,
but better safe than sorry.
Sam McCall [Sat, 25 Jan 2020 14:22:12 +0000 (15:22 +0100)]
[Support] Fix race in threading test, found by TSan
Tom Stellard [Sat, 25 Jan 2020 05:52:05 +0000 (21:52 -0800)]
AMDGPU/SILoadStoreOptimizer: Fix uninitialized variable error
This was introduced by
86c944d790728891801778b8d98c2c65a83f36a5 and
caught by the sanitizer-x86_64-linux-fast bot.
Jonas Devlieghere [Sat, 25 Jan 2020 04:54:02 +0000 (20:54 -0800)]
[lldb/Test] Disable hardware check on arm/aarch64
BreakpointSites know they're backed by hardware based on whether the
"hardware index" is set. This does not appear the to be done for
arm/aarch64.
https://llvm.org/PR44659
Jonas Devlieghere [Sat, 25 Jan 2020 04:46:51 +0000 (20:46 -0800)]
[lldb/Test] Update minidebuginfo-set-and-hit-breakpoint.test
Update test to account for the new 'hardware' field between 'resolved'
and 'hit count'.
Matt Arsenault [Sat, 25 Jan 2020 02:59:48 +0000 (21:59 -0500)]
AMDGPU: Generate test checks
Tom Stellard [Fri, 24 Jan 2020 21:07:08 +0000 (13:07 -0800)]
AMDGPU/SILoadStoreOptimizer: Improve merging of out of order offsets
Summary:
This improves merging of sequences like:
store a, ptr + 4
store b, ptr + 8
store c, ptr + 12
store d, ptr + 16
store e, ptr + 20
store f, ptr
Prior to this patch the basic block was scanned in order to find instructions
to merge and the above sequence would be transformed to:
store4 <a, b, c, d>, ptr + 4
store e, ptr + 20
store r, ptr
With this change, we now sort all the candidate merge instructions by their offset,
so instructions are visited in offset order rather than in the order they appear
in the basic block. We now transform this sequnce into:
store4 <f, a, b, c>, ptr
store2 <d, e>, ptr + 16
Another benefit of this change is that since we have sorted the mergeable lists
by offset, we can easily check if an instruction is mergeable by checking the
offset of the instruction that becomes before or after it in the sorted list.
Once we determine an instruction is not mergeable we can remove it from the list
and avoid having to do the more expensive mergeablilty checks.
Reviewers: arsenm, pendingchaos, rampitec, nhaehnle, vpykhtin
Reviewed By: arsenm, nhaehnle
Subscribers: kerbowa, merge_guards_bot, kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65966
Jonas Devlieghere [Sat, 25 Jan 2020 01:16:02 +0000 (17:16 -0800)]
[lldb/Breakpoint] Include whether or not a breakpoint is a HW BP
Include whether or not a breakpoint is a hardware breakpoint in the
breakpoint location. This will show up in things like the breakpoint
list.
Differential revision: https://reviews.llvm.org/D73389
Jonas Devlieghere [Sat, 25 Jan 2020 02:49:44 +0000 (18:49 -0800)]
[lldb/Breakpoint] Recogize hardware breakpoints as such
Recognize hardware breakpoints as breakpoints instead of just mach
exceptions. The mach exception is the same for watch and breakpoints, so
we have to try each to figure out which is which.
Differential revision: https://reviews.llvm.org/D73401
James Nagurne [Sat, 25 Jan 2020 03:15:32 +0000 (19:15 -0800)]
[libunwind] Set LIBUNWIND_ASM_SOURCES to the ASM source language from C
I believe this is an oversight from the import of libunwind into its own
library from libc++abi.
In libc++abi, these files had the .s suffix, which indicates that the file
is a preprocessed assembly source file. This caused problems because the
files rely upon preprocessors to guard target-specific blocks.
To fix this, the CMakeLists file marked these files as C so that the
preprocessor would be run over them, but then the compiler would correctly
identify the files as assembly and compile them as such.
When imported to libunwind, these files were (correctly) renamed with .S
suffixes, which are non-preprocessed assembly. Thus, we no longer need the
C language property.
The benefit here is that the files can now benefit from CMAKE_ASM_FLAGS
rather than CMAKE_C_FLAGS.
Patch By: JamesNagurne
Differential Revision: https://reviews.llvm.org/D72952
Richard Smith [Fri, 24 Jan 2020 23:14:25 +0000 (15:14 -0800)]
DR1753: Don't permit x.NS::~T() as a pseudo-destructor name.
When used as qualified names, pseudo-destructors are always named as if
they were members of the type, never as members of the namespace
enclosing the type.
LLVM GN Syncbot [Sat, 25 Jan 2020 02:40:48 +0000 (02:40 +0000)]
[gn build] Port
dd8e0a0a23b
Nico Weber [Sat, 25 Jan 2020 02:40:26 +0000 (21:40 -0500)]
[gn build] (manually) merge
81b700e302b1
Weverything [Sat, 25 Jan 2020 02:32:54 +0000 (18:32 -0800)]
Vedant Kumar [Sat, 25 Jan 2020 02:07:34 +0000 (18:07 -0800)]
Revert "Reland: [DWARF] Allow cross-CU references of subprogram definitions"
... as well as:
Revert "[DWARF] Defer creating declaration DIEs until we prepare call site info"
This reverts commit
fa4701e1979553c2df61698ac1ac212627630442.
This reverts commit
79daafc90308787b52a5d3a7586e82acd5e374b3.
There have been reports of this assert getting hit:
CalleeDIE && "Could not find DIE for call site entry origin
Reid Kleckner [Sat, 25 Jan 2020 01:48:36 +0000 (17:48 -0800)]
[Sema] Remove unneeded TreeTransform.h includes, NFC
SemaDecl.cpp and SemaType.cpp don't have any TreeTransforms.
Reid Kleckner [Sat, 25 Jan 2020 01:43:38 +0000 (17:43 -0800)]
[Support] Fix up header comments after splitting Allocator.h, NFC
Reid Kleckner [Fri, 24 Jan 2020 23:16:22 +0000 (15:16 -0800)]
[Sema] Split availability processing into SemaAvailability.cpp
Reduces compile time of SemaDeclAttr.cpp down to 28s from 50s. The new
TU does a few RecursiveASTVisitor instantiations, so it takes 30s.
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D73385
Reid Kleckner [Fri, 24 Jan 2020 23:47:33 +0000 (15:47 -0800)]
[Support] Split MallocAllocator out of Allocator.h
StringMap.h is very popular (4K uses), and it doesn't need to see
BumpPtrAllocator, which is relatively expensive according to
ClangBuildAnalyzer. StringMap only needs MallocAllocator, so split that
into AllocatorBase.h and use it instead.
Here is the change in header uses:
$ diff -u thedeps-before.txt thedeps-after.txt | \
grep '^[-+] ' | sort | uniq -c | sort -nr
3993 + ../llvm/include/llvm/Support/AllocatorBase.h
758 - ../llvm/include/llvm/Support/Allocator.h
270 - ../llvm/include/llvm/Support/Alignment.h
13 - ../llvm/include/llvm/Support/Host.h
6 - ../llvm/include/llvm/ADT/StringMap.h
4 - ../llvm/include/llvm/Support/SwapByteOrder.h
4 - ../llvm/include/llvm/Support/MathExtras.h
4 - ../llvm/include/llvm/Support/AlignOf.h
4 - ../llvm/include/llvm/ADT/SmallVector.h
1 - ../llvm/include/llvm/Support/PointerLikeTypeTraits.h
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D73392
Reid Kleckner [Sat, 25 Jan 2020 01:24:10 +0000 (17:24 -0800)]
[IR] Move CallBase::getOperandBundlesAsDefs out of line, NFC
Copying operand bundles doesn't need to be inlined, and this template
instantiation shows up in ClangBuildAnalyzer.
Roland McGrath [Sat, 25 Jan 2020 00:55:11 +0000 (16:55 -0800)]
[lsan] Factor pthread-specific assumptions out of thread tracking code
This is a small refactoring to prepare for porting LSan to Fuchsia.
Factor out parts of lsan_thread.{cpp,h} that don't apply to Fuchsia.
Since existing supported systems are POSIX-based, the affected code
is moved to lsan_posix.{cpp.h}.
Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D73309
Roland McGrath [Sat, 25 Jan 2020 00:52:12 +0000 (16:52 -0800)]
[lsan] Expose Frontier object to OS-specific LockStuffAndStopTheWorld callback
This is a small refactoring to prepare for porting LSan to Fuchsia.
On Fuchsia, the system supplies a unified API for suspending threads and
enumerating roots from OS-specific places like thread state and global data
ranges. So its LockStuffAndStopTheWorld implementation will make specific
callbacks for all the OS-specific root collection work before making the
common callback that includes the actual leak-checking logic.
Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D72988
Quentin Colombet [Sat, 25 Jan 2020 00:15:43 +0000 (16:15 -0800)]
[GISelKnownBits] Add support for PHIs
Teach the GISelKnowBits analysis how to deal with PHI operations.
PHIs are essentially COPYs happening on edges, so we can just reuse
the code for COPY.
This is NFC COPY-wise has we leave Depth untouched when calling
computeKnownBitsImpl for COPYs, like it was before this patch.
Increasing Depth is however required for PHIs as they may loop back to
themselves and we would end up in an infinite loop if we were not
increasing Depth.
Differential Revision: https://reviews.llvm.org/D73317
Roland McGrath [Sat, 25 Jan 2020 00:33:49 +0000 (16:33 -0800)]
[sanitizer_common] Implement MemoryMappingLayout for Fuchsia
This is needed to port lsan to Fuchsia.
Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D72886
aartbik [Sat, 25 Jan 2020 00:23:54 +0000 (16:23 -0800)]
[mlir] [VectorOps] Rewriting of vector.extract/insert_slices to other vector ops
Summary:
Rewrites the extract/insert_slices operation in terms of
strided_slice/insert_strided_slice ops with intermediate
tuple uses (that should get optimimized away with typical
usage). This is done in a separate "pass" to enable testing
this particular rewriting in isolation.
Reviewers: nicolasvasilache, andydavis1, ftynse
Reviewed By: nicolasvasilache
Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73295
Jonas Devlieghere [Sat, 25 Jan 2020 00:11:18 +0000 (16:11 -0800)]
[lldb/Lit] Change the lldbtest format to behave more like shell test.
The current lldbtest format has a number of shortcomings, all related to
how we omit information based on why the test fails. For example, a
successful test would print nothing, even when `-a` is passed to lit.
It's not up to the test format to decide whether to print something or
not, that's handled by lit itself. For other test results we would
sometimes print stdout & stderr, but not always, such as when a timeout
was reached or we couldn't parse the dotest output.
This patch changes the lldbtest format and makes it behave more like
lit. We now always print the dotest invocation, the exit code, the
output to stdout & stderr. If you're used to dealing with ShTests in
lit, this will feel all very familiar.
Differential revision: https://reviews.llvm.org/D73384
Reid Kleckner [Sat, 25 Jan 2020 00:03:41 +0000 (16:03 -0800)]
[codeview] Prune SimpleTypeSerializer.h headers, NFC
These are left over from when the class was more complicated. Add a
header comment banner to the .cpp file, which was missing.
Diogo Sampaio [Fri, 24 Jan 2020 23:56:12 +0000 (23:56 +0000)]
Detect source location overflow due includes
Summary:
As discussed in http://lists.llvm.org/pipermail/cfe-dev/2019-October/063459.html
the overflow of the souce locations (limited to 2^31 chars) can generate all sorts of
weird things (bogus warnings, hangs, crashes, miscompilation and correct compilation).
In debug mode this assert would fail. So it might be a good start, as in PR42301,
to detect the failure and exit with a proper error message.
Reviewers: rsmith, thakis, miyuki
Reviewed By: miyuki
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70183
Siva Chandra Reddy [Tue, 7 Jan 2020 21:46:12 +0000 (13:46 -0800)]
[libc] Move the implementation of mmap and munmap into a linux specific area.
This allows us to get rid of the PAGE_SIZE macro and use EXEC_PAGESIZE
from linux/param.h.
Few other points about this change:
1. The linux syscall functions have been moved into a linux specific area
instead of src/unistd/syscall.h. The Linux syscall function from unistd.h
is a public vararg function. What we have currently are linux speciif internal
overloaded C++ functions. So, moving them to a Linux only area is more
meaningful.
2. The implementations of mmap and munmap are now in a 'linux' directory
within src/sys/mman. The idea here is that platform specific
implementations will live in a platform specific subdirectories like these.
Infrastructure common to a platform will live in the platform's config
directory. For example, the linux syscall implementations live in
config/linux.
Reviewers: abrachet
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D73302
Jonas Devlieghere [Fri, 24 Jan 2020 23:06:00 +0000 (15:06 -0800)]
[lldb/debugserver] Implement hardware breakpoints for x86_64 and i386
This implements hardware breakpoints for x86_64 and i386 in debugserver.
It's based on Pedro's patch sent to lldb-commits [1] although most of it
is the same as the existing hardware watchpoint implementation.
[1] http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-
20200113/060327.html
Differential revision: https://reviews.llvm.org/D72985
Jonas Devlieghere [Fri, 24 Jan 2020 23:03:56 +0000 (15:03 -0800)]
[lldb/debugserver] Unify the breakpoint/watchpoint interface (NFCI)
Unify the interface for enabling and disabling breakpoints with their
watchpoint counterpart. This allows both to go through
DoHardwareBreakpointAction.
Differential revision: https://reviews.llvm.org/D72981
Mitch Phillips [Fri, 24 Jan 2020 23:01:47 +0000 (15:01 -0800)]
[GWP-ASan] Add names to anonymous mappings.
Summary:
Adds names to anonymous GWP-ASan mappings. This helps Android with debugging
via. /proc/maps, as GWP-ASan-allocated mappings are now easily identifyable.
Reviewers: eugenis, cferris
Reviewed By: eugenis
Subscribers: merge_guards_bot, #sanitizers, llvm-commits, cryptoad, pcc
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D73373
@justice_adams (Justice Adams) [Fri, 24 Jan 2020 22:57:43 +0000 (17:57 -0500)]
[SelectionDag] Updated FoldConstantArithmetic method signature in preparation for merge with FoldConstantVectorArithmetic
Updated FoldConstantArithmetic method signature to match that of
FoldConstantVectorArithmetic in preparation for merging the two
functions together
https://bugs.llvm.org/show_bug.cgi?id=36544
This is the first step in combining the various
FoldConstantVectorArithmetic and FoldConstantVectorArithmetic
functions into one FoldConstantArithmetic function.
Differential Revision: https://reviews.llvm.org/D72870
Duncan P. N. Exon Smith [Sat, 18 Jan 2020 01:15:02 +0000 (17:15 -0800)]
clang: Only define OBJC_NEW_PROPERTIES when -x objective-c
Since 2009 (in r63846) we've been `#define`-ing OBJC_NEW_PROPERTIES all
the time on Darwin, but this macro only makes sense for `-x objective-c`
and `-x objective-c++`. Restrict it to those cases (for which there is
already separate logic).
https://reviews.llvm.org/D72970
rdar://problem/
10050342
Craig Topper [Fri, 24 Jan 2020 22:35:15 +0000 (14:35 -0800)]
[X86] Break the loop in LowerReturn into 2 loops. NFCI
I believe for STRICT_FP I need to use a STRICT_FP_EXTEND for the extending to f80 for returning f32/f64 in 32-bit mode when SSE is enabled. The STRICT_FP_EXTEND node requires a Chain. I need to get that node onto the chain before any CopyToRegs are emitted. This is because all the CopyToRegs are glued and chained together. So I can't put a STRICT_FP_EXTEND on the chain between the glued nodes without also glueing the STRICT_ FP_EXTEND.
This patch moves all the extend creation to a first pass and then creates the copytoregs and fills out RetOps in a second pass.
Differential Revision: https://reviews.llvm.org/D72665
Roman Lebedev [Fri, 24 Jan 2020 22:43:16 +0000 (01:43 +0300)]
[X86] Make `llc --help` output readable again
Long `cl::value_desc()` is added right after the flag name,
before `cl::desc()` column. And thus the `cl::desc()` column,
for all flags, is padded to the right,
which makes the output unreadable.
Evgenii Stepanov [Fri, 24 Jan 2020 19:08:49 +0000 (11:08 -0800)]
[msan] Instrument x86.pclmulqdq* intrinsics.
Summary:
These instructions ignore parts of the input vectors which makes the
default MSan handling too strict and causes false positive reports.
Reviewers: vitalybuka, RKSimon, thakis
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73374
Heejin Ahn [Fri, 24 Jan 2020 03:32:32 +0000 (19:32 -0800)]
[WebAssembly] Update bleeding-edge CPU features
Summary:
This adds bulk memory and tail call to "bleeding-edge" CPU, since their
implementation in LLVM/clang seems mostly complete.
Reviewers: tlively
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73322
Heejin Ahn [Fri, 24 Jan 2020 03:22:51 +0000 (19:22 -0800)]
[WebAssembly] Add reference types target feature
Summary:
This adds the reference types target feature. This does not enable any
more functionality in LLVM/clang for now, but this is necessary to embed
the info in the target features section, which is used by Binaryen and
Emscripten. It turned out that after D69832 `-fwasm-exceptions` crashed
because we didn't have the reference types target feature.
Reviewers: tlively
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D73320
Craig Topper [Fri, 24 Jan 2020 21:28:11 +0000 (13:28 -0800)]
[DAGCombiner] Add combine for (not (strict_fsetcc)) to create a strict_fsetcc with the opposite condition.
Unlike the existing code that I modified here, I only handle the
case where the strict_fsetcc has a single use. Not sure exactly
how to handle multiples uses.
Testing this on X86 is hard because we already have a other
combines that get rid of lowered version of the integer setcc that
this xor will eventually become. So this combine really just
saves a bunch of extra nodes being created. Not sure about other
targets.
Differential Revision: https://reviews.llvm.org/D71816
shafik [Fri, 24 Jan 2020 21:54:25 +0000 (13:54 -0800)]
[LLDB][NFC] Adding clarifying comment in SymbolFileDWARFDebugMap::DumpClangAST(...)
It is not obvious that the code was correct since it would seem as if we want to perform the dump for
each symbol file.
Evandro Menezes [Fri, 24 Jan 2020 21:34:41 +0000 (13:34 -0800)]
[PATCH] [Target] Test commit
Modify comment to reflect the current users of `Regisgter.CostPerUse`.
Evgenii Stepanov [Sat, 11 Jan 2020 00:01:01 +0000 (16:01 -0800)]
[GWP-ASan] enable/disable and fork support.
Summary:
* Implement enable() and disable() in GWP-ASan.
* Setup atfork handler.
* Improve test harness sanity and re-enable GWP-ASan in Scudo.
Scudo_standalone disables embedded GWP-ASan as necessary around fork().
Standalone GWP-ASan sets the atfork handler in init() if asked to. This
requires a working malloc(), therefore GWP-ASan initialization in Scudo
is delayed to the post-init callback.
Test harness changes are about setting up a single global instance of
the GWP-ASan allocator so that pthread_atfork() does not create
dangling pointers.
Test case shamelessly stolen from D72470.
Reviewers: cryptoad, hctim, jfb
Subscribers: mgorny, jfb, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D73294
LLVM GN Syncbot [Fri, 24 Jan 2020 21:42:43 +0000 (21:42 +0000)]
[gn build] Port
8a81daaa8b5
Reid Kleckner [Tue, 10 Dec 2019 01:03:47 +0000 (17:03 -0800)]
[AST] Split parent map traversal logic into ParentMapContext.h
The only part of ASTContext.h that requires most AST types to be
complete is the parent map. Nothing in Clang proper uses the ParentMap,
so split it out into its own class. Make ASTContext own the
ParentMapContext so there is still a one-to-one relationship.
After this change, 562 fewer files depend on ASTTypeTraits.h, and 66
fewer depend on TypeLoc.h:
$ diff -u deps-before.txt deps-after.txt | \
grep '^[-+] ' | sort | uniq -c | sort -nr | less
562 - ../clang/include/clang/AST/ASTTypeTraits.h
340 + ../clang/include/clang/AST/ParentMapContext.h
66 - ../clang/include/clang/AST/TypeLocNodes.def
66 - ../clang/include/clang/AST/TypeLoc.h
15 - ../clang/include/clang/AST/TemplateBase.h
...
I computed deps-before.txt and deps-after.txt with `ninja -t deps`.
This removes a common and key dependency on TemplateBase.h and
TypeLoc.h.
This also has the effect of breaking the ParentMap RecursiveASTVisitor
instantiation into its own file, which roughly halves the compilation
time of ASTContext.cpp (29.75s -> 17.66s). The new file takes 13.8s to
compile.
I left behind forwarding methods for getParents(), but clients will need
to include a new header to make them work:
#include "clang/AST/ParentMapContext.h"
I noticed that this parent map functionality is unfortunately duplicated
in ParentMap.h, which only works for Stmt nodes.
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D71313
Craig Topper [Fri, 24 Jan 2020 21:02:24 +0000 (13:02 -0800)]
Revert a107f86 "[GlobalsAA] Add back a check to intrinsic_addresstaken.ll to see if the AVX and AVX512 bots still fail for it."
It still fails some buildbots which is what I was trying to test.
Matt Arsenault [Fri, 17 Jan 2020 05:22:23 +0000 (00:22 -0500)]
AMDGPU/GlobalISel: Select wqm, softwqm and wwm intrinsics
Matt Arsenault [Sun, 5 Jan 2020 19:16:22 +0000 (14:16 -0500)]
AMDGPU: Don't error on ds.ordered intrinsic in function
These should be assumed to be called from a compute context. Also
don't use a 2 entry switch over constants.
LLVM GN Syncbot [Fri, 24 Jan 2020 21:02:26 +0000 (21:02 +0000)]
[gn build] Port
3f8b100e94b
Dmitry Polukhin [Fri, 24 Jan 2020 00:42:14 +0000 (16:42 -0800)]
[clang-tidy] Add library for clang-tidy main function
Summary:
This library allows to create clang-tidy tools with custom checks outside of llvm repo
using prebuilt clang release tarball.
Test Plan:
Checked that clang-tidy works as before. New library exists in istall dir.
Reviewers: smeenai, gribozavr, stephanemoore
Subscribers: mgorny, xazax.hun, cfe-commits
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D73300
Stanislav Mekhanoshin [Fri, 24 Jan 2020 20:02:54 +0000 (12:02 -0800)]
Correct NumLoads in clustering
Scheduler sends NumLoads argument into shouldClusterMemOps()
one less the actual cluster length. So for 2 instructions
it will pass just 1. Correct this number.
This is NFC for in tree targets.
Differential Revision: https://reviews.llvm.org/D73292
Matt Arsenault [Tue, 14 Jan 2020 21:02:02 +0000 (16:02 -0500)]
TableGen/GlobalISel: Handle non-leaf EXTRACT_SUBREG
This previously only handled EXTRACT_SUBREGs from leafs, such as
operands directly in the original output. Handle extracting from a
result instruction.
Matt Arsenault [Wed, 15 Jan 2020 16:21:56 +0000 (11:21 -0500)]
TableGen: Work around assert on Mips register definitions
This would hit the "Biggest class wasn't first" assert in
getMatchingSubClassWithSubRegs in a future patch for EXTRACT_SUBREG
handling.
Mips defines 4 identical register classes (MSA128B, MSA128H, MSA128BW,
MSA128D). These have the same set of registers, and only differ by the
isel type. I believe this is an ill formed way of defining registers,
that probably is just to work around the inconvenience of mixing
different types in a single register class in DAG patterns.
Since these all have the same size, they would all sort to the
beginning, but you would not necessarily get the same super register
at the front as the assert enforces. Breaking the ambiguity by also
sorting by name doesn't work, since each of these register classes all
want to be first. Force sorting of the original register class if the
size is the same.
Matt Arsenault [Fri, 24 Jan 2020 16:11:57 +0000 (11:11 -0500)]
AMDGPU: Don't check constant address space for atomic stores
We define a separate list for storable address spaces. This saves
entry in the matcher table address space list.
Matt Arsenault [Fri, 24 Jan 2020 15:44:44 +0000 (10:44 -0500)]
AMDGPU/GlobalISel: Add selection tests for G_ATOMICRMW_ADD
Craig Topper [Fri, 24 Jan 2020 19:52:17 +0000 (11:52 -0800)]
[GlobalsAA] Add back a check to intrinsic_addresstaken.ll to see if the AVX and AVX512 bots still fail for it.
These bots failed for this several months ago and as a result, this
check was removed. If they still fail I'm going to try to see if I
can figure out why.
Dimitry Andric [Thu, 23 Jan 2020 09:11:17 +0000 (10:11 +0100)]
Include <cstdlib> for std::abort() in clangd
This fixes a "not a member of 'std'" error with e.g. Fedora 32.
Closes: #105
LLVM GN Syncbot [Fri, 24 Jan 2020 19:37:54 +0000 (19:37 +0000)]
[gn build] Port
555d8f4ef5e
Hans Wennborg [Fri, 24 Jan 2020 19:34:36 +0000 (20:34 +0100)]
Make address-space-lambda.cl pass on 32-bit Windows
Member functions will have the thiscall attribute on them.
Stanislav Mekhanoshin [Mon, 13 Jan 2020 22:54:17 +0000 (14:54 -0800)]
[AMDGPU] Bundle loads before post-RA scheduler
We are relying on atrificial DAG edges inserted by the
MemOpClusterMutation to keep loads and stores together in the
post-RA scheduler. This does not work all the time since it
allows to schedule a completely independent instruction in the
middle of the cluster.
Removed the DAG mutation and added pass to bundle already
clustered instructions. These bundles are unpacked before the
memory legalizer because it does not work with bundles but also
because it allows to insert waitcounts in the middle of a store
cluster.
Removing artificial edges also allows a more relaxed scheduling.
Differential Revision: https://reviews.llvm.org/D72737
Andy Kaylor [Fri, 24 Jan 2020 19:19:08 +0000 (11:19 -0800)]
[PGO] Attach appropriate funclet operand bundles to value profiling instrumentation calls
Patch by Chris Chrulski
When generating value profiling instrumentation, ensure the call gets the
correct funclet token, otherwise WinEHPrepare will turn the call (and all
subsequent instructions) into unreachable.
Differential Revision: https://reviews.llvm.org/D73221
Stanislav Mekhanoshin [Tue, 21 Jan 2020 20:49:25 +0000 (12:49 -0800)]
[AMDGPU] Allow narrowing muti-dword loads
Currently BE allows only a little load narrowing because
of the fear it will produce sub-dword ext loads. However,
we can always allow narrowing if we are shrinking one
multi-dword load to another multi-dword load.
In particular we were unable to reduce s_load_dwordx8 into
s_load_dwordx4 if identity shuffle was used to extract
low 4 dwords.
Differential Revision: https://reviews.llvm.org/D73133
Stanislav Mekhanoshin [Tue, 21 Jan 2020 20:27:13 +0000 (12:27 -0800)]
Allow combining of extract_subvector to extract element
Differential Revision: https://reviews.llvm.org/D73132
Austin Kerbow [Mon, 20 Jan 2020 15:25:20 +0000 (07:25 -0800)]
Resubmit: [DA][TTI][AMDGPU] Add option to select GPUDA with TTI
Summary:
Enable the new diveregence analysis by default for AMDGPU.
Resubmit with test updates since GPUDA was causing failures on Windows.
Reviewers: rampitec, nhaehnle, arsenm, thakis
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73315
Yuta Saito [Fri, 24 Jan 2020 18:20:07 +0000 (10:20 -0800)]
Support Swift calling convention for WebAssembly targets
This adds basic support for the Swift calling convention with WebAssembly
targets.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D71823
Austin Kerbow [Fri, 24 Jan 2020 03:49:20 +0000 (19:49 -0800)]
[DA] Don't propagate from unreachable blocks
Summary: Fixes crash that could occur when a divergent terminator has an unreachable parent.
Reviewers: rampitec, nhaehnle, arsenm
Subscribers: jvesely, wdng, hiraditya, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73323
David Zarzycki [Fri, 24 Jan 2020 18:26:53 +0000 (13:26 -0500)]
Add test for spaceship operator to __config
Summary:
The libcxx test suite auto-detects spaceship operator, but __config does not. This means that the libcxx test suite has been broken for over a month when using top-of-tree clang. This also really ought to be fixed before 10.0.
See:
bc633a42dd409dbeb456263e3388b8caa4680aa0
Reviewers: chandlerc, mclow.lists, EricWF, ldionne, CaseyCarter
Reviewed By: EricWF
Subscribers: broadwaylamb, hans, dexonsmith, tstellar, llvm-commits, libcxx-commits
Tags: #libc, #llvm
Differential Revision: https://reviews.llvm.org/D72980
Simon Pilgrim [Fri, 24 Jan 2020 18:16:28 +0000 (18:16 +0000)]
Fix some comment typos. NFC.
Alina Sbirlea [Fri, 24 Jan 2020 01:00:48 +0000 (17:00 -0800)]
[LoopStrengthReduce] Teach LoopStrengthReduce to preserve MemorySSA is available.
Andy Kaylor [Fri, 24 Jan 2020 17:05:10 +0000 (09:05 -0800)]
[PGO] Early detection regarding whether pgo counter promotion is possible
Patch by Chris Chrulski
This fixes a problem with the current behavior when assertions are enabled.
A loop that exits to a catchswitch instruction is skipped for the counter
promotion, however this check was being done after the PGOCounterPromoter
tried to collect an insertion point for the exit block. A call to
getFirstInsertionPt() on a block that begins with a catchswitch instruction
triggers an assertion. This change performs a check whether the counter
promotion is possible prior to collecting the ExitBlocks and InsertPts.
Differential Revision: https://reviews.llvm.org/D73222
Fangrui Song [Thu, 23 Jan 2020 22:46:28 +0000 (14:46 -0800)]
[PatchableFunction] Allow empty entry MachineBasicBlock
Reviewed By: nickdesaulniers
Differential Revision: https://reviews.llvm.org/D73301
David Zarzycki [Fri, 24 Jan 2020 17:37:05 +0000 (12:37 -0500)]
Verify that clang's max alignment is <= LLVM's max alignment
Reviewers: lebedev.ri
Reviewed By: lebedev.ri
Subscribers: cfe-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D73363
David Green [Fri, 24 Jan 2020 14:21:45 +0000 (14:21 +0000)]
[ARM] Use reduction intrinsics for larger than legal reductions
The codegen for splitting a llvm.vector.reduction intrinsic into parts
will be better than the codegen for the generic reductions. This will
only directly effect when vectorization factors are specified by the
user.
Also added tests to make sure the codegen for larger reductions is OK.
Differential Revision: https://reviews.llvm.org/D72257
Fangrui Song [Thu, 23 Jan 2020 07:26:49 +0000 (23:26 -0800)]
[ELF][PowerPC] Support R_PPC_COPY and R_PPC64_COPY
Reviewed By: Bdragon28, jhenderson, grimar, sfertile
Differential Revision: https://reviews.llvm.org/D73255
Kazushi (Jam) Marukawa [Fri, 24 Jan 2020 16:33:57 +0000 (17:33 +0100)]
[VE] global variable isel patterns
Summary: Asm expr fixups, isel patterns and tests for global variables addresses.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D73355
Tom Weaver [Fri, 24 Jan 2020 16:29:05 +0000 (16:29 +0000)]
[DebugInfo][LiveDebugValues] Teach Live Debug Values About Meta Instructions
Previously LiveDebugValues pass would consider meta instructions that 'fiddle' with liveness of registers as register definitions when transfering register defs. This would mean that, for example, a KILL instruction would cause LiveDebugValues to terminate the range of an earlier DBG_VALUE instruction resulting in the none propogation of said DBG_VALUE instructions into later blocks.
This patch adds the check and a helpful comment, fixes a test that previously tested for the broken behaviour by coincidence and adds a test specifically for this.
reviewers: vsk, dstenb, djtodoro
Differential Revision: https://reviews.llvm.org/D73210
Artem Dergachev [Fri, 24 Jan 2020 15:38:57 +0000 (18:38 +0300)]
[analyzer] PthreadLock: Implement dead region cleanup.
Differential Revision: https://reviews.llvm.org/D37963