Commit Graph

327712 Commits

Author SHA1 Message Date
Puyan Lotfi 67b705b18d [NFC] Invoke lipo from CMAKE_LIPO.
This shouldn't change anything, except that a cmake cache file that specifies
CMAKE_LIPO can specify an alternate lipo to use.

llvm-svn: 372790
2019-09-24 23:48:42 +00:00
Artur Pilipenko 5c1447cd43 [SCEV] Disable canonical expansion for non-affine addrecs.
Reviewed By: apilipenko

Differential Revision: https://reviews.llvm.org/D65276

Patch by Evgeniy Brevnov (ybrevnov@azul.com)

llvm-svn: 372789
2019-09-24 23:21:07 +00:00
Saleem Abdulrasool 56eae602da Host: use the platform identifiers from LLVM (NFC)
Use symbolic constants for the platform identifiers rather than replicating them
locally.

llvm-svn: 372788
2019-09-24 22:55:44 +00:00
Louis Dionne de8609c62a [libc++] Purge mentions of GCC 4 from the test suite
We don't support GCC 4 and older according to the documentation, so
we should pretend it doesn't exist.

llvm-svn: 372787
2019-09-24 22:42:36 +00:00
Jonas Devlieghere cb4cda2d45 [CMake] Copy over the system debugserver when using LLDB_USE_SYSTEM_DEBUGSERVER
r366433 broke support for the system debugserver. Although the change
was well-intended, it (presumably) unintentionally removed the logic to
copy over the debugserver. As a result, even with
LLDB_USE_SYSTEM_DEBUGSERVER enabled, we ended up building, signing and
using the just-built debugserver.

This patch partially recovers the old behavior: when
LLDB_USE_SYSTEM_DEBUGSERVER is set we don't build debugserver and just
copy over the system one.

Differential revision: https://reviews.llvm.org/D67991

llvm-svn: 372786
2019-09-24 22:39:04 +00:00
Yonghong Song 1487bf6c82 [BPF] Generate array dimension size properly for zero-size elements
Currently, if an array element type size is 0, the number of
array elements will be set to 0, regardless of what user
specified. This implementation is done in the beginning where
BTF is mostly used to calculate the member offset.

For example,
  struct s {};
  struct s1 {
        int b;
        struct s a[2];
  };
  struct s1 s1;
The BTF will have struct "s1" member "a" with element count 0.

Now BTF types are used for compile-once and run-everywhere
relocations and we need more precise type representation
for type comparison. Andrii reported the issue as there
are differences between original structure and BTF-generated
structure.

This patch made the change to correctly assign "2"
as the number elements of member "a".
Some dead codes related to ElemSize compuation are also removed.

Differential Revision: https://reviews.llvm.org/D67979

llvm-svn: 372785
2019-09-24 22:38:43 +00:00
Puyan Lotfi 819ff64ea0 Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds.
Second attempt: Now with ';' -> '|' replacement.

On some platforms, certain runtimes are not supported. For runtimes builds of
those platforms it would be nice if we could disable certain runtimes (ie
libunwind on Windows).

Differential Revision: https://reviews.llvm.org/D67195

llvm-svn: 372784
2019-09-24 22:38:18 +00:00
Hiroshi Yamauchi 857424d185 [PGO][PGSO] ProfileSummary changes.
(Split of off D67120)

ProfileSummary changes for profile guided size optimization.

Differential Revision: https://reviews.llvm.org/D67377

llvm-svn: 372783
2019-09-24 22:17:51 +00:00
Louis Dionne ee9a468d9c [libc++] Try fixing tests that fail on GCC 5 and older
llvm-svn: 372782
2019-09-24 22:13:17 +00:00
Peter Smith 06b3e3421a [ELF][ARM] Fix crash when discarding InputSections that have .ARM.exidx
When /DISCARD/ is used on an input section, that input section may have
a .ARM.exidx metadata section that depends on it. As the discard handling
comes after the .ARM.exidx synthetic section is created we need to make
sure that we account for the case where the .ARM.exidx output section
should be removed because there are no more live input sections.

Differential Revision: https://reviews.llvm.org/D67848

llvm-svn: 372781
2019-09-24 21:44:14 +00:00
Zoe Carver 4278a9e6b5 [libc++] Remove C++03 variadics in shared_ptr
Summary: As suggested by @ldionne in D66178, this patch removes C++03 variadics //only//. Following patches will apply more updates.

    Reviewers: ldionne, EricWF, mclow.lists

    Subscribers: christof, dexonsmith, libcxx-commits, ldionne

    Tags: #libc

    Differential Revision: https://reviews.llvm.org/D67675

llvm-svn: 372780
2019-09-24 20:55:54 +00:00
Sam Clegg 937b955837 [lld][WebAssembly] Fix static linking of -fPIC code with external undefined functions
Differential Revision: https://reviews.llvm.org/D66784

llvm-svn: 372779
2019-09-24 20:52:12 +00:00
Louis Dionne e9e1c88ed9 [libc++] Implement LWG 3158
Summary:
LWG 3158 marks the allocator_arg_t constructor of std::tuple as
conditionnally explicit based on whether the default constructors
of the tuple's members are explicitly default constructible.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D65232

llvm-svn: 372778
2019-09-24 20:22:34 +00:00
Louis Dionne 95411dd426 [libc++] Implement LWG 2510
Summary:
LWG2510 makes tag types like allocator_arg_t explicitly default
constructible instead of implicitly default constructible. It also
makes the constructors for std::pair and std::tuple conditionally
explicit based on the explicit-ness of the default constructibility
for the pair/tuple's elements.

Reviewers: mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D65161

llvm-svn: 372777
2019-09-24 20:18:54 +00:00
Bob Haarman 19712415a5 [NFC][COFF] fix typo in comment ("algortihm" -> "algorithm")
llvm-svn: 372776
2019-09-24 20:17:54 +00:00
David Bolvansky e52ed1e80c [NFC] Strenghten preconditions for warning
llvm-svn: 372775
2019-09-24 20:10:57 +00:00
Jonas Devlieghere 7de14dc3c6 [unittest] Skip the socket tests if we $TMPDIR is too long.
Adrian added a sanity check to the socket tests to ensure the $TMPDIR is
not too long for a socket. While this is great for diagnosing the
problem it doesn't really solve the problem for environment where you
have no control over that variable such as in CI. I propose to just skip
the test in that case similar to what we do for tests that rely on
targets that are not currently build, etc.

Differential revision: https://reviews.llvm.org/D67972

llvm-svn: 372774
2019-09-24 19:34:50 +00:00
Yaxun Liu 1282889347 [HIP] Support new kernel launching API
Differential Revision: https://reviews.llvm.org/D67947

llvm-svn: 372773
2019-09-24 19:16:40 +00:00
Sean Fertile b3a9320c08 Extends the expansion of the LWZtoc pseduo op for AIX.
Differential Revision: https://reviews.llvm.org/D67853

llvm-svn: 372772
2019-09-24 18:04:51 +00:00
Philip Reames d9629b88ff [GCRelocate] Add a peephole to canonicalize base pointer relocation
If we generate the gc.relocate, and then later prove two arguments to the statepoint are equivalent, we should canonicalize the gc.relocate to the form we would have produced if this had been known before rewriting.

llvm-svn: 372771
2019-09-24 17:24:16 +00:00
Simon Pilgrim a7f27f357d [X86] Add MMX MOVD/MOVQ stores to folding tables to support stack folding
llvm-svn: 372770
2019-09-24 16:15:32 +00:00
Roman Lebedev 45fd1e9d50 [InstCombine] (a+b) < a && (a+b) != 0 -> (0-b) < a iff a/b != 0 (PR43259)
Summary:
This is again motivated by D67122 sanitizer check enhancement.
That patch seemingly worsens `-fsanitize=pointer-overflow`
overhead from 25% to 50%, which strongly implies missing folds.

For
```
#include <cassert>
char* test(char& base, signed long offset) {
  __builtin_assume(offset < 0);
  return &base + offset;
}
```
We produce

https://godbolt.org/z/r40U47

and again those two icmp's can be merged:
```
Name: 0
Pre: C != 0
  %adjusted = add i8 %base, C
  %not_null = icmp ne i8 %adjusted, 0
  %no_underflow = icmp ult i8 %adjusted, %base
  %r = and i1 %not_null, %no_underflow
=>
  %neg_offset = sub i8 0, C
  %r = icmp ugt i8 %base, %neg_offset
```
https://rise4fun.com/Alive/ALap
https://rise4fun.com/Alive/slnN

There are 3 other variants of this pattern,
i believe they all will go into InstSimplify.

https://bugs.llvm.org/show_bug.cgi?id=43259

Reviewers: spatel, xbolva00, nikic

Reviewed By: spatel

Subscribers: efriedma, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67849

llvm-svn: 372768
2019-09-24 16:10:50 +00:00
Roman Lebedev 5b881f356c [InstCombine] (a+b) <= a && (a+b) != 0 -> (0-b) < a (PR43259)
Summary:
This is again motivated by D67122 sanitizer check enhancement.
That patch seemingly worsens `-fsanitize=pointer-overflow`
overhead from 25% to 50%, which strongly implies missing folds.

This pattern isn't exactly what we get there
(strict vs. non-strict predicate), but this pattern does not
require known-bits analysis, so it is best to handle it first.

```
Name: 0
  %adjusted = add i8 %base, %offset
  %not_null = icmp ne i8 %adjusted, 0
  %no_underflow = icmp ule i8 %adjusted, %base
  %r = and i1 %not_null, %no_underflow
=>
  %neg_offset = sub i8 0, %offset
  %r = icmp ugt i8 %base, %neg_offset
```
https://rise4fun.com/Alive/knp

There are 3 other variants of this pattern,
they all will go into InstSimplify:
https://rise4fun.com/Alive/bIDZ

https://bugs.llvm.org/show_bug.cgi?id=43259

Reviewers: spatel, xbolva00, nikic

Reviewed By: spatel

Subscribers: hiraditya, majnemer, vsk, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67846

llvm-svn: 372767
2019-09-24 16:10:38 +00:00
Simon Pilgrim 682d41a506 [X86] Add tests showing failure to stack fold MMX MOVD/MOVQ stores
llvm-svn: 372766
2019-09-24 15:40:09 +00:00
Michael Liao ca635d7d44 [TextAPI] Remove redundant checking causing warnings. NFC.
- Minor coding format.

llvm-svn: 372765
2019-09-24 14:52:13 +00:00
Thomas Preud'homme 5f738940b5 Regex: Make "match" and "sub" const member functions
Summary:
The Regex "match" and "sub" member functions were previously not "const"
because they wrote to the "error" member variable. This commit removes
those assignments, and instead assumes that the validity of the regex
is already known after the initial compilation of the regular
expression. As a result, these member functions were possible to make
"const". This makes it easier to do things like pre-compile Regexes
up-front, and makes "match" and "sub" thread-safe. The error status is
now returned as an optional output, which also makes the API of "match"
and "sub" more consistent with each other.

Also, some uses of Regex that could be refactored to be const were made const.

Patch by Nicolas Guillemot

Reviewers: jankratochvil, thopre

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67241

llvm-svn: 372764
2019-09-24 14:42:36 +00:00
Tatyana Krasnukha 5a4355324e [NFC] Fix typo in the "kind" description for the software single-step breakpoint
llvm-svn: 372763
2019-09-24 14:24:52 +00:00
George Rimar 1a219aa8df [yaml2obj/obj2yaml] - Add support for .stack_sizes sections.
.stack_sizes is a SHT_PROGBITS section that contains pairs of
<address (4/8 bytes), stack size (uleb128)>.

This patch teach tools to parse and dump it.

Differential revision: https://reviews.llvm.org/D67757

llvm-svn: 372762
2019-09-24 14:22:37 +00:00
David Bolvansky c526fcaed1 [Compiler] Fix LLVM_NODISCARD for GCC
Summary:
This branch is currently dead since we don't use C++17.
 #if __cplusplus > 201402L && LLVM_HAS_CPP_ATTRIBUTE(nodiscard)
 #define LLVM_NODISCARD [[nodiscard]]

This branch is Clang-only.
 #elif LLVM_HAS_CPP_ATTRIBUTE(clang::warn_unused_result)
 #define LLVM_NODISCARD [[clang::warn_unused_result]]


While we could use gnu variant  [[gnu::warn_unused_result]], it is not ideal because it works only on functions.
/home/xbolva00/LLVM/llvm/include/llvm/ADT/ArrayRef.h:41:24: warning: ‘warn_unused_result’ attribute only applies to function types [-Wattributes]

GCC (checked 5,6,7,8) seems to enable [[nodiscard]] even in C++14 mode and does not produce warnings that nodiscard is C++17 feature. but Clang does - but we do not reach it due the code above. So it affects only GCC and does what we want.

Reviewers: jfb, rsmith, echristo, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: MaskRay, dexonsmith

Differential Revision: https://reviews.llvm.org/D67663

llvm-svn: 372761
2019-09-24 14:01:14 +00:00
Paul Hoad 82aaf17412 [clang-format] [PR36858] Add missing .hh and .cs extensions from python support utilities
Summary: https://bugs.llvm.org/show_bug.cgi?id=36858 identifies .hh as a missing C++ header extension file while making this change I realized there was no support for .cs files which were added recently

Reviewers: pseyfert, klimek, owenpan

Reviewed By: klimek

Subscribers: cfe-commits

Tags: #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D67949

llvm-svn: 372760
2019-09-24 14:00:06 +00:00
Simon Pilgrim be9beef5da AggressiveAntiDepBreaker - silence static analyzer null dereference warning. NFCI.
Assert that we've found the critical path.

llvm-svn: 372759
2019-09-24 13:57:51 +00:00
Simon Pilgrim 734d3f49ad SafepointIRVerifier - silence static analyzer dyn_cast<Instruction> null dereference warnings. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<Instruction> directly and if not assert will fire for us.

llvm-svn: 372758
2019-09-24 13:57:44 +00:00
Simon Pilgrim e94242f399 [COFF] Silence static analyzer null dereference warning. NFCI.
Assert that the COFFSymbolRef is correct.

llvm-svn: 372757
2019-09-24 13:57:38 +00:00
Ilya Biryukov 60e5e0b667 Revert r372333: [DAG][X86] Convert isNegatibleForFree/GetNegatedExpression to a target hook (PR42863)
Reason: this caused severe compile time regressions in JAX.
See email thread  of original revision on llvm-commits for details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190923/697042.html

llvm-svn: 372756
2019-09-24 13:48:02 +00:00
Michal Gorny a292a4943b [lldb] [Process/NetBSD] Fix handling LLDB_INVALID_SIGNAL_NUMBER
Fix NativeProcessNetBSD::Resume() to handle LLDB_INVALID_SIGNAL_NUMBER
correctly.  Fixes breakage caused by r372090 and r372300.  I have major
rewrite of that function pending; however, the fixes to gdb-remote
were committed prior to that.

llvm-svn: 372755
2019-09-24 13:41:54 +00:00
James Henderson 1b103864ee [docs][llvm-strip][llvm-objcopy] Improve wording and fix highlighting
llvm-svn: 372754
2019-09-24 13:41:39 +00:00
Utkarsh Saxena 55925da4c9 [clangd] Add semantic selection to ClangdLSPServer.
Summary:
This adds semantic selection to the LSP Server.
Adds support for serialization of input request and the output reply.
Also adds regression tests for the feature.

Currently we do not support multi cursor.The LSP Server only accepts single position in the request as opposed to many position in the spec.

Spec:
https://github.com/microsoft/language-server-protocol/blob/dbaeumer/3.15/specification.md#textDocument_selectionRange

Reviewers: hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67720

llvm-svn: 372753
2019-09-24 13:38:33 +00:00
Haojian Wu 3a415c20ad [clangd] Save an unnecessary copy, NFC.
llvm-svn: 372752
2019-09-24 13:25:38 +00:00
James Henderson eefbc358eb [docs][llvm-size] Fix typo
llvm-svn: 372750
2019-09-24 13:14:22 +00:00
David Bolvansky 275e4df115 [Diagnostics] Handle tautological left shifts in boolean context
llvm-svn: 372749
2019-09-24 13:14:18 +00:00
George Rimar 355764e388 [LLD][ELF][MIPS] - Inline the short helper function. NFC.
It was requested in a post-commit comment for r372570.

llvm-svn: 372747
2019-09-24 12:53:53 +00:00
Simon Pilgrim 7efa6e3126 [Orc] Silence static analyzer dyn_cast<ConstantInt> null dereference warning. NFCI.
llvm-svn: 372746
2019-09-24 12:43:55 +00:00
Michael Liao d19fb46d40 [llvm-objcopy] Fix a warningon unused variable. NFC.
llvm-svn: 372745
2019-09-24 12:43:44 +00:00
Pavel Labath 13a4e8f3ef Enhance SymbolFileDWARF::ParseDeclsForContext performance
This implements
DWARFASTParserClang::EnsureAllDIEsInDeclContextHaveBeenParsed so as to
provide a faster way to ensure all DIEs linked to a certain declaration
context have been parsed.

Currently, we rely on SymbolFileDWARF::ParseDeclsForContext calling
DWARFASTParserClang::GetDIEForDeclContext, and only then
DWARFASTParserClang::GetDeclForUIDFromDWARF. This change shortcuts that
logic and removes redundant calls to DWARFASTParserClang::
GetClangDeclForDIE by deleting DIEs from the m_decl_ctx_to_die map once
they have been parsed.

Differential Revision: https://reviews.llvm.org/D67760
Patch by Guilherme Andrade <guiandrade@google.com>.

llvm-svn: 372744
2019-09-24 12:36:54 +00:00
Simon Pilgrim 182d4874fd ConstantFold - silence static analyzer dyn_cast<> null dereference warning. NFCI.
Early out if the vector element is not Constant.

llvm-svn: 372743
2019-09-24 12:30:13 +00:00
Simon Pilgrim cc972981d4 Fix cppcheck "reduce variable scope" warning. NFCI.
llvm-svn: 372742
2019-09-24 12:30:07 +00:00
Martin Storsjo 544c8f48c8 [LLDB] Add tests for PECOFF arm architecture identification
Add a test case for the change from SVN r372657, and for the
preexisting ARM identification.

Add a missing ArchDefinitionEntry for PECOFF/arm64, and tweak
the ArmNt case to set the architecture to armv7 (ArmNt never ran
on anything lower than that). (This avoids a case where
ArchSpec::MergeFrom would override the arch from arm to armv7 and
ArchSpec::CoreUpdated would reset the OS to unknown at the same time.)

Differential Revision: https://reviews.llvm.org/D67951

llvm-svn: 372741
2019-09-24 12:20:52 +00:00
Martin Storsjo 5bb1525392 [LLDB] [test] Allow differing order of some matches
These can appear in a different order depending on the relative
layout of the source and build trees.

Differential Revision: https://reviews.llvm.org/D67953

llvm-svn: 372740
2019-09-24 12:20:38 +00:00
Martin Storsjo 79b76f0ce1 [LLDB] [test] Add a few missing cases of REQUIRES: python
Differential Revision: https://reviews.llvm.org/D67952

llvm-svn: 372739
2019-09-24 12:20:33 +00:00
Martin Storsjo e37b882421 [LLDB] Fix typo in RegisterContextDarwin_arm64
In these cases, the register number should be calculated from
fpu_d0, not fpu_s0.

Differential Revision: https://reviews.llvm.org/D67892

llvm-svn: 372738
2019-09-24 12:20:21 +00:00