platform/upstream/llvm.git
4 years agoFix signed mismatch warnings in MetadataTests.cpp
David Blaikie [Tue, 3 Dec 2019 19:36:12 +0000 (11:36 -0800)]
Fix signed mismatch warnings in MetadataTests.cpp

4 years agoRevert "Fix llvm-namespace-comment for macro expansions"
Alexander Kornienko [Tue, 3 Dec 2019 15:27:57 +0000 (16:27 +0100)]
Revert "Fix llvm-namespace-comment for macro expansions"

This reverts commit 4736d63f752f8d13f4c6a9afd558565c32119718.
This commit introduces a ton of false positives and incorrect fixes. See https://reviews.llvm.org/D69855#1767089 for details.

4 years ago[NFC] Pass a reference to CodeGenFunction to methods of LValue and
Akira Hatanaka [Tue, 3 Dec 2019 19:24:46 +0000 (11:24 -0800)]
[NFC] Pass a reference to CodeGenFunction to methods of LValue and
AggValueSlot

This is needed for the pointer authentication work we plan to do in the
near future.

https://github.com/apple/llvm-project/blob/a63a81bd9911f87a0b5dcd5bdd7ccdda7124af87/clang/docs/PointerAuthentication.rst

4 years ago[FileCheck] Given multiple -dump-input, prefer most verbose
Joel E. Denny [Tue, 3 Dec 2019 15:13:00 +0000 (10:13 -0500)]
[FileCheck] Given multiple -dump-input, prefer most verbose

Problem: `FILECHECK_OPTS` was implemented so that a test runner, such
as a bot, can specify FileCheck debugging options, such as
`-dump-input=fail`.  However, some existing test suites have FileCheck
calls that already specify `-dump-input=fail` or `-dump-input=always`.
Without this patch, such tests fail under such a test runner because
FileCheck doesn't accept multiple occurrences of `-dump-input`.

Solution: This patch permits multiple occurrences of `-dump-input` by
assigning precedence to its values in the following descending order:
`help`, `always`, `fail`, and `never`.  That is, any occurrence of
`help` always obtains help, and otherwise the behavior is similar to
`-v` vs. `-vv` in that the option specifying the greatest verbosity
has precedence.

Rationale: My justification for the new behavior is as follows.  I
have not experienced use cases where, either as a test runner or as a
test author, I want to **limit** the permitted debugging verbosity
(except as a test author in FileCheck's or lit's test suites where the
FileCheck debugging output itself is under test, but the solution
there is `env FILECHECK_OPTS=`, and I imagine we should use the same
solution anywhere else this need might occur).  Of course, as either a
test runner or test author, it is useful to **increase** debugging
verbosity.

Reviewed By: probinson

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

4 years ago[GlobalISel]: Allow targets to override how to widen constants during legalization
Aditya Nandakumar [Tue, 3 Dec 2019 18:40:03 +0000 (10:40 -0800)]
[GlobalISel]: Allow targets to override how to widen constants during legalization

https://reviews.llvm.org/D70922

This adds a hook to allow targets to define exactly what extension
operation should be performed for widening constants. This handles cases
like widening i1 true which would end up becoming -1 which affects code
quality during combines.
Additionally, in order to stay consistent with how DAG is promoting
constants, we now signextend for byte sized types and zero extend
otherwise (by default). Targets can of course override this if
necessary.

4 years ago[APInt][PatternMatch] Add 'is non-positive' predicate
Roman Lebedev [Tue, 3 Dec 2019 18:17:51 +0000 (21:17 +0300)]
[APInt][PatternMatch] Add 'is non-positive' predicate

It will be useful for implementing the fold mentioned in
https://bugs.llvm.org/show_bug.cgi?id=44100#c4

4 years agoCorrecting the offsets within the test to fix the bots.
Aaron Ballman [Tue, 3 Dec 2019 18:21:35 +0000 (13:21 -0500)]
Correcting the offsets within the test to fix the bots.

4 years agoDifferentiate between the presumed and actual file when dumping the AST to JSON
Aaron Ballman [Tue, 3 Dec 2019 18:04:45 +0000 (13:04 -0500)]
Differentiate between the presumed and actual file when dumping the AST to JSON

Currently, when dumping the AST to JSON, the presumed file is what is included
when dumping a source location. This patch changes the behavior to instead dump
the actual file, and only dump a presumed file name when it differs from the
actual file.

This also corrects an issue with the test script generator that would prevent
it from working on Windows due to file permissions issues.

4 years ago[LV] Scalar with predication must not be uniform
Ayal Zaks [Tue, 26 Nov 2019 22:08:29 +0000 (00:08 +0200)]
[LV] Scalar with predication must not be uniform

Fix PR40816: avoid considering scalar-with-predication instructions as also
uniform-after-vectorization.

Instructions identified as "scalar with predication" will be "vectorized" using
a replicating region. If such instructions are also optimized as "uniform after
vectorization", namely when only the first of VF lanes is used, such a
replicating region becomes erroneous - only the first instance of the region can
and should be formed. Fix such cases by not considering such instructions as
"uniform after vectorization".

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

4 years agoRename `tsan/race_range_pc.cc` to `test/tsan/race_range_pc.cpp`.
Dan Liew [Tue, 3 Dec 2019 17:48:07 +0000 (09:48 -0800)]
Rename `tsan/race_range_pc.cc` to `test/tsan/race_range_pc.cpp`.

The old suffix was preventing it from being executed by default.

4 years agoRevert "[libomptarget] Build a minimal deviceRTL for amdgcn"
Alexey Bataev [Tue, 3 Dec 2019 17:35:08 +0000 (12:35 -0500)]
Revert "[libomptarget] Build a minimal deviceRTL for amdgcn"

This reverts commit 877ffa716fba52251a7454ffd3727d025b617a1f because it
breaks the build.

4 years agoRevert "Temporarily revert "build: avoid hardcoding the libxml2 library name""
Saleem Abdulrasool [Tue, 3 Dec 2019 17:27:14 +0000 (09:27 -0800)]
Revert "Temporarily revert "build: avoid hardcoding the libxml2 library name""

This reverts commit 2e75681b55ab55301022533b203269f5f3d6f909.  Restore
the clean up change.  The underlying CMake issue was resolved in
372ad32734ecb455f9fb4d0601229ca2dfc78b66.

4 years ago[clang-format] Add new option to add spaces around conditions
Mitchell Balan [Tue, 3 Dec 2019 17:20:30 +0000 (12:20 -0500)]
[clang-format] Add new option to add spaces around conditions
Summary:
This diff adds a new option SpacesAroundConditions that inserts spaces inside the braces for conditional statements.

Reviewers: klimek, owenpan, mitchell-stellar, MyDeveloperDay

Patch by: timwoj

Subscribers: rsmmr, cfe-commits

Tags: clang, clang-format

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

4 years ago[NFC][KnownBits] Add getMinValue() / getMaxValue() methods
Roman Lebedev [Tue, 3 Dec 2019 14:45:47 +0000 (17:45 +0300)]
[NFC][KnownBits] Add getMinValue() / getMaxValue() methods

As it can be seen from accompanying cleanup, it is not unheard of
to write `~Known.Zero` meaning "what maximal value can this KnownBits
produce". But i think `~Known.Zero` isn't *that* self-explanatory,
as compared to a method with a name.

Note that not all `~Known.Zero` places were cleaned up,
only those where this arguably improves things.

4 years agollvm-config: do not link absolute paths with `-l`
Saleem Abdulrasool [Tue, 3 Dec 2019 16:52:21 +0000 (08:52 -0800)]
llvm-config: do not link absolute paths with `-l`

When dealing with system libraries which are absolute paths, use the
absolute path rather than the `-l` option.  This ensures that the system
library can be properly linked against.  This is needed to enable using
proper link dependencies in CMake.

4 years agoReland [clangd] Rethink how SelectionTree deals with macros and #includes.
Sam McCall [Tue, 3 Dec 2019 15:59:52 +0000 (16:59 +0100)]
Reland [clangd] Rethink how SelectionTree deals with macros and #includes.

This reverts commit 905b002c139f039a32ab9bf1fad63d745d12423f.

Avoid tricky (and invalid) comparator for std::set.

4 years ago[scudo][standalone] Add chunk ownership function
Kostya Kortchinsky [Mon, 2 Dec 2019 16:50:10 +0000 (08:50 -0800)]
[scudo][standalone] Add chunk ownership function

Summary:
In order to be compliant with tcmalloc's extension ownership
determination function, we have to expose a function that will
say if a chunk was allocated by us.

As to whether or not this has security consequences: someone
able to call this function repeatedly could use it to determine
secrets (cookie) or craft a valid header. So this should not be
exposed directly to untrusted user input.

Add related tests.

Additionally clang-format caught a few things to change.

Reviewers: hctim, pcc, cferris, eugenis, vitalybuka

Subscribers: JDevlieghere, jfb, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[SLP] Enhance SLPVectorizer to vectorize different combinations of aggregates
Anton Afanasyev [Thu, 21 Nov 2019 15:41:52 +0000 (18:41 +0300)]
[SLP] Enhance SLPVectorizer to vectorize different combinations of aggregates

Summary:
Make SLPVectorize to recognize homogeneous aggregates like
`{<2 x float>, <2 x float>}`, `{{float, float}, {float, float}}`,
`[2 x {float, float}]` and so on.
It's a follow-up of https://reviews.llvm.org/D70068.
Merged `findBuildVector()` and `findBuildAggregate()` to
one `findBuildAggregate()` function making it recursive
to recognize multidimensional aggregates. Aggregates required
to be homogeneous.

Reviewers: RKSimon, ABataev, dtemirbulatov, spatel, vporpo

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[SYCL] Add sycl_kernel attribute for accelerated code outlining
Mariya Podchishchaeva [Wed, 6 Nov 2019 14:35:50 +0000 (17:35 +0300)]
[SYCL] Add sycl_kernel attribute for accelerated code outlining

SYCL is single source offload programming model relying on compiler to
separate device code (i.e. offloaded to an accelerator) from the code
executed on the host.

Here is code example of the SYCL program to demonstrate compiler
outlining work:

```
int foo(int x) { return ++x; }
int bar(int x) { throw std::exception("CPU code only!"); }
...
using namespace cl::sycl;
queue Q;
buffer<int, 1> a(range<1>{1024});
Q.submit([&](handler& cgh) {
  auto A = a.get_access<access::mode::write>(cgh);
  cgh.parallel_for<init_a>(range<1>{1024}, [=](id<1> index) {
    A[index] = index[0] + foo(42);
  });
}
...
```

SYCL device compiler must compile lambda expression passed to
cl::sycl::handler::parallel_for method and function foo called from this
lambda expression for an "accelerator". SYCL device compiler also must
ignore bar function as it's not required for offloaded code execution.

This patch adds the sycl_kernel attribute, which is used to mark code
passed to cl::sycl::handler::parallel_for as "accelerated code".

Attribute must be applied to function templates which parameters include
at least "kernel name" and "kernel function object". These parameters
will be used to establish an ABI between the host application and
offloaded part.

Reviewers: jlebar, keryell, Naghasan, ABataev, Anastasia, bader, aaron.ballman, rjmccall, rsmith

Reviewed By: keryell, bader

Subscribers: mgorny, OlegM, ArturGainullin, agozillon, aaron.ballman, ebevhan, Anastasia, cfe-commits

Tags: #clang

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

Signed-off-by: Alexey Bader <alexey.bader@intel.com>
4 years ago[EditLine] Fix RecallHistory to make it go in the right direction.
Jonas Devlieghere [Tue, 3 Dec 2019 16:10:49 +0000 (08:10 -0800)]
[EditLine] Fix RecallHistory to make it go in the right direction.

The naming used by editline for the history operations is counter
intuitive to how it's used in lldb for the REPL.

 - The H_PREV operation returns the previous element in the history,
   which is newer than the current one.
 - The H_NEXT operation returns the next element in the history, which
   is older than the current one.

This exposed itself as a bug in the REPL where the behavior of up- and
down-arrow was inverted. This wasn't immediately obvious because of how
we save the current "live" entry.

This patch fixes the bug and introduces and enum to wrap the editline
operations that match the semantics of lldb.

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

4 years ago[OpenCL] Use generic addr space for lambda call operator
Anastasia Stulova [Tue, 3 Dec 2019 12:55:50 +0000 (12:55 +0000)]
[OpenCL] Use generic addr space for lambda call operator

Since lambdas are represented by callable objects, we add
generic addr space for implicit object parameter in call
operator.

Any lambda variable declared in __constant addr space
(which is not convertible to generic) fails to compile with
a diagnostic. To support constant addr space we need to
add a way to qualify the lambda call operators.

Tags: #clang

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

4 years ago[lldb/Reproducer] Add version check
Jonas Devlieghere [Tue, 3 Dec 2019 15:53:23 +0000 (07:53 -0800)]
[lldb/Reproducer] Add version check

To ensure a reproducer works correctly, the version of LLDB used for
capture and replay must match. Right now the reproducer already contains
the LLDB version. However, this is purely informative. LLDB will happily
replay a reproducer generated with a different version of LLDB, which
can cause subtle differences.

This patch adds a version check which compares the current LLDB version
with the one in the reproducer. If the version doesn't match, LLDB will
refuse to replay. It also adds an escape hatch to make it possible to
still replay the reproducer without having to mess with the recorded
version. This might prove useful when you know two versions of LLDB
match, even though the version string doesn't. This behavior is
triggered by passing a new flag -reproducer-skip-version-check to the
lldb driver.

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

4 years ago[AArch64] Fix over-eager fusing of NEON SIMD MUL/ADD
Sanne Wouda [Mon, 25 Nov 2019 16:40:39 +0000 (16:40 +0000)]
[AArch64] Fix over-eager fusing of NEON SIMD MUL/ADD

Summary:
The ISel pattern for SIMD MLA is a bit too eager: it replaces the ADD with an
MLA even when the MUL cannot be eliminated, e.g. when it has another use.  An
MLA is usually has a higher latency than an ADD (and there are fewer pipes
available that can execute it), so trading an MLA for an ADD is not great.

ISel is not taking the number of uses of the MUL result into account, nor any
other factors such as the length of the critical path or other resource pressure.

The MachineCombiner is able to make these judgments so this patch ports the ISel
pattern for MUL/ADD fusing to the MachineCombiner.

Similarly for MUL/SUB -> MLS, as well as the indexed variants.

The change has no impact on SPEC CPU© intrate nor fprate.

Reviewers: dmgreen, SjoerdMeijer, fhahn, Gerolf

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[SelectionDAG] Reoder ViewXXXDAGs declarations to match execution order. NFC
Amaury Séchet [Tue, 3 Dec 2019 15:10:38 +0000 (16:10 +0100)]
[SelectionDAG] Reoder ViewXXXDAGs declarations to match execution order. NFC

4 years ago[lldb] Remove unneeded semicolon in IOHandlerCursesGUI
Pavel Labath [Tue, 3 Dec 2019 15:15:58 +0000 (16:15 +0100)]
[lldb] Remove unneeded semicolon in IOHandlerCursesGUI

4 years ago[lldb] Use llvm range functions in LineTable.cpp
Pavel Labath [Tue, 3 Dec 2019 15:14:32 +0000 (16:14 +0100)]
[lldb] Use llvm range functions in LineTable.cpp

to avoid needing to declare iterators everywhere.

4 years ago[Aarch64][SVE] Add intrinsics for gather loads (vector + imm)
Sander de Smalen [Tue, 3 Dec 2019 14:52:02 +0000 (14:52 +0000)]
[Aarch64][SVE] Add intrinsics for gather loads (vector + imm)

This patch adds intrinsics for SVE gather loads from memory addresses generated by a vector base plus immediate index:
  * @llvm.aarch64.sve.ld1.gather.imm

This intrinsics maps 1-1 to the corresponding SVE instruction (example for half-words):
  * ld1h { z0.d }, p0/z, [z0.d, #16]

Committed on behalf of Andrzej Warzynski (andwar)

Reviewers: sdesmalen, huntergr, kmclaughlin, eli.friedman, rengolin, rovka, dancgr, mgudim, efriedma

Reviewed By: sdesmalen

Tags: #llvm

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

4 years ago[libomptarget] Build a minimal deviceRTL for amdgcn
Jon Chesterfield [Tue, 3 Dec 2019 15:11:01 +0000 (15:11 +0000)]
[libomptarget] Build a minimal deviceRTL for amdgcn

Summary:
[libomptarget] Build a minimal deviceRTL for amdgcn

The CMakeLists.txt file is functionally identical to the one used in the aomp fork.
Whitespace changes were made based on nvptx/CMakeLists.txt, plus the
copyright notice updated to match (Greg was the original author so would
like his sign off on that here).

This change will build a small subset of the deviceRTL if an appropriate toolchain is
available, e.g. a local install of rocm. Support.h is moved from nvptx as a dependency
of debug.h.

Reviewers: jdoerfert, ABataev, grokos, ronlieb, gregrodgers

Reviewed By: jdoerfert

Subscribers: jfb, Hahnfeld, jvesely, mgorny, openmp-commits

Tags: #openmp

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

4 years ago[DebugInfo] Make DebugVariable class available in DebugInfoMetadata
stozer [Tue, 3 Dec 2019 12:24:41 +0000 (12:24 +0000)]
[DebugInfo] Make DebugVariable class available in DebugInfoMetadata

The DebugVariable class is a class declared in LiveDebugValues.cpp which
is used to uniquely identify a single variable, using its source
variable, inline location, and fragment info to do so. This patch moves
this class into DebugInfoMetadata.h, making it available in a much
broader scope.

4 years ago[DDG] Data Dependence Graph - Topological Sort (Memory Leak Fix)
Bardia Mahjour [Mon, 2 Dec 2019 20:23:26 +0000 (15:23 -0500)]
[DDG] Data Dependence Graph - Topological Sort (Memory Leak Fix)

Summary:
This fixes the memory leak in bec37c3fc766a7b97f8c52c181c325fd47b75259
and re-delivers the reverted patch.
In this patch the DDG DAG is sorted topologically to put the
nodes in the graph in the order that would satisfy all
dependencies. This helps transformations that would like to
generate code based on the DDG. Since the DDG is a DAG a
reverse-post-order traversal would give us the topological
ordering. This patch also sorts the basic blocks passed to
the builder based on program order to ensure that the
dependencies are computed in the correct direction.

Authored By: bmahjour

Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert

Reviewed By: Meinersbur

Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto, ppc-slack

Tags: #llvm

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

4 years agoPrecommit tests for D70673
Sanne Wouda [Mon, 25 Nov 2019 16:40:28 +0000 (16:40 +0000)]
Precommit tests for D70673

4 years ago[Object/ELF] - Refine the error reported when section's offset + size overruns the...
Georgii Rymar [Mon, 2 Dec 2019 11:08:20 +0000 (14:08 +0300)]
[Object/ELF] - Refine the error reported when section's offset + size overruns the file buffer.

This is a follow-up requested in comments for D70826.

It changes the message from
"section X has a sh_offset (Y) + sh_size (Z) that cannot be represented"
to
"section X has a sh_offset (Y) + sh_size (Z) that is greater than the file size (0xABC)"

when section's sh_offset + sh_size overruns a file buffer.

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

4 years ago[LLDB] Disable MSVC warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has...
Alexandre Ganea [Tue, 3 Dec 2019 14:53:26 +0000 (09:53 -0500)]
[LLDB] Disable MSVC warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has C-linkage specified, but returns UDT 'llvm::Expected<bool>' which is incompatible with C

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

4 years ago[Aarch64][SVE] Add intrinsics for gather loads with 32-bits offsets
Sander de Smalen [Tue, 3 Dec 2019 13:52:47 +0000 (13:52 +0000)]
[Aarch64][SVE] Add intrinsics for gather loads with 32-bits offsets

This patch adds intrinsics for SVE gather loads for which the offsets are 32-bits wide and are:
* unscaled
  * @llvm.aarch64.sve.ld1.gather.sxtw
  * @llvm.aarch64.sve.ld1.gather.uxtw
* scaled (offsets become indices)
  * @llvm.arch64.sve.ld1.gather.sxtw.index
  * @llvm.arch64.sve.ld1.gather.uxtw.index
The offsets are either zero (uxtw) or sign (sxtw) extended to 64 bits.

These intrinsics map 1-1 to the corresponding SVE instructions (examples for half-words):
* unscaled
  * ld1h { z0.s }, p0/z, [x0, z0.s, sxtw]
  * ld1h { z0.s }, p0/z, [x0, z0.s, uxtw]
* scaled
  * ld1h { z0.s }, p0/z, [x0, z0.s, sxtw #1]
  * ld1h { z0.s }, p0/z, [x0, z0.s, uxtw #1]

Committed on behalf of Andrzej Warzynski (andwar)

Reviewers: sdesmalen, kmclaughlin, eli.friedman, rengolin, rovka, huntergr, dancgr, mgudim, efriedma

Reviewed By: sdesmalen

Tags: #llvm

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

4 years ago[NFCI][DebugInfo] Corrected a comment.
Sourabh Singh Tomar [Tue, 3 Dec 2019 14:10:46 +0000 (19:40 +0530)]
[NFCI][DebugInfo] Corrected a comment.

4 years ago[AArch64][SVE2] Implement remaining SVE2 floating-point intrinsics
Kerry McLaughlin [Tue, 3 Dec 2019 13:26:40 +0000 (13:26 +0000)]
[AArch64][SVE2] Implement remaining SVE2 floating-point intrinsics

Summary:
Adds the following intrinsics:
  - faddp
  - fmaxp, fminp, fmaxnmp & fminnmp
  - fmlalb, fmlalt, fmlslb & fmlslt
  - flogb

Reviewers: huntergr, sdesmalen, dancgr, efriedma

Reviewed By: sdesmalen

Subscribers: efriedma, tschuett, kristof.beyls, hiraditya, cameron.mcinally, cfe-commits, llvm-commits

Tags: #llvm

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

4 years agoAdd FunctionDecl::getParameterSourceRange()
Nicolas Manichon [Tue, 3 Dec 2019 13:21:55 +0000 (08:21 -0500)]
Add FunctionDecl::getParameterSourceRange()

This source range covers the list of parameters of the function declaration,
including the ellipsis for a variadic function.

4 years ago[Support] Add ProcName to TimeTraceProfiler
Russell Gallop [Mon, 2 Dec 2019 13:10:44 +0000 (13:10 +0000)]
[Support] Add ProcName to TimeTraceProfiler

This was hard-coded to "clang". This change allows it to to be used on
processes other than clang (such as lld).

This gets reported as clang-10 on Linux and clang.exe on Windows so
adapted test to accommodate this.

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

4 years ago[lldb][NFC] Move Curses interface implementation to own file
Raphael Isemann [Tue, 3 Dec 2019 11:18:17 +0000 (12:18 +0100)]
[lldb][NFC] Move Curses interface implementation to own file

Summary:
The IOHandler class source file is currently around 4600 LOC. However only 200
of these lines are concerned with the actual IOHandler class and the rest are the
implementations for Editline, IOHandlerConfirm and the Curses interface. All these
large features also cause that the IOHandler (which is in Core) has a large set of dependencies
on other parts of LLDB.

This patch splits out the code for the curses interface into its own file. This way
the simple IOHandler code is no longer buried in-between much larger functionalities.

Next up is splitting out the other IOHandlers into their own files and then move them
to more appropriate parts of LLDB.

Reviewers: labath, clayborg, JDevlieghere

Reviewed By: labath

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

4 years ago[AArch64][SVE] Add intrinsics for gather loads with 64-bit offsets
Sander de Smalen [Tue, 3 Dec 2019 11:25:07 +0000 (11:25 +0000)]
[AArch64][SVE] Add intrinsics for gather loads with 64-bit offsets

This patch adds the following intrinsics for gather loads with 64-bit offsets:
      * @llvm.aarch64.sve.ld1.gather (unscaled offset)
      * @llvm.aarch64.sve.ld1.gather.index (scaled offset)

These intrinsics map 1-1 to the following AArch64 instructions respectively (examples for half-words):
      * ld1h { z0.d }, p0/z, [x0, z0.d]
      * ld1h { z0.d }, p0/z, [x0, z0.d, lsl #1]

Committing on behalf of Andrzej Warzynski (andwar)

Reviewers: sdesmalen, huntergr, rovka, mgudim, dancgr, rengolin, efriedma

Reviewed By: efriedma

Tags: #llvm

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

4 years agoRevert "[LiveDebugValues] Introduce entry values of unmodified params"
Djordje Todorovic [Tue, 3 Dec 2019 12:06:38 +0000 (13:06 +0100)]
Revert "[LiveDebugValues] Introduce entry values of unmodified params"

This reverts commit rG4cfceb910692 due to LLDB test failing.

4 years ago[VPlan] Add dump function to VPlan class.
Florian Hahn [Tue, 3 Dec 2019 11:58:31 +0000 (11:58 +0000)]
[VPlan] Add dump function to VPlan class.

This adds a dump() function to VPlan, which uses the existing
operator<<.

This method provides a convenient way to dump a VPlan while debugging,
e.g. from lldb.

Reviewers: hsaito, Ayal, gilr, rengolin

Reviewed By: hsaito

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

4 years agoFix compatibility with python3 of clang-include-fixer.py
Yannick Brehon [Tue, 3 Dec 2019 11:52:59 +0000 (12:52 +0100)]
Fix compatibility with python3 of clang-include-fixer.py

clang-include-fixer was recently updated to be python3-compatible.
However, an exception handling clause was improperly using the deprecated `message` property of Exception classes, so the code was not yet entirely python3-compatible.

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

4 years ago[AArch64][SVE] Implement shift intrinsics
Kerry McLaughlin [Tue, 3 Dec 2019 11:26:18 +0000 (11:26 +0000)]
[AArch64][SVE] Implement shift intrinsics

Summary:
Adds the following intrinsics:
- asr & asrd
- insr
- lsl & lsr

This patch also adds a new AArch64ISD node (INSR) to represent the int_aarch64_sve_insr intrinsic.

Reviewers: huntergr, sdesmalen, dancgr, mgudim, rengolin, efriedma

Reviewed By: sdesmalen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cameron.mcinally, cfe-commits, llvm-commits

Tags: #llvm

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

4 years agogn build: Merge bc76dadb3cf
LLVM GN Syncbot [Tue, 3 Dec 2019 11:35:13 +0000 (11:35 +0000)]
gn build: Merge bc76dadb3cf

4 years ago[lldb][NFC] Extract searching for function SymbolContexts out of ClangExpressionDeclM...
Raphael Isemann [Fri, 29 Nov 2019 14:05:42 +0000 (15:05 +0100)]
[lldb][NFC] Extract searching for function SymbolContexts out of ClangExpressionDeclMap::LookupFunction

This code was just creating a new SymbolContextList with any found functions
in the front and orders them by how close they are to the current frame.
This refactors this code into its own function to make this more obvious.

Doesn't do any other changes to the code, so this is NFC.

4 years agoFix for buildbots
Sam Parker [Tue, 3 Dec 2019 11:30:38 +0000 (11:30 +0000)]
Fix for buildbots

Change pass name in pipeline test.

4 years ago[lldb] Remove all remaining tabs from TestReturnValue.py
Raphael Isemann [Tue, 3 Dec 2019 11:05:54 +0000 (12:05 +0100)]
[lldb] Remove all remaining tabs from TestReturnValue.py

I assumed this was just a single typo, but it seems we actually have
a whole bunch of tabs in this file which cause Python to complain
about mixing tabs and spaces.

4 years ago[CodeGen] Move ARMCodegenPrepare to TypePromotion
Sam Parker [Tue, 3 Dec 2019 11:00:32 +0000 (11:00 +0000)]
[CodeGen] Move ARMCodegenPrepare to TypePromotion

Convert ARMCodeGenPrepare into a generic type promotion pass by:
- Removing the insertion of arm specific intrinsics to handle narrow
  types as we weren't using this.
- Removing ARMSubtarget references.
- Now query a generic TLI object to know which types should be
  promoted and what they should be promoted to.
- Move all codegen tests into Transforms folder and testing using opt
  and not llc, which is how they should have been written in the
  first place...

The pass searches up from icmp operands in an attempt to safely
promote types so we can avoid generating unnecessary unsigned extends
during DAG ISel.

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

4 years ago[OpenCL] Fix mangling of single-overload builtins
Sven van Haastregt [Tue, 3 Dec 2019 11:07:48 +0000 (11:07 +0000)]
[OpenCL] Fix mangling of single-overload builtins

Commit 9a8d477a0e0 ("[OpenCL] Add builtin function attribute
handling", 2019-11-05) stopped Clang from mangling single-overload
builtins, which is incorrect.

4 years ago[lldb][NFC] Test going up/down one line in the multiline expression editor
Raphael Isemann [Tue, 3 Dec 2019 10:28:56 +0000 (11:28 +0100)]
[lldb][NFC] Test going up/down one line in the multiline expression editor

4 years ago[clang][CodeGen] Make use of cc1 instead of clang in the tests
Kadir Cetinkaya [Tue, 3 Dec 2019 11:02:12 +0000 (12:02 +0100)]
[clang][CodeGen] Make use of cc1 instead of clang in the tests

4 years agoFixup 6d18e53: xfail TestShowLocationDwarf5.py properly
Diana Picus [Tue, 3 Dec 2019 10:52:03 +0000 (11:52 +0100)]
Fixup 6d18e53: xfail TestShowLocationDwarf5.py properly

Forgot to squash this...

4 years ago[DWARF] Add support for parsing/dumping section indices in location lists
Pavel Labath [Thu, 21 Nov 2019 15:16:50 +0000 (16:16 +0100)]
[DWARF] Add support for parsing/dumping section indices in location lists

Summary:
This does exactly what it says on the box. The only small gotcha is the
section index computation for offset_pair entries, which can use either
the base address section, or the section from the offset_pair entry.
This is to support both the cases where the base address is relocated
(points to the base of the CU, typically), and the case where the base
address is a constant (typically zero) and relocations are on the
offsets themselves.

Reviewers: dblaikie, JDevlieghere, aprantl, SouraVX

Subscribers: hiraditya, llvm-commits, probinson

Tags: #llvm

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

4 years ago[lldb] Remove tab from TestReturnValue.py
Raphael Isemann [Tue, 3 Dec 2019 10:44:23 +0000 (11:44 +0100)]
[lldb] Remove tab from TestReturnValue.py

Mixing tabs and spaces makes Python exit with this error:

  File "llvm/lldb/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py", line 23
    return (self.getArchitecture() == "aarch64" and self.getPlatform() == "linux")
                                                                                 ^
TabError: inconsistent use of tabs and spaces in indentation

4 years ago[lldb] Move register info "augmentation" from gdb-remote into ABI
Pavel Labath [Tue, 3 Dec 2019 10:39:20 +0000 (11:39 +0100)]
[lldb] Move register info "augmentation" from gdb-remote into ABI

Summary:
Previously the ABI plugin exposed some "register infos" and the
gdb-remote code used those to fill in the missing bits. Now, the
"filling in" code is in the ABI plugin itself, and the gdb-remote code
just invokes that.

The motivation for this is two-fold:
a) the "augmentation" logic is useful outside of process gdb-remote. For
  instance, it would allow us to avoid repeating the register number
  definitions in minidump code.
b) It gives more implementation freedom to the ABI classes. Now that
  these "register infos" are essentially implementation details, classes
  can use other methods to obtain dwarf/eh_frame register numbers -- for
  instance they can consult llvm MC layer.

Since the augmentation code was not currently tested anywhere, I took
the opportunity to create a simple test for it.

Reviewers: jasonmolenda, clayborg, tatyana-krasnukha

Subscribers: aprantl, lldb-commits

Tags: #lldb

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

4 years ago[asan] Remove debug locations from alloca prologue instrumentation
Johannes Altmanninger [Mon, 2 Dec 2019 10:39:28 +0000 (11:39 +0100)]
[asan] Remove debug locations from alloca prologue instrumentation

Summary:
This fixes https://llvm.org/PR26673
"Wrong debugging information with -fsanitize=address"
where asan instrumentation causes the prologue end to be computed
incorrectly: findPrologueEndLoc, looks for the first instruction
with a debug location to determine the prologue end.  Since the asan
instrumentation instructions had debug locations, that prologue end was
at some instruction, where the stack frame is still being set up.

There seems to be no good reason for extra debug locations for the
asan instrumentations that set up the frame; they don't have a natural
source location.  In the debugger they are simply located at the start
of the function.

For certain other instrumentations like -fsanitize-coverage=trace-pc-guard
the same problem persists - that might be more work to fix, since it
looks like they rely on locations of the tracee functions.

This partly reverts aaf4bb239487e0a3b20a8eaf94fc641235ba2c29
"[asan] Set debug location in ASan function prologue"
whose motivation was to give debug location info to the coverage callback.
Its test only ensures that the call to @__sanitizer_cov_trace_pc_guard is
given the correct source location; as the debug location is still set in
ModuleSanitizerCoverage::InjectCoverageAtBlock, the test does not break.
So -fsanitize-coverage is hopefully unaffected - I don't think it should
rely on the debug locations of asan-generated allocas.

Related revision: 3c6c14d14b40adfb581940859ede1ac7d8ceae7a
"ASAN: Provide reliable debug info for local variables at -O0."

Below is how the X86 assembly version of the added test case changes.
We get rid of some .loc lines and put prologue_end where the user code starts.

```diff
--- 2.master.s 2019-12-02 12:32:38.982959053 +0100
+++ 2.patch.s 2019-12-02 12:32:41.106246674 +0100
@@ -45,8 +45,6 @@
  .cfi_offset %rbx, -24
  xorl %eax, %eax
  movl %eax, %ecx
- .Ltmp2:
-  .loc 1 3 0 prologue_end      # 2.c:3:0
  cmpl $0, __asan_option_detect_stack_use_after_return
  movl %edi, 92(%rbx)          # 4-byte Spill
  movq %rsi, 80(%rbx)          # 8-byte Spill
@@ -57,9 +55,7 @@
  callq __asan_stack_malloc_0
  movq %rax, 72(%rbx)          # 8-byte Spill
 .LBB1_2:
-  .loc 1 0 0 is_stmt 0         # 2.c:0:0
  movq 72(%rbx), %rax          # 8-byte Reload
-  .loc 1 3 0                   # 2.c:3:0
  cmpq $0, %rax
  movq %rax, %rcx
  movq %rax, 64(%rbx)          # 8-byte Spill
@@ -72,9 +68,7 @@
  movq %rax, %rsp
  movq %rax, 56(%rbx)          # 8-byte Spill
 .LBB1_4:
-  .loc 1 0 0                   # 2.c:0:0
  movq 56(%rbx), %rax          # 8-byte Reload
-  .loc 1 3 0                   # 2.c:3:0
  movq %rax, 120(%rbx)
  movq %rax, %rcx
  addq $32, %rcx
@@ -99,7 +93,6 @@
  movb %r8b, 31(%rbx)          # 1-byte Spill
  je .LBB1_7
 # %bb.5:
-  .loc 1 0 0                   # 2.c:0:0
  movq 40(%rbx), %rax          # 8-byte Reload
  andq $7, %rax
  addq $3, %rax
@@ -118,7 +111,8 @@
  movl %ecx, (%rax)
  movq 80(%rbx), %rdx          # 8-byte Reload
  movq %rdx, 128(%rbx)
- .loc 1 4 3 is_stmt 1         # 2.c:4:3
+.Ltmp2:
+ .loc 1 4 3 prologue_end      # 2.c:4:3
  movq %rax, %rdi
  callq f
  movq 48(%rbx), %rax          # 8-byte Reload
```

Reviewers: eugenis, aprantl

Reviewed By: eugenis

Subscribers: ormris, aprantl, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoTemporarily run machine-verifier once in test/CodeGen/SPARC/fp128.ll, so that
Jonas Paulsson [Tue, 3 Dec 2019 10:19:16 +0000 (11:19 +0100)]
Temporarily run machine-verifier once in test/CodeGen/SPARC/fp128.ll, so that
it XFAIL:s also without expensive checks.

See https://reviews.llvm.org/D63973

4 years agoImplicitNullChecks: Don't add a dead definition of DepMI as live-in
Jonas Paulsson [Tue, 19 Nov 2019 12:15:12 +0000 (13:15 +0100)]
ImplicitNullChecks: Don't add a dead definition of DepMI as live-in

This is one of the fixes needed to reapply D68267 which improves verification
of live-in lists.

Review: craig.topper
https://reviews.llvm.org/D70434

4 years ago[LiveDebugValues] Introduce entry values of unmodified params
Djordje Todorovic [Thu, 21 Nov 2019 10:07:39 +0000 (11:07 +0100)]
[LiveDebugValues] Introduce entry values of unmodified params

The idea is to remove front-end analysis for the parameter's value
modification and leave it to the value tracking system. Front-end in some
cases marks a parameter as modified even the line of code that modifies the
parameter gets optimized, that implies that this will cover more entry
values even. In addition, extending the support for modified parameters
will be easier with this approach.

Since the goal is to recognize if a parameter’s value has changed, the idea
at very high level is: If we encounter a DBG_VALUE other than the entry
value one describing the same variable (parameter), we can assume that the
variable’s value has changed and we should not track its entry value any
more. That would be ideal scenario, but due to various LLVM optimizations,
a variable’s value could be just moved around from one register to another
(and there will be additional DBG_VALUEs describing the same variable), so
we have to recognize such situation (otherwise, we will lose a lot of entry
values) and salvage the debug entry value.

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

4 years agoMark some tests as xfail on AArch64 Linux
Diana Picus [Tue, 19 Nov 2019 09:58:52 +0000 (10:58 +0100)]
Mark some tests as xfail on AArch64 Linux

I have either opened new bug reports for these tests, or added links to
existing bugs.

This should help make the lldb-aarch64-ubuntu buildbot green (there will
still be some unexpected passes that someone should look into, but those
can be handled later).

4 years ago[NFC] Tidy-ups to TimeProfiler.cpp
Russell Gallop [Thu, 28 Nov 2019 16:20:59 +0000 (16:20 +0000)]
[NFC] Tidy-ups to TimeProfiler.cpp

Remove unused include
Make fields const where possible
Move initialisation to initialiser list

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

4 years ago[MachineVerifier] Improve checks of target instructions operands.
Jonas Paulsson [Fri, 1 Nov 2019 09:14:22 +0000 (10:14 +0100)]
[MachineVerifier]  Improve checks of target instructions operands.

While working with a patch for instruction selection, the splitting of a
large immediate ended up begin treated incorrectly by the backend. Where a
register operand should have been created, it instead became an immediate. To
my surprise the machine verifier failed to report this, which at the time
would have been helpful.

This patch improves the verifier so that it will report this type of error.

This patch XFAILs CodeGen/SPARC/fp128.ll, which has been reported at
https://bugs.llvm.org/show_bug.cgi?id=44091

Review: thegameg, arsenm, fhahn
https://reviews.llvm.org/D63973

4 years ago[NFC] Slightly improve wording in the comments
Kirill Bobyrev [Tue, 3 Dec 2019 09:12:17 +0000 (10:12 +0100)]
[NFC] Slightly improve wording in the comments

Reviewed by: hokein

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

4 years ago[llvm][bindings][go] Fix typo
Kadir Cetinkaya [Tue, 3 Dec 2019 08:30:32 +0000 (09:30 +0100)]
[llvm][bindings][go] Fix typo

4 years ago[UpdateTestChecks] Fix parsing of RUN: lines with line continuations
Alex Richardson [Tue, 3 Dec 2019 08:23:25 +0000 (08:23 +0000)]
[UpdateTestChecks] Fix parsing of RUN: lines with line continuations

I accidentally broke this in d9542db49e90457de62af3bfe395aaf4c47b68a5 due
to incorrectly placed parentheses.

4 years ago[lldb][NFC] Remove ThreadSafeSTLVector and ThreadSafeSTLMap and their use in ValueObj...
Raphael Isemann [Tue, 3 Dec 2019 07:53:42 +0000 (08:53 +0100)]
[lldb][NFC] Remove ThreadSafeSTLVector and ThreadSafeSTLMap and their use in ValueObjectSynthetic

Summary:
ThreadSafeSTLVector and ThreadSafeSTLMap are not useful for achieving any degree of thread safety in LLDB
and should be removed before they are used in more places. They are only used (unsurprisingly incorrectly) in
`ValueObjectSynthetic::GetChildAtIndex`, so this patch replaces their use there with a simple mutex with which
we guard the related data structures. This doesn't make ValueObjectSynthetic::GetChildAtIndex
any more thread-safe, but on the other hand it at least allows us to get rid of the ThreadSafeSTL* data structures
without changing the observable behaviour of ValueObjectSynthetic (beside that it is now a few bytes smaller).

Reviewers: labath, JDevlieghere, jingham

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

4 years agoAvoidBindCheck.cpp: Fix unused variables warning
Hans Wennborg [Tue, 3 Dec 2019 07:59:01 +0000 (08:59 +0100)]
AvoidBindCheck.cpp: Fix unused variables warning

4 years agoAvoidBindCheck.cpp: Fix GCC 5.3 build errors
Hans Wennborg [Tue, 3 Dec 2019 07:56:51 +0000 (08:56 +0100)]
AvoidBindCheck.cpp: Fix GCC 5.3 build errors

It was failing with:

clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp:61:29:
error: declaration of ‘clang::tidy::modernize::{anonymous}::CaptureMode clang::tidy::modernize::{anonymous}::BindArgument::CaptureMode’ [-fpermissive]
   CaptureMode CaptureMode = CM_None;
                             ^
clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp:38:6:
error: changes meaning of ‘CaptureMode’ from ‘enum clang::tidy::modernize::{anonymous}::CaptureMode’ [-fpermissive]
 enum CaptureMode { CM_None, CM_ByRef, CM_ByValue, CM_InitExpression };
      ^

4 years ago[LegalizeDAG] Return true from ExpandNode for some nodes that don't have expand support.
Craig Topper [Tue, 3 Dec 2019 07:10:57 +0000 (23:10 -0800)]
[LegalizeDAG] Return true from ExpandNode for some nodes that don't have expand support.

These nodes have a FIXME that they only get here because a Custom
handler returned SDValue() instead of the original Op.

Even though we aren't expanding them, we should return true here to
prevent ConvertNodeToLibcall from also trying to process them until
the FIXME has been addressed.

I'm hoping to add checking to ConvertNodeToLibcall to make sure
we don't give it nodes it doesn't have support for.

4 years ago[LegalizeDAG] When expanding vector SRA/SRL/SHL add the new BUILD_VECTOR to the Resul...
Craig Topper [Tue, 3 Dec 2019 06:50:59 +0000 (22:50 -0800)]
[LegalizeDAG] When expanding vector SRA/SRL/SHL add the new BUILD_VECTOR to the Results vector instead of just calling ReplaceNode

The code that processes the Results vector also calls ReplaceNode
and makes ExpandNode return true.

If we don't add it to the Results node, we end up returning false
from ExpandNode. This causes ConvertNodeToLibcall to be called next.
But ConvertNodeToLibcall doesn't do anything for shifts so they
just pass through unmodified. Except for printing a debug message.

Ultimately, I'd like to add more checks to ExpandNode and
ConvertNodeToLibcall to make sure we don't have nodes marked as
Expand that don't have any Expand or libcall handling.

4 years ago[NFC][PowerPC] Add the inheritable and additional features to make the processor...
QingShan Zhang [Tue, 3 Dec 2019 06:32:46 +0000 (06:32 +0000)]
[NFC][PowerPC] Add the inheritable and additional features to make the processor definition more clear

The old processor design assume that, all the old processor's feature must be
inherited into future processor. That is not true as instruction fusion or some
implementation defined features are not inheritable.

What this patch did:
  * Rename the old "specific features" to "additional features" that keep the new added inheritable features.
  * Use the "specific features" to keep those features only for specific processor.
  * Add the "inheritable features" to keep all the features that inherited from early processor.

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

4 years agoRecommit "[DWARF5]Addition of alignment atrribute in typedef DIE."
Sourabh Singh Tomar [Tue, 3 Dec 2019 03:59:54 +0000 (09:29 +0530)]
Recommit "[DWARF5]Addition of alignment atrribute in typedef DIE."

This revision is revised to update Go-bindings and Release Notes.

The original commit message follows.

This patch, adds support for DW_AT_alignment[DWARF5] attribute, to be emitted with typdef DIE.
When explicit alignment is specified.

Patch by Awanish Pandey <Awanish.Pandey@amd.com>

Reviewers: aprantl, dblaikie, jini.susan.george, SouraVX, alok,
deadalinx

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

4 years ago[DebugInfo] Support for debug_macinfo.dwo section in llvm and llvm-dwarfdump.
Sourabh Singh Tomar [Mon, 11 Nov 2019 07:23:19 +0000 (12:53 +0530)]
[DebugInfo] Support for debug_macinfo.dwo section in llvm and llvm-dwarfdump.

This patch adds support for debug_macinfo.dwo section[pre-standardized]
to llvm and llvm-dwarfdump.

Reviewers: probinson, dblaikie, aprantl, jini.susan.george, alok

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

Tags: #debug-info #llvm

4 years ago[clang-scan-deps] do not skip empty #if/#elif in the minimizer to avoid missing ...
Alex Lorenz [Tue, 3 Dec 2019 01:38:40 +0000 (17:38 -0800)]
[clang-scan-deps] do not skip empty #if/#elif in the minimizer to avoid missing `__has_include` dependencies

This patch makes the minimizer more conservative to avoid missing dependency files that are brought in by __has_include
PP expressions that occur in a condition of an #if/#elif that was previously skipped. The __has_include PP expressions
can be used in an #if/#elif either directly, or through macro expansion, so we can't detect them at the time of minimization.

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

4 years ago[X86] Model MXCSR for AVX instructions other than AVX512
Wang, Pengfei [Wed, 27 Nov 2019 13:09:17 +0000 (21:09 +0800)]
[X86] Model MXCSR for AVX instructions other than AVX512

Summary: Model MXCSR for AVX instructions other than AVX512

Reviewers: craig.topper, RKSimon

Subscribers: hiraditya, llvm-commits, LuoYuanke, LiuChen3

Tags: #llvm

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

4 years agoFix failing testcase to check for the correct output
Bill Wendling [Tue, 3 Dec 2019 00:19:01 +0000 (16:19 -0800)]
Fix failing testcase to check for the correct output

4 years ago[clang-tidy] Rewrite modernize-avoid-bind check.
Zachary Turner [Wed, 20 Nov 2019 19:27:14 +0000 (11:27 -0800)]
[clang-tidy] Rewrite modernize-avoid-bind check.

This represents largely a full re-write of modernize-avoid-bind, adding
significant new functionality in the process. In particular:

* Both boost::bind and std::bind are now supported
* Function objects are supported in addition to functions
* Member functions are supported
* Nested calls are supported using capture-init syntax
* std::ref() and boost::ref() are now recognized, and will capture by reference.
* Rather than capturing with a global =, we now build up an individual
  capture list that is both necessary and sufficient for the call.
* Fixits are supported in a much larger variety of scenarios than before.

All previous tests pass under the re-write, but a large number of new
tests have been added as well.

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

4 years agoPlace the "cold" code piece into the same section as the original function
Bill Wendling [Mon, 2 Dec 2019 07:22:50 +0000 (23:22 -0800)]
Place the "cold" code piece into the same section as the original function

Summary:
This cropped up in the Linux kernel where cold code was placed in an
incompatible section.

Reviewers: compnerd, vsk, tejohnson

Reviewed By: vsk

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoFileCheck IR output for blockaddress in new test
Reid Kleckner [Mon, 2 Dec 2019 23:03:31 +0000 (15:03 -0800)]
FileCheck IR output for blockaddress in new test

Minor improvement to a test added in 1ac700cdef787383ad49a

4 years ago[clang test] Do not assume default target
Thomas Preud'homme [Tue, 26 Nov 2019 22:40:18 +0000 (22:40 +0000)]
[clang test] Do not assume default target

Summary:
clang test Driver/darwin-opt-record.c assumes the default target is
x86_64 by its uses of the -arch x86_64 and -arch x86_64h and thus fail
on systems where it is not the case. Adding a target
x86_64-apple-darwin10 reveals another problem: the driver refuses 2
-arch for an assembly output so this commit also changes the output to
be an object file.

Reviewers: thegameg

Reviewed By: thegameg

Subscribers: cfe-commits

Tags: #clang

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

4 years agoFix comment to more accurately describe C++ language requirements around tail padding.
Richard Smith [Mon, 2 Dec 2019 21:58:37 +0000 (13:58 -0800)]
Fix comment to more accurately describe C++ language requirements around tail padding.

Summary:
As of C++ core issue 43 (http://wg21.link/cwg43), which was voted into
the C++ working draft in 1999, it is not permissible to memcpy a base
class subobject, even if it's of POD type, so there is no problem with
reusing the tail padding of a base class. That issue was voted into the
standard in DR status, so it applies retroactively to C++98 (and is in
any case part of C++03).

So stop suggesting that AlwaysUseTailPadding mode is non-conforming.

Reviewers: rjmccall

Reviewed By: rjmccall

Subscribers: cfe-commits

Tags: #clang

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

4 years agoTemporarily revert "build: avoid hardcoding the libxml2 library name"
Eric Christopher [Mon, 2 Dec 2019 22:30:16 +0000 (14:30 -0800)]
Temporarily revert "build: avoid hardcoding the libxml2 library name"
as it breaks uses of llvm-config --system-libs and the follow-on commit
"build: avoid cached literals being linked against"

This reverts commits 340e7c0b77a7037afefe7255503afe362967b577 and
340e7c0b77a7037afefe7255503afe362967b577.

4 years agoRemove extraneous semicolon.
Bill Wendling [Mon, 2 Dec 2019 22:05:28 +0000 (14:05 -0800)]
Remove extraneous semicolon.

4 years agoAutomatically generated arm64-abi-varargs.ll . NFC
Amaury Séchet [Mon, 2 Dec 2019 21:28:57 +0000 (22:28 +0100)]
Automatically generated arm64-abi-varargs.ll . NFC

4 years ago[PGO][PGSO] Add an optional query type parameter to shouldOptimizeForSize.
Hiroshi Yamauchi [Wed, 20 Nov 2019 21:08:07 +0000 (13:08 -0800)]
[PGO][PGSO] Add an optional query type parameter to shouldOptimizeForSize.

Summary:
In case of a need to distinguish different query sites for gradual commit or
debugging of PGSO. NFC.

Reviewers: davidxl

Subscribers: hiraditya, zzheng, llvm-commits

Tags: #llvm

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

4 years agoRemove redundant file.
Taewook Oh [Mon, 2 Dec 2019 21:44:42 +0000 (13:44 -0800)]
Remove redundant file.

4 years ago[LLDB] [test] Try to fix the test from 7d019d1a3b when run on Windows.
Martin Storsjö [Mon, 2 Dec 2019 21:35:37 +0000 (23:35 +0200)]
[LLDB] [test] Try to fix the test from 7d019d1a3b when run on Windows.

4 years ago[libcxx{,abi}] Emit deplibs only when detected by CMake
Michał Górny [Mon, 2 Dec 2019 10:49:20 +0000 (11:49 +0100)]
[libcxx{,abi}] Emit deplibs only when detected by CMake

This is a followup to 35bc5276ca3.  It fixes the dependent libs usage
in libcxx and libcxxabi to link pthread and rt libraries only if CMake
detects them, rather than based on explicit platform blacklist.

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

4 years agoRevert "[clangd] repair mac tests for 88bccded8fa1"
Sam McCall [Mon, 2 Dec 2019 21:12:23 +0000 (22:12 +0100)]
Revert "[clangd] repair mac tests for 88bccded8fa1"

Revert "[clangd] Try harder to find a plausible `clang` as argv0, particularly on Mac."

4 years ago[Remarks][ThinLTO] Use the correct file extension based on the format
Francis Visoiu Mistrih [Mon, 2 Dec 2019 21:02:48 +0000 (13:02 -0800)]
[Remarks][ThinLTO] Use the correct file extension based on the format

Since we now have multiple formats, the ThinLTO remark files should also
respect that.

4 years ago[lldb/CMake] Add in_call_stack to the utilities package
Jonas Devlieghere [Mon, 2 Dec 2019 20:27:43 +0000 (12:27 -0800)]
[lldb/CMake] Add in_call_stack to the utilities package

A subset of the examples are shipped as python packages. Include the
in_call_stack utility.

4 years ago[lldb/CMake] Simplify logic for adding example Python packages (NFC)
Jonas Devlieghere [Mon, 2 Dec 2019 20:25:03 +0000 (12:25 -0800)]
[lldb/CMake] Simplify logic for adding example Python packages (NFC)

This simplifies the CMake logic for adding the Python examples to the
Python package. It unifies the use of create_python_package by adding
the NOINIT option and removes the `target` argument, which is always
`finish_swig`.

4 years ago[clangd] repair mac tests for 88bccded8fa1
Sam McCall [Mon, 2 Dec 2019 20:55:30 +0000 (21:55 +0100)]
[clangd] repair mac tests for 88bccded8fa1

4 years ago[MIBundles] Move analyzePhysReg out of MIBundleOperands iterator (NFC).
Florian Hahn [Mon, 2 Dec 2019 20:00:56 +0000 (20:00 +0000)]
[MIBundles] Move analyzePhysReg out of MIBundleOperands iterator (NFC).

analyzePhysReg does not really fit into the iterator and moving it
makes it easier to change the base iterator.

Reviewers: evandro, t.p.northover, paquette, MatzeB, arsenm, qcolombet

Reviewed By: arsenm

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

4 years ago[LLDB] Set the right address size on output DataExtractors from ObjectFile
Martin Storsjö [Fri, 29 Nov 2019 11:28:25 +0000 (13:28 +0200)]
[LLDB] Set the right address size on output DataExtractors from ObjectFile

If filling in a DataExtractor from an ObjectFile, e.g. via the
ReadSectionData method, the output DataExtractor gets the address
size from the m_data member.

ObjectFile's m_data member is initialized without knowledge about
the address size (so the address size is set based on the host's
sizeof(void*), and at that point within ObjectFile's constructor,
virtual methods implemented in subclasses (like GetAddressByteSize())
can't be called, therefore fix it up when filling in external
DataExtractors.

This makes sure that line tables from executables with a different
address size are parsed properly; previously this tripped up
DWARFDebugLine::LineTable::parse for 32 bit executables on a 64 bit
host, as the address size in the line table (4) didn't match the
one set in the DWARFDataExtractor.

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

4 years ago[lldb] Fix TestFormattersSBAPI test
António Afonso [Mon, 2 Dec 2019 20:23:45 +0000 (12:23 -0800)]
[lldb] Fix TestFormattersSBAPI test

Summary:
This test was broken in two ways:
* Using the wrong API (e.g.: format = instead of SetFormat)
* The hex checker was only checking "01" which will pass with 0x0000001

Reviewers: clayborg, lanza, wallace

Reviewed By: clayborg

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[GlobalISel] CombinerHelper: Fix a bug in matchCombineCopy
Volkan Keles [Mon, 2 Dec 2019 20:05:09 +0000 (12:05 -0800)]
[GlobalISel] CombinerHelper: Fix a bug in matchCombineCopy

Summary:
When combining COPY instructions, we were replacing the destination registers
with the source register without checking register constraints. This patch adds
a simple logic to check if the constraints match before replacing registers.

Reviewers: qcolombet, aditya_nandakumar, aemerson, paquette, dsanders, Petar.Avramovic

Reviewed By: aditya_nandakumar

Subscribers: rovka, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[ARM] Add ARMVCCThen to tablegen and make use of it. NFC
David Green [Mon, 2 Dec 2019 14:51:49 +0000 (14:51 +0000)]
[ARM] Add ARMVCCThen to tablegen and make use of it. NFC

Similar to the parent, this adds some constants to tablegen to replace
the existing magic values.

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

4 years ago[ARM] Add ARMCC constants to tablegen. NFC
David Green [Mon, 2 Dec 2019 14:49:46 +0000 (14:49 +0000)]
[ARM] Add ARMCC constants to tablegen. NFC

I got tired of looking at magic constants in tablegen files. This adds
condition codes like ARMCCeq and makes use of them.

I also removed the extra patterns for reverse condition codes from
D70296, they should now be covered by the parent commit.

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