platform/upstream/llvm.git
3 years agoAdd userData to the diagnostic handler C API
George [Mon, 23 Nov 2020 17:52:17 +0000 (09:52 -0800)]
Add userData to the diagnostic handler C API

Previously, there was no way to add context to the diagnostic engine via the C API. Adding this ability makes it much easier to reason about memory ownership, particularly in reference-counted languages such as Swift. There are more details in the review comments.

Reviewed By: ftynse, mehdi_amini

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

3 years ago[AArch64] Add tests for masked.gather costs.
Florian Hahn [Mon, 23 Nov 2020 17:33:27 +0000 (17:33 +0000)]
[AArch64] Add tests for masked.gather costs.

3 years ago[TableGen] Eliminte source location from CodeInit
Paul C. Anagnostopoulos [Sun, 22 Nov 2020 14:56:42 +0000 (09:56 -0500)]
[TableGen] Eliminte source location from CodeInit

Step 1 in eliminating the 'code' type.

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

3 years ago[VE] VE Vector Predicated SDNode, vector add isel and tests
Simon Moll [Mon, 23 Nov 2020 14:33:10 +0000 (15:33 +0100)]
[VE] VE Vector Predicated SDNode, vector add isel and tests

VE Vector Predicated (VVP) SDNodes form an intermediate layer between VE
vector instructions and the initial SDNodes.

We introduce 'vvp_add' with isel and tests as the first of these VVP
nodes. VVP nodes have a mask and explicit vector length operand, which
we will make proper use of later.

Reviewed By: kaz7

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

3 years ago[mlir] Temporarily disable flaky mlir-cpu-runner async tests
Alex Zinenko [Mon, 23 Nov 2020 15:50:55 +0000 (16:50 +0100)]
[mlir] Temporarily disable flaky mlir-cpu-runner async tests

These tests fail sporadically on irrelevant commits, e.g.
http://lab.llvm.org:8011/#/builders/61/builds/1777 as well as in local
builds.

3 years agoFix tests for clang-query completion
Stephen Kelly [Mon, 23 Nov 2020 15:22:03 +0000 (15:22 +0000)]
Fix tests for clang-query completion

3 years ago[mlir] Add a print function for memref<*xi64>.
Alexander Belyaev [Mon, 23 Nov 2020 14:55:42 +0000 (15:55 +0100)]
[mlir] Add a print function for memref<*xi64>.

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

3 years ago[VE] Remove magic numbers 176
Kazushi (Jam) Marukawa [Sun, 22 Nov 2020 12:57:22 +0000 (21:57 +0900)]
[VE] Remove magic numbers 176

Remove magic numbers 176 from VE source codes and update comments.

Reviewed By: simoll

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

3 years agoFix speling in comments. NFC.
Jay Foad [Fri, 20 Nov 2020 15:42:52 +0000 (15:42 +0000)]
Fix speling in comments. NFC.

3 years agoRemove the IgnoreImplicitCastsAndParentheses traversal kind
Stephen Kelly [Sat, 21 Nov 2020 18:54:26 +0000 (18:54 +0000)]
Remove the IgnoreImplicitCastsAndParentheses traversal kind

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

3 years agoUpdate mode used in traverse() examples
Stephen Kelly [Sat, 21 Nov 2020 18:47:51 +0000 (18:47 +0000)]
Update mode used in traverse() examples

traverse() predates the IgnoreUnlessSpelledInSource mode. Update example
and test code to use the newer mode.

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

3 years agoRemove automatic traversal from forEach matcher
Stephen Kelly [Sat, 23 May 2020 01:12:51 +0000 (02:12 +0100)]
Remove automatic traversal from forEach matcher

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

3 years ago[test] Update PR reference in testcase [NFC]
Mikael Holmen [Mon, 23 Nov 2020 14:12:15 +0000 (15:12 +0100)]
[test] Update PR reference in testcase [NFC]

The testcase was added in faf848ac32 to test the fix of PR 47969, but
it was named pr48980 (which happens to be the TR number in my downstream
issue system).

3 years ago[mlir] canonicalize away zero-iteration SCF for loops
Alex Zinenko [Fri, 20 Nov 2020 18:22:30 +0000 (19:22 +0100)]
[mlir] canonicalize away zero-iteration SCF for loops

An SCF 'for' loop does not iterate if its lower bound is equal to its upper
bound. Remove loops where both bounds are the same SSA value as such bounds are
guaranteed to be equal. Similarly, remove 'parallel' loops where at least one
pair of respective lower/upper bounds is specified by the same SSA value.

Reviewed By: gysit

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

3 years ago[Inline] Fix in handling of ptrtoint in InlineCost
Mikael Holmen [Mon, 23 Nov 2020 12:15:10 +0000 (13:15 +0100)]
[Inline] Fix in handling of ptrtoint in InlineCost

ConstantOffsetPtrs contains mappings from a Value to a base pointer and
an offset. The offset is typed and has a size, and at least when dealing
with ptrtoint, it could happen that we had a mapping from a ptrtoint
with type i32 to an offset with type i16. This could later cause
problems, showing up in PR 47969 and PR 38500.

In PR 47969 we ended up in an assert complaining that trunc i16 to i16
is invalid and in Pr 38500 that a cmp on an i32 and i16 value isn't
valid.

Reviewed By: spatel

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

3 years ago[lldb] [test] Restore Windows-skip on 'process connect' tests
Michał Górny [Mon, 23 Nov 2020 13:27:02 +0000 (14:27 +0100)]
[lldb] [test] Restore Windows-skip on 'process connect' tests

3 years ago[llvm-readobj][test] - Simplify the gnu-notes.test
Georgii Rymar [Mon, 23 Nov 2020 11:11:09 +0000 (14:11 +0300)]
[llvm-readobj][test] - Simplify the gnu-notes.test

This test contains YAMLs that can be merged with use of macros.
This opens road for adding more test cases.

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

3 years ago[AMDGPU][MC] Improved diagnostic messages
Dmitry Preobrazhensky [Mon, 23 Nov 2020 13:07:26 +0000 (16:07 +0300)]
[AMDGPU][MC] Improved diagnostic messages

See bug 47518 (https://bugs.llvm.org/show_bug.cgi?id=47518)

Reviewers: rampitec

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

3 years agoIgnore noderef attribute in unevaluated context
Jann Horn [Mon, 23 Nov 2020 13:10:35 +0000 (08:10 -0500)]
Ignore noderef attribute in unevaluated context

The noderef attribute is for catching code that accesses pointers in
a different address space. Unevaluated code is always safe in that regard.

3 years ago[mlir] Avoid cloning ops in SCF parallel conversion to CFG
Alex Zinenko [Mon, 23 Nov 2020 12:22:51 +0000 (13:22 +0100)]
[mlir] Avoid cloning ops in SCF parallel conversion to CFG

The existing implementation of the conversion from SCF Parallel operation to
SCF "for" loops in order to further convert those loops to branch-based CFG has
been cloning the loop and reduction body operations into the new loop because
ConversionPatternRewriter was missing support for moving blocks while replacing
their arguments. This functionality now available, use it to implement the
conversion and avoid cloning operations, which may lead to doubling of the IR
size during the conversion.

In addition, this fixes an issue with converting nested SCF "if" conditionals
present in "parallel" operations that would cause the conversion infrastructure
to stop because of the repeated application of the pattern converting "newly"
created "if"s (which were in fact just moved). Arguably, this should be fixed
at the infrastructure level and this fix is a workaround.

Reviewed By: herhut

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

3 years ago[clangd] textDocument/implementation (LSP layer)
Utkarsh Saxena [Wed, 18 Nov 2020 12:25:09 +0000 (13:25 +0100)]
[clangd] textDocument/implementation (LSP layer)

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

3 years ago[AMDGPU][MC] Improved diagnostic messages for invalid literals
Dmitry Preobrazhensky [Mon, 23 Nov 2020 12:44:47 +0000 (15:44 +0300)]
[AMDGPU][MC] Improved diagnostic messages for invalid literals

See bug 47518 (https://bugs.llvm.org/show_bug.cgi?id=47518)

Reviewers: rampitec

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

3 years ago[mlir][Linalg] Drop symbol_source abstraction which does not pay for itself.
Nicolas Vasilache [Mon, 23 Nov 2020 12:16:00 +0000 (12:16 +0000)]
[mlir][Linalg] Drop symbol_source abstraction which does not pay for itself.

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

3 years agoRevert "[clangd] testPath's final result agrees with the passed in Style"
Kadir Cetinkaya [Mon, 23 Nov 2020 12:12:35 +0000 (13:12 +0100)]
Revert "[clangd] testPath's final result agrees with the passed in Style"

This reverts commit 8cec8de2a4e6692da6226bb02cf417eb0e50adde as it
breaks windows buildbots.

3 years ago[VE] Clean canRealignStack implementation
Kazushi (Jam) Marukawa [Sun, 22 Nov 2020 10:36:52 +0000 (19:36 +0900)]
[VE] Clean canRealignStack implementation

Old canRealignStack calls TRI::canRealignStack and hasReservedCallFrame.
But, this hasReservedCallFrame return true whenever for VE since VE
allocates call frame all the time.  It means this canRealignStack is
identical to TRI::canRealignStack.  This patch removes VE's
canRealignStack and let caller call TRI::canRealignStack directly.

Reviewed By: simoll

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

3 years ago[VE][NFC] Clean stack frame description
Kazushi (Jam) Marukawa [Sun, 22 Nov 2020 10:49:45 +0000 (19:49 +0900)]
[VE][NFC] Clean stack frame description

Move stack frame description from VESubtarget.cpp to VEFrameLowering.cpp
and add detail.

Reviewed By: simoll

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

3 years ago[clangd] testPath's final result agrees with the passed in Style
Kadir Cetinkaya [Mon, 23 Nov 2020 09:31:04 +0000 (10:31 +0100)]
[clangd] testPath's final result agrees with the passed in Style

This was confusing, as testRoot on windows results in C:\\clangd-test
and testPath generated with posix explicitly still contained backslashes.

This patch ensures not only the relative part, but the whole final result
respects passed in Style.

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

3 years ago[APInt] Add the truncOrSelf resizing operator to APInt
Kerry McLaughlin [Mon, 23 Nov 2020 11:05:50 +0000 (11:05 +0000)]
[APInt] Add the truncOrSelf resizing operator to APInt

Truncates the APInt if the bit width is greater than the width specified,
otherwise do nothing

Reviewed By: RKSimon

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

3 years ago[clangd] Get rid of clangToolingRefactoring dependency
Kirill Bobyrev [Mon, 23 Nov 2020 10:59:17 +0000 (11:59 +0100)]
[clangd] Get rid of clangToolingRefactoring dependency

D71880 makes this dependency redundant and we can safely remove it. Tested for
both shared lib build and static lib build.

Reviewed By: hokein

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

3 years ago[AArch64][SVE] Allow lax conversion between VLATs and GNU vectors
Joe Ellis [Wed, 18 Nov 2020 12:13:05 +0000 (12:13 +0000)]
[AArch64][SVE] Allow lax conversion between VLATs and GNU vectors

Previously, lax conversions were only allowed between SVE vector-length
agnostic types and vector-length specific types. This meant that code
such as the following:

    #include <arm_sve.h>
    #define N __ARM_FEATURE_SVE_BITS
    #define FIXED_ATTR __attribute__ ((vector_size (N/8)))
    typedef float fixed_float32_t FIXED_ATTR;

    void foo() {
        fixed_float32_t fs32;
        svfloat64_t s64;
        fs32 = s64;
    }

was not allowed.

This patch makes a minor change to areLaxCompatibleSveTypes to allow for
lax conversions to be performed between SVE vector-length agnostic types
and GNU vectors.

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

3 years ago[clangd] Implement Decl canonicalization rules for rename
Kirill Bobyrev [Mon, 23 Nov 2020 10:42:51 +0000 (11:42 +0100)]
[clangd] Implement Decl canonicalization rules for rename

This patch introduces new canonicalization rules which are used for AST-based
rename in Clangd. By comparing two canonical declarations of inspected nodes,
Clangd determines whether both of them belong to the same entity user would
like to rename. Such functionality is relatively concise compared to the
Clang-Rename API that is used right now. It also helps to overcome the
limitations that Clang-Rename originally had and helps to eliminate several
classes of bugs.

Clangd AST-based rename currently relies on Clang-Rename which has design
limitations and also lacks some features. This patch breaks this dependency and
significantly reduces the amount of code to maintain (Clang-Rename is ~2000 LOC,
this patch is just <30 LOC of replacement code).

We eliminate technical debt by simultaneously

* Maintaining feature parity and ensuring no regressions
* Opening a straightforward path to improving existing rename bugs
* Making it possible to add more capabilities to rename feature which would not
  be possible with Clang-Rename

Reviewed By: hokein

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

3 years ago[mlir][Linalg] NFC - Factor out Linalg functionality for shape and loop bounds comput...
Nicolas Vasilache [Mon, 23 Nov 2020 10:13:20 +0000 (10:13 +0000)]
[mlir][Linalg] NFC - Factor out Linalg functionality for shape and loop bounds computation

This revision refactors code used in various Linalg transformations and makes it a first class citizen to the LinalgStructureOpInterface. This is in preparation to allowing more advanced Linalg behavior but is otherwise NFC.

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

3 years ago[AST] Build recovery expression by default for all language.
Haojian Wu [Mon, 23 Nov 2020 09:57:27 +0000 (10:57 +0100)]
[AST] Build recovery expression by default for all language.

The dependency mechanism for C has been implemented, and we have rolled out
this to all internal users, didn't see crashy issues, we consider it is stable
enough.

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

3 years ago[llvm-readelf/obj] - Fix the possible crash when dumping group sections.
Georgii Rymar [Mon, 23 Nov 2020 08:53:40 +0000 (11:53 +0300)]
[llvm-readelf/obj] - Fix the possible crash when dumping group sections.

It is possible to trigger a crash/misbehavior when the st_name field of
the signature symbol goes past the end of the string table.

This patch fixes it.

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

3 years ago[SCEV] Fix incorrect treatment of max taken count. PR48225
Max Kazantsev [Mon, 23 Nov 2020 09:45:20 +0000 (16:45 +0700)]
[SCEV] Fix incorrect treatment of max taken count. PR48225

SCEV makes a logical mistake when handling EitherMayExit in
case when both conditions must be met to exit the loop. The
mistake looks like follows: "if condition `A` fails within at most `X` first
iterations, and `B` fails within at most `Y` first iterations, then `A & B`
fails at most within `min (X, Y)` first iterations". This is wrong, because
both of them must fail at the same time.

Simple example illustrating this is following: we have an IV with step 1,
condition `A` = "IV is even", condition `B` = "IV is odd". Both `A` and `B`
will fail within first two iterations. But it doesn't mean that both of them
will fail within first two first iterations at the same time, which would mean
that IV is neither even nor odd at the same time within first 2 iterations.

We can only do so for known exact BE counts, but not for max.

Differential Revision: https://reviews.llvm.org/D91942
Reviewed By: nikic

3 years ago[llvm-readobj] - Stop using `unwrapOrError` in `DumpStyle<ELFT>::getGroups()`
Georgii Rymar [Fri, 20 Nov 2020 09:03:18 +0000 (12:03 +0300)]
[llvm-readobj] - Stop using `unwrapOrError` in `DumpStyle<ELFT>::getGroups()`

With this we are able to diagnose possible issues much better and
don't exit on an error.

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

3 years ago[clangd] Second attempt at fixing windows buildbots
Kadir Cetinkaya [Mon, 23 Nov 2020 09:06:33 +0000 (10:06 +0100)]
[clangd] Second attempt at fixing windows buildbots

3 years ago[DebugInfo] Refactor code for emitting DWARF expressions for FP constants
Pavel Labath [Fri, 6 Nov 2020 09:44:14 +0000 (10:44 +0100)]
[DebugInfo] Refactor code for emitting DWARF expressions for FP constants

This patch moves the selection of the style used to emit the numbers
(DW_OP_implicit_value vs. DW_OP_const+DW_OP_stack_value) into
DwarfExpression::addUnsignedConstant. This logic is not FP-specific, and
it will be needed for large integers too.

The refactor also makes DW_OP_implicit_value (DW_OP_stack_value worked
already) be used for floating point constants other than float and
double, so I've added a _Float16 test for it.

Split off from D90916.

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

3 years ago[LoopFlatten] Widen IV, support ZExt.
Sjoerd Meijer [Sat, 21 Nov 2020 14:13:36 +0000 (14:13 +0000)]
[LoopFlatten] Widen IV, support ZExt.

I disabled the widening in fa5cb4b because it run in an assert, which was
related to replacing values with different types. I forgot that an extend could
also be a zero-extend, which I have added now. This means that the approach now
is to create and insert a trunc value of the outerloop for each user, and use
that to replace IV values.

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

3 years ago[lldb] Prevent 'process connect' from using local-only plugins
Michał Górny [Fri, 20 Nov 2020 16:12:22 +0000 (17:12 +0100)]
[lldb] Prevent 'process connect' from using local-only plugins

Add a 'can_connect' parameter to Process plugin initialization, and use
it to filter plugins to these capable of remote connections.  This is
used to prevent 'process connect' from picking up a plugin that can only
be used locally, e.g. the legacy FreeBSD plugin.

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

3 years ago[clang-tidy] Fix a nullptr-access crash in unused-raii-check.
Haojian Wu [Mon, 23 Nov 2020 08:44:19 +0000 (09:44 +0100)]
[clang-tidy] Fix a nullptr-access crash in unused-raii-check.

I saw this crash in our internal production, but unfortunately didn't get
reproduced testcase, we likely hit this crash when the AST is ill-formed
(e.g. broken code).

Reviewed By: gribozavr2

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

3 years ago[lldb] [Process/FreeBSDRemote] Fix regset names and related tests
Michał Górny [Sat, 21 Nov 2020 21:15:34 +0000 (22:15 +0100)]
[lldb] [Process/FreeBSDRemote] Fix regset names and related tests

Restore Linux-alike regset names for AVX/MPX registers
as TestLldbGdbServer seems to depend on them.  At the same time, fix
TestRegisters to be aware that they are not available on FreeBSD
and NetBSD, at least until we figure out a better way of reporting
unsupported register sets.

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

3 years ago[lldb] [test] Fix qRegisterInfo lldb-server tests to handle missing registers
Michał Górny [Sat, 21 Nov 2020 20:46:05 +0000 (21:46 +0100)]
[lldb] [test] Fix qRegisterInfo lldb-server tests to handle missing registers

Fix qRegisterInfo tests to handle Exx error response when querying
registers that are not supported on the platform in question.  This
is how FreeBSD and NetBSD platforms reporting missing registers right
now, and there certainly is value from verifying the remaining
registers.

This change fixes the test for FreeBSD but NetBSD has other regressions
that still need to be researched.

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

3 years ago[lldb] [Process/Utility] Declare register overlaps between ST and MM
Michał Górny [Wed, 18 Nov 2020 19:16:01 +0000 (20:16 +0100)]
[lldb] [Process/Utility] Declare register overlaps between ST and MM

Explicitly declare register overlaps/invalidation between ST(i) and MMi
registers.

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

3 years ago[lldb] [Process/FreeBSD] Add missing 'override' kws to POSIXStopInfo
Michał Górny [Sun, 22 Nov 2020 16:42:19 +0000 (17:42 +0100)]
[lldb] [Process/FreeBSD] Add missing 'override' kws to POSIXStopInfo

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

3 years ago[clangd] Attempt at fixing ExternalIndex tests on windows
Kadir Cetinkaya [Mon, 23 Nov 2020 08:16:00 +0000 (09:16 +0100)]
[clangd] Attempt at fixing ExternalIndex tests on windows

3 years ago[libc++] [www] Mark P0482 as "In Progress", as some parts of it are already implemented.
Marek Kurdej [Mon, 23 Nov 2020 08:10:20 +0000 (09:10 +0100)]
[libc++] [www] Mark P0482 as "In Progress", as some parts of it are already implemented.

3 years ago[llvm-readobj] - Don't crash when relocation table goes past the EOF.
Georgii Rymar [Thu, 19 Nov 2020 09:18:18 +0000 (12:18 +0300)]
[llvm-readobj] - Don't crash when relocation table goes past the EOF.

It is possible to trigger reading past the EOF by breaking fields like
DT_PLTRELSZ, DT_RELSZ or DT_RELASZ

This patch adds a validation in `DynRegionInfo` helper class.

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

3 years ago[NFC] Reduce code duplication in binop processing in computeExitLimitFromCondCached
Max Kazantsev [Mon, 23 Nov 2020 06:18:12 +0000 (13:18 +0700)]
[NFC] Reduce code duplication in binop processing in computeExitLimitFromCondCached

Handling of `and` and `or` vastly uses copy-paste. Factored out into
a helper function as preparation step for further fix (see PR48225).

Differential Revision: https://reviews.llvm.org/D91864
Reviewed By: nikic

3 years ago[CodeGen] Use pred_empty (NFC)
Kazu Hirata [Mon, 23 Nov 2020 06:16:12 +0000 (22:16 -0800)]
[CodeGen] Use pred_empty (NFC)

3 years ago[ValueMapper] Remove unused declaration remapFunction (NFC)
Kazu Hirata [Mon, 23 Nov 2020 05:52:03 +0000 (21:52 -0800)]
[ValueMapper] Remove unused declaration remapFunction (NFC)

The function declaration with two parameters was introduced on Apr 16
2016 in commit f0d73f95c15f909c6034f1735632695248bb75a8 without a
corresponding definition.

3 years ago[hwasan] Remove unused declaration shadowBase (NFC)
Kazu Hirata [Mon, 23 Nov 2020 04:08:50 +0000 (20:08 -0800)]
[hwasan] Remove unused declaration shadowBase (NFC)

The function was introduced on Jan 23, 2019 in commit
73078ecd381b5ce95638c7a8e41fcabb6c27703a.

Its definition was removed on Oct 27, 2020 in commit
0930763b4baf926a39dd2d0571fd9e2102ec3831, leaving the declaration
unused.

3 years ago[MLIR] ODS typedef gen fixes & improvements
John Demme [Mon, 23 Nov 2020 00:04:43 +0000 (16:04 -0800)]
[MLIR] ODS typedef gen fixes & improvements

- Fixes bug 48242 point 3 crash.
- Makes the improvments from points 1 & 2.

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

```
   def RTLValueType : Type<CPred<"isRTLValueType($_self)">, "Type"> {
     string cppType = "::mlir::Type";
   }
```
Works now, but merely by happenstance. Parameters expects a `TypeParameter` class def or a string representing a c++ type but doesn't enforce it.

Reviewed By: lattner

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

3 years ago[Clang] Add __STDCPP_THREADS__ to standard predefine macros
Zequan Wu [Wed, 18 Nov 2020 23:26:21 +0000 (15:26 -0800)]
[Clang] Add __STDCPP_THREADS__ to standard predefine macros

According to https://eel.is/c++draft/cpp.predefined#2.6, `__STDCPP_THREADS__` is a predefined macro.

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

3 years ago[ARM] Ensure MVE_TwoOpPattern is used inside Predicate's
David Green [Sun, 22 Nov 2020 21:38:00 +0000 (21:38 +0000)]
[ARM] Ensure MVE_TwoOpPattern is used inside Predicate's

3 years ago[gn build] (manually) port ed424b428
Nico Weber [Sun, 22 Nov 2020 21:12:08 +0000 (16:12 -0500)]
[gn build] (manually) port ed424b428

3 years ago[ARM] MVE VABD tests. NFC
David Green [Sun, 22 Nov 2020 21:16:49 +0000 (21:16 +0000)]
[ARM] MVE VABD tests. NFC

3 years ago[gn build] Port 067ffbfe601
LLVM GN Syncbot [Sun, 22 Nov 2020 21:09:32 +0000 (21:09 +0000)]
[gn build] Port 067ffbfe601

3 years ago[gn build] sort of merge 37ac559fccd4
Nico Weber [Sun, 22 Nov 2020 21:07:33 +0000 (16:07 -0500)]
[gn build] sort of merge 37ac559fccd4

It'd be nicer if there was a group target that forwarded either to
//clang-tools-extra/clangd/index/remote or
//clangd/index/remote/unimplemented based on if remote index is enabled,
but for now it's never enabled in the gn build.

3 years ago[mlir][Python] Support finding pybind11 from the python environment.
Stella Laurenzo [Sat, 21 Nov 2020 01:57:46 +0000 (17:57 -0800)]
[mlir][Python] Support finding pybind11 from the python environment.

* Makes `pip install pybind11` do the right thing with no further config.
* Since we now require a version of pybind11 greater than many LTS OS installs (>=2.6), a more convenient way to get a recent version is preferable.
* Also adds the version spec to find_package so it will skip older versions that may be lying around.
* Tested the full matrix of old system install, no system install, pip install and no pip install.

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

3 years ago[clangd] Fix use-after-free in ProjectAwareIndex tests
Kadir Cetinkaya [Sun, 22 Nov 2020 20:29:45 +0000 (21:29 +0100)]
[clangd] Fix use-after-free in ProjectAwareIndex tests

3 years ago[clangd] Use ProjectAwareIndex in ClangdMain
Kadir Cetinkaya [Thu, 5 Nov 2020 22:55:04 +0000 (23:55 +0100)]
[clangd] Use ProjectAwareIndex in ClangdMain

Put project-aware-index between command-line specified static index and
ClangdServer indexes.

This also moves remote-index dependency from clangDaemon to ClangdMain
in an attempt to prevent cyclic dependency between clangDaemon and
remote-index-marshalling.

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

3 years ago[clangd] Introduce ProjectAwareIndex
Kadir Cetinkaya [Mon, 2 Nov 2020 10:27:21 +0000 (11:27 +0100)]
[clangd] Introduce ProjectAwareIndex

An index implementation that can dispatch to a variety of indexes
depending on the file path. Enables clangd to work with multiple indexes in the
same instance, configured via config files.

Depends on D90749, D90746

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

3 years ago[clangd] Introduce config compilation for External blocks
Kadir Cetinkaya [Tue, 6 Oct 2020 12:21:42 +0000 (13:21 +0100)]
[clangd] Introduce config compilation for External blocks

Compilation logic for External blocks. A few of the high level points:
- Requires exactly one-of File/Server at a time:
  - Server is ignored in case of both, with a warning.
  - Having none is an error, would render ExternalBlock void.
- Ensures mountpoint is an absolute path:
  - Interprets it as relative to FragmentDirectory.
  - Defaults to FragmentDirectory when empty.
- Marks Background as Skip.

Depends on D90748.

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

3 years ago[clangd] Introduce config parsing for External blocks
Kadir Cetinkaya [Thu, 1 Oct 2020 11:29:55 +0000 (12:29 +0100)]
[clangd] Introduce config parsing for External blocks

Enable configuration of remote and static indexes through config files
in addition to command line arguments.

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

3 years agoBuild reproducible tarballs for releases
Aaron Puchert [Sun, 22 Nov 2020 19:51:00 +0000 (20:51 +0100)]
Build reproducible tarballs for releases

Currently the tarballs contain superfluous metadata, like the user name
of the packager and via Pax headers even the PID of the tar process that
packaged the files. We build the monorepo projects directly from the git
repo using "git archive" and for the test-suite we add some flags as
recommended by https://reproducible-builds.org/docs/archives/. We don't
use numeric owners though to be compatible with "git archive".

The advantage of "git archive" is that the releaser doesn't have to
download the tar ball and extract it, rather the archive is built
directly from the repository. This is probably what GitHub uses
internally to produce the tarballs, so I wouldn't expect a difference.

Reviewed By: tstellar

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

3 years ago[Sema] Introduce function reference conversion, NFC
Aaron Puchert [Sun, 22 Nov 2020 17:43:15 +0000 (18:43 +0100)]
[Sema] Introduce function reference conversion, NFC

Technically 'noexcept' isn't a qualifier, so this should be a separate conversion.

Also make the test a pure frontend test.

Reviewed By: rsmith

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

3 years ago[BasicAA] Avoid unnecessary cache update (NFC)
Nikita Popov [Sun, 22 Nov 2020 19:09:56 +0000 (20:09 +0100)]
[BasicAA] Avoid unnecessary cache update (NFC)

If the final recursive query returns MayAlias as well, there is
no need to update the cache (which already stores MayAlias).

3 years ago[CostModel] add basic handling for FP maximum/minimum intrinsics
Sanjay Patel [Sun, 22 Nov 2020 18:43:53 +0000 (13:43 -0500)]
[CostModel] add basic handling for FP maximum/minimum intrinsics

This might be a regression for some ARM targets, but that should
be changed in the target-specific overrides.

There is apparently still no default lowering for these nodes,
so I am assuming these intrinsics are not in common use.
X86, PowerPC, and RISC-V for example, just crash given the most
basic IR.

3 years ago[CostModel] add tests for FP maximum; NFC
Sanjay Patel [Sun, 22 Nov 2020 18:33:42 +0000 (13:33 -0500)]
[CostModel] add tests for FP maximum; NFC

These min/max intrinsics are not handled in the basic
implementation and probably not handled in target-specific
overrides either.

3 years ago[ValueTracking][MemCpyOpt] avoid crash on inttoptr with vector pointer type (PR48075)
Sanjay Patel [Sun, 22 Nov 2020 17:54:18 +0000 (12:54 -0500)]
[ValueTracking][MemCpyOpt] avoid crash on inttoptr with vector pointer type (PR48075)

3 years ago[BasicAA] Add more phi-phi tests (NFC)
Nikita Popov [Sun, 22 Nov 2020 12:50:23 +0000 (13:50 +0100)]
[BasicAA] Add more phi-phi tests (NFC)

Test a few more variations:
 * NoAlias with different strides
 * MustAlias without loop
 * MustAlias with same stride
 * MustAlias base pointers with different stride

3 years ago[libc++] [libc++abi] Use C++20 standard.
Marek Kurdej [Sun, 22 Nov 2020 14:56:39 +0000 (15:56 +0100)]
[libc++] [libc++abi] Use C++20 standard.

This change is needed to use char8_t when building libc++.
Using the same standard in libc++abi for coherence.

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

Reviewed By: ldionne, #libc, #libc_abi

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

3 years agoAdd Semantic check for Flang OpenMP 4.5 - 2.7.1 ordered and collapse clause
Yashaswini [Sun, 22 Nov 2020 13:06:59 +0000 (18:36 +0530)]
Add Semantic check for Flang OpenMP 4.5 - 2.7.1 ordered and collapse clause

Semantic check added to check and restrict the value of the parameter in the COLLAPSE or ORDERED clause
if it is larger than the number of nested loops following the construct.

Test Cases:
omp-do-collapse-positivecases.f90
omp-do-collapse.f90
omp-do-ordered-positivecases.f90
omp-do-ordered.f90

Reviewed by: Kiran Chandramohan @kiranchandramohan , Valentin Clement @clementval

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

3 years ago[DAG] LowerMINMAX - move default expansion to generic TargetLowering::expandIntMINMAX
Simon Pilgrim [Sun, 22 Nov 2020 13:02:27 +0000 (13:02 +0000)]
[DAG] LowerMINMAX - move default expansion to generic TargetLowering::expandIntMINMAX

This is part of the discussion on D91876 about trying to reduce custom lowering of MIN/MAX ops on older SSE targets - if we can improve generic vector expansion we should be able to relax the limitations in SelectionDAGBuilder when it will let MIN/MAX ops be generated, and avoid having to flag so many ops as 'custom'.

3 years ago[clangd] Fix compile error after 20b69af7
Nathan James [Sun, 22 Nov 2020 10:48:48 +0000 (10:48 +0000)]
[clangd] Fix compile error after 20b69af7

Some of the buildbots were failing due to what seems to be them using a non c++14 compilant std::string implementation.
Since c++14 std::basic_string::append(const basic_string, size_t, size_t) has a defaulted 3rd paramater, but some of the build bots were reporting that it wasn't defaulted in their implementation.

3 years ago[Analysis] Remove unused system header includes
Simon Pilgrim [Sun, 22 Nov 2020 10:30:43 +0000 (10:30 +0000)]
[Analysis] Remove unused system header includes

Cleanup unused system headers and fix an implicit dependency

3 years ago[clangd] Add clang-tidy options to config
Nathan James [Sun, 22 Nov 2020 10:04:00 +0000 (10:04 +0000)]
[clangd] Add clang-tidy options to config

First step of implementing clang-tidy configuration into clangd config.
This is just adding support for reading and verifying the clang tidy options from the config fragments.
No support is added for actually using the options within clang-tidy yet.

That will be added in a follow up as its a little more involved.

Reviewed By: sammccall

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

3 years ago[RISCV] Use separate Lo and Hi MemOperands when expanding BuildPairF64Pseudo and...
Craig Topper [Sun, 22 Nov 2020 08:43:12 +0000 (00:43 -0800)]
[RISCV] Use separate Lo and Hi MemOperands when expanding BuildPairF64Pseudo and SplitF64Pseudo.

We generate two 4 byte loads or two stores as part of the expansion.
Previously the MemOperand was set the same for both to cover the
full 8 bytes. Now we set a separate 4 byte mem operand for each
with a 4 byte offset for the high part.

3 years ago[PowerPC] Extend folding RLWINM + RLWINM to post-RA.
Esme-Yi [Sun, 22 Nov 2020 07:37:24 +0000 (07:37 +0000)]
[PowerPC] Extend folding RLWINM + RLWINM to post-RA.

Summary: We have the patterns to fold 2 RLWINMs before RA, while some RLWINM will be generated after RA, for example rGc4690b007743. If the RLWINM generated after RA followed by another RLWINM, we expect to perform the optimization too.

Reviewed By: shchenz

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

3 years ago[MBP] Remove unused declaration shouldPredBlockBeOutlined (NFC)
Kazu Hirata [Sun, 22 Nov 2020 07:35:02 +0000 (23:35 -0800)]
[MBP] Remove unused declaration shouldPredBlockBeOutlined (NFC)

The function was introduced on Jun 12, 2016 in commit
071d0f180794f7819c44026815614ce8fa00a3bd.  Its definition was removed
on Mar 2, 2017 in commit 1393761e0ca3fe8271245762f78daf4d5208cd77.

3 years agoAdd Semantic check for Flang OpenMP 4.5 - 2.15.3.2 and 2.15.3.3 shared and private...
Yashaswini [Sun, 22 Nov 2020 06:32:00 +0000 (12:02 +0530)]
Add Semantic check for Flang OpenMP 4.5 - 2.15.3.2 and 2.15.3.3 shared and private clause

Semantic check to restrict the appearance of a variable that is part of another variable
 (as an array or structure element) in a PRIVATE or SHARED clause.

Test Cases:

omp-parallel-private01.f90
omp-parallel-private02.f90
omp-parallel-private03.f90
omp-parallel-private04.f90
omp-parallel-shared01.f90
omp-parallel-shared02.f90
omp-parallel-shared03.f90
omp-parallel-shared04.f90

Reviewed by: Kiran Chandramohan @kiranchandramohan , Valentin Clement @clementval

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

3 years ago[MachineLICM] Remove unused declaration HoistRegion
Kazu Hirata [Sun, 22 Nov 2020 06:55:37 +0000 (22:55 -0800)]
[MachineLICM] Remove unused declaration HoistRegion

The function definition was removed on Dec 22, 2011 in commit
in 1eed5b51e87758affdbc10627b4a0884ab86606f.

3 years ago[SelectionDAG] Remove unused declaration ExpandStrictFPOp (NFC)
Kazu Hirata [Sun, 22 Nov 2020 06:29:44 +0000 (22:29 -0800)]
[SelectionDAG] Remove unused declaration ExpandStrictFPOp (NFC)

ExpandStrictFPOp started taking two parameters instead of one on Jan
10, 2020 in commit f678fc7660b36ce0ad6ce4f05eaa28f3e9fdedb5, but the
declaration for the single-perameter version has remained since.

3 years agothinlto_embed_bitcode.ll: clarify grep should treat input as text
Mircea Trofin [Sun, 22 Nov 2020 05:46:53 +0000 (21:46 -0800)]
thinlto_embed_bitcode.ll: clarify grep should treat input as text

The input to the test's use of grep should be treated as text, and
that's not the case on certain Linux distros. Added --text.

3 years ago[llvm][clang][mlir] Add checks for the return values from Target::createXXX to preven...
Ella Ma [Sun, 22 Nov 2020 05:04:12 +0000 (21:04 -0800)]
[llvm][clang][mlir] Add checks for the return values from Target::createXXX to prevent protential null deref

All these potential null pointer dereferences are reported by my static analyzer for null smart pointer dereferences, which has a different implementation from `alpha.cplusplus.SmartPtr`.

The checked pointers in this patch are initialized by Target::createXXX functions. When the creator function pointer is not correctly set, a null pointer will be returned, or the creator function may originally return a null pointer.

Some of them may not make sense as they may be checked before entering the function, but I fixed them all in this patch. I submit this fix because 1) similar checks are found in some other places in the LLVM codebase for the same return value of the function; and, 2) some of the pointers are dereferenced before they are checked, which may definitely trigger a null pointer dereference if the return value is nullptr.

Reviewed By: tejohnson, MaskRay, jpienaar

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

3 years ago[StaticAnalyzer] Support struct annotations in FuchsiaHandleChecker
Haowei Wu [Sun, 22 Nov 2020 03:59:51 +0000 (19:59 -0800)]
[StaticAnalyzer] Support struct annotations in FuchsiaHandleChecker

Support adding handle annotations to sturucture that contains
handles. All the handles referenced by the structure (direct
value or ptr) would be treated as containing the
release/use/acquire annotations directly.

Patch by Yu Shan

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

3 years ago[InstCombine] Use is_contained (NFC)
Kazu Hirata [Sat, 21 Nov 2020 23:47:11 +0000 (15:47 -0800)]
[InstCombine] Use is_contained (NFC)

3 years agoFix shared build.
Michael Liao [Sat, 21 Nov 2020 22:06:41 +0000 (17:06 -0500)]
Fix shared build.

3 years ago[libunwind] Delete unused handlerNotFound in unwind_phase1
Fangrui Song [Sat, 21 Nov 2020 20:38:00 +0000 (12:38 -0800)]
[libunwind] Delete unused handlerNotFound in unwind_phase1

3 years ago[BasicAA] Remove unnecessary sextOrSelf (NFC)
Nikita Popov [Sat, 21 Nov 2020 20:31:06 +0000 (21:31 +0100)]
[BasicAA] Remove unnecessary sextOrSelf (NFC)

We are doing a sextOrTrunc directly afterwards, so this seems
useless. There is a multiplication in between, but truncating
before or after the multiplication should not make a difference.

3 years ago[compiler-rt] [profile] Silence a warning about an unused function on mingw targets
Martin Storsjö [Fri, 20 Nov 2020 09:15:38 +0000 (11:15 +0200)]
[compiler-rt] [profile] Silence a warning about an unused function on mingw targets

This function is only used within the ifdef below.

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

3 years ago[BasicAA] Return DecomposedGEP (NFC)
Nikita Popov [Sat, 21 Nov 2020 19:47:11 +0000 (20:47 +0100)]
[BasicAA] Return DecomposedGEP (NFC)

Instead of requiring the caller to initialize the DecomposedGEP
structure and then passing it in by reference, make
DecomposeGEPExpression() responsible for initializing and returning
the structure.

3 years ago[BasicAA] Remove some intermediate variables (NFC)
Nikita Popov [Sat, 21 Nov 2020 19:29:28 +0000 (20:29 +0100)]
[BasicAA] Remove some intermediate variables (NFC)

Use DecompGEP1.Offset instead of GEP1BaseOffset, etc. I found the
asymmetry of modifying DecompGEP1.VarIndices, but not modifying
DecompGEP1.Offset odd here.

3 years ago[NFC] Fix typo in atomic
clementval [Sat, 21 Nov 2020 19:32:31 +0000 (14:32 -0500)]
[NFC] Fix typo in atomic

3 years ago[flang][openmp] Separate memory-order-clause parser creating OmpClause node
Valentin Clement [Sat, 21 Nov 2020 19:31:17 +0000 (14:31 -0500)]
[flang][openmp] Separate memory-order-clause parser creating OmpClause node

This patch introduce the separate parser for the memory-order-clause from the general
OmpClauseList. This parser still creates OmpClause node and therefore can use all the feature
from TableGen and the OmpStructureChecker.
This is applied only for the Flush construct in this patch and it should be applied for
atomic as well.

This is the approach we disscussed several time during the weekly call.

Reviewed By: kiranchandramohan, sameeranjoshi

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

3 years ago[BasicAA] Remove stale FIXME (NFC)
Nikita Popov [Sat, 21 Nov 2020 19:05:47 +0000 (20:05 +0100)]
[BasicAA] Remove stale FIXME (NFC)

If aliasGEP returns MayAlias, the code does fall through to
aliasPHI etc, so this FIXME is no longer applicable.

3 years ago[X86] Include %rip for 32-bit RIP-relative relocs for x32
Harald van Dijk [Sat, 21 Nov 2020 17:20:20 +0000 (09:20 -0800)]
[X86] Include %rip for 32-bit RIP-relative relocs for x32

%rip was only included for 64-bit RIP-relative relocations, but needs to be included for 32-bit as well.

Reviewed By: MaskRay, RKSimon

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

3 years agoMachineDominators.h - remove unused <vector> include
Simon Pilgrim [Sat, 21 Nov 2020 17:11:08 +0000 (17:11 +0000)]
MachineDominators.h - remove unused <vector> include

3 years agoDominanceFrontier - remove unused <vector> includes
Simon Pilgrim [Sat, 21 Nov 2020 17:04:30 +0000 (17:04 +0000)]
DominanceFrontier - remove unused <vector> includes