platform/upstream/llvm.git
2 years ago[clang] Check unsupported types in expressions
Andrew Savonichev [Wed, 10 Mar 2021 17:23:41 +0000 (20:23 +0300)]
[clang] Check unsupported types in expressions

The patch adds missing diagnostics for cases like:

  float F3 = ((__float128)F1 * (__float128)F2) / 2.0f;

Sema::checkDeviceDecl (renamed to checkTypeSupport) is changed to work
with a type without the corresponding ValueDecl. It is also refactored
so that host diagnostics for unsupported types can be added here as
well.

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

2 years ago[OpenCL] Initialize temporaries in the private address space
Ole Strohm [Mon, 13 Sep 2021 11:29:16 +0000 (12:29 +0100)]
[OpenCL] Initialize temporaries in the private address space

This patch fixes initializing temporaries, which are currently initialized
without an address space, meaning that no constructor can ever be applicable.
Now they will be constructed in the private addrspace.

Fixes the second issue in PR43296.

Reviewed By: Anastasia

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

2 years ago[mlir][Linalg] Use reify for padded op shape derivation.
Nicolas Vasilache [Fri, 10 Sep 2021 07:12:14 +0000 (07:12 +0000)]
[mlir][Linalg] Use reify for padded op shape derivation.

Previously, we would insert a DimOp and rely on later canonicalizations.
Unfortunately, reifyShape kind of rewrites are not canonicalizations anymore.
This introduces undesirable pass dependencies.

Instead, immediately reify the result shape and avoid the DimOp altogether.
This is akin to a local folding, which avoids introducing more reliance on `-resolve-shaped-type-result-dims` (similar to compositions of `affine.apply` by construction to avoid chains of size > 1).

It does not completely get rid of the reliance on the pass as the process is merely local: calling the pass may still be necessary for global effects. Indeed, one of the tests still requires the pass.

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

2 years ago[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function...
Kristóf Umann [Thu, 19 Aug 2021 13:37:02 +0000 (15:37 +0200)]
[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it

Fix a compilation error due to a missing 'template' keyword.

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

2 years ago[OpenCL] Support cl_ext_float_atomics
Sven van Haastregt [Mon, 13 Sep 2021 11:06:04 +0000 (12:06 +0100)]
[OpenCL] Support cl_ext_float_atomics

See https://github.com/KhronosGroup/OpenCL-Docs/pull/552 for initial
specification.

Patch by Haonan Yang.

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

2 years ago[lldb] Remove redundant register alt_names
Michał Górny [Fri, 10 Sep 2021 11:56:24 +0000 (13:56 +0200)]
[lldb] Remove redundant register alt_names

Remove redundant register alt_names that correspond to their respective
generic names.  D108554 makes it possible to query registers through
their generic names directly, therefore making repeating them via
alt_name unnecessary.

While at it, also remove alt_names that are equal to register names
on PPC.

This patch does not alter register definitions where the generic names
are listed as primary names, and other names are provided as alt_name
(e.g. ARM).

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

2 years ago[lldb] Support querying registers via generic names without alt_names
Michał Górny [Mon, 23 Aug 2021 13:29:45 +0000 (15:29 +0200)]
[lldb] Support querying registers via generic names without alt_names

Update GetRegisterInfoByName() methods to support getting registers
by a generic name independently of alt_name entries in the register
context.  This makes it possible to use generic names when interacting
with gdbserver (that does not supply alt_names).  It also makes it
possible to remove some of the duplicated information from register
context declarations and/or use alt_names for another purpose.

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

2 years ago[AArch64] NFC: Remove unused template args
Cullen Rhodes [Mon, 13 Sep 2021 10:10:32 +0000 (10:10 +0000)]
[AArch64] NFC: Remove unused template args

Identified in D109359.

Reviewed By: dmgreen

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

2 years ago[AArch64] Regenerate some test checks. NFC
David Green [Mon, 13 Sep 2021 10:29:44 +0000 (11:29 +0100)]
[AArch64] Regenerate some test checks. NFC

This regenerates some of the tests that had very-close-to-updated check
line already, in order to make them more maintainable.

2 years ago[VectorCombine] Support AND/UREM indices that require freezing.
Florian Hahn [Mon, 13 Sep 2021 10:21:45 +0000 (11:21 +0100)]
[VectorCombine] Support AND/UREM indices that require freezing.

38b098be6605 limited scalarization to indices that are known non-poison.
For certain patterns that restrict the range of an index, we can insert
a freeze of the original value, to prevent propagation of poison.

Reviewed By: lebedev.ri

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

2 years ago[llvm][sve] Lowering for VLS masked extending loads
David Truby [Wed, 1 Sep 2021 11:49:48 +0000 (12:49 +0100)]
[llvm][sve] Lowering for VLS masked extending loads

This extends the custom lowering for extending loads on
fixed length vectors in SVE to support masked extending loads.

The existing tests for correct behaviour of masked extending loads
exhibit bad code generation due to the legalistaion of i1 vectors.
They have been left as-is and new tests have been added that do not
exhibit this behaviour.

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

2 years ago[Sema] Add test for __builtin_fminf errors.
Florian Hahn [Mon, 13 Sep 2021 10:02:22 +0000 (11:02 +0100)]
[Sema] Add test for __builtin_fminf errors.

2 years ago[AArch64][SVE] NFC: Remove unused name from cvt builtins
Cullen Rhodes [Mon, 13 Sep 2021 09:46:31 +0000 (09:46 +0000)]
[AArch64][SVE] NFC: Remove unused name from cvt builtins

Identified in D109359.

Reviewed By: paulwalker-arm, dmgreen

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

2 years ago[Hexagon] NFC: Remove unused tblgen template args
Cullen Rhodes [Mon, 13 Sep 2021 09:46:04 +0000 (09:46 +0000)]
[Hexagon] NFC: Remove unused tblgen template args

Identified in D109359.

Reviewed By: kparzysz

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

2 years ago[Lanai] NFC: Remove unused tblgen template arg 'OpNode'
Cullen Rhodes [Mon, 13 Sep 2021 09:45:55 +0000 (09:45 +0000)]
[Lanai] NFC: Remove unused tblgen template arg 'OpNode'

Identified in D109359.

Reviewed By: jpienaar

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

2 years ago[NVPTX] NFC: Remove unused template arg '_'
Cullen Rhodes [Mon, 13 Sep 2021 09:45:36 +0000 (09:45 +0000)]
[NVPTX] NFC: Remove unused template arg '_'

Identified in D109359.

Reviewed By: tra

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

2 years ago[X86] Adjust Keylocker handle mem size
Xiang1 Zhang [Mon, 13 Sep 2021 10:02:52 +0000 (18:02 +0800)]
[X86] Adjust Keylocker handle mem size

Reviewed By: Topper Craig

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

2 years agoRevert "[X86] Adjust Keylocker handle mem size"
Xiang1 Zhang [Mon, 13 Sep 2021 10:00:46 +0000 (18:00 +0800)]
Revert "[X86] Adjust Keylocker handle mem size"

This reverts commit 3731de6b7f2d42d40151f9574636bc4d5ccfa5e3.

2 years ago[X86] Adjust Keylocker handle mem size
Xiang1 Zhang [Thu, 9 Sep 2021 07:28:43 +0000 (15:28 +0800)]
[X86] Adjust Keylocker handle mem size

Reviewed By: Topper Craig

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

2 years ago[mlir] Add missing namespace to createInlinerPass
Valentin Clement [Mon, 13 Sep 2021 09:58:07 +0000 (11:58 +0200)]
[mlir] Add missing namespace to createInlinerPass

One of the createInlinerPass does not have the mlir:: namespace

Reviewed By: mehdi_amini

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

2 years agoXFAIL test `missing-abstract-variable.ll` for RISC-V
Luís Marques [Mon, 13 Sep 2021 09:37:29 +0000 (10:37 +0100)]
XFAIL test `missing-abstract-variable.ll` for RISC-V

This test fails for many architectures. Also XFAIL for RISC-V.

2 years ago[LoopBoundSplit] Check the start value of split cond AddRec
Jingu Kang [Tue, 7 Sep 2021 09:19:41 +0000 (10:19 +0100)]
[LoopBoundSplit] Check the start value of split cond AddRec

After transformation, we assume the split condition of the pre-loop is always
true. In order to guarantee it, we need to check the start value of the split
cond AddRec satisfies the split condition.

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

2 years ago[AMDGPU] Minor cleanup after D109483. NFC.
Jay Foad [Mon, 13 Sep 2021 08:04:30 +0000 (09:04 +0100)]
[AMDGPU] Minor cleanup after D109483. NFC.

2 years ago[yaml2obj][XCOFF] customize the string table
Esme-Yi [Mon, 13 Sep 2021 09:24:38 +0000 (09:24 +0000)]
[yaml2obj][XCOFF] customize the string table

Summary: The patch adds support for yaml2obj customizing the string table.

Reviewed By: jhenderson

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

2 years ago[NFC] Replace unsigned VF with ElementCount in EpilogueLoopVectorizationInfo
David Sherwood [Tue, 7 Sep 2021 15:05:25 +0000 (16:05 +0100)]
[NFC] Replace unsigned VF with ElementCount in EpilogueLoopVectorizationInfo

This patch simply replaces any unsigned VFs with ElementCounts. It's
still NFC because at the moment epilogue vectorisation is disabled
when the main vector loop uses scalable vectors.

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

2 years ago[LAA] Add additional pointer phi tests.
Florian Hahn [Mon, 13 Sep 2021 08:36:12 +0000 (09:36 +0100)]
[LAA] Add additional pointer phi tests.

2 years agoFix scan-build-py executable lookup path
serge-sans-paille [Mon, 13 Sep 2021 08:25:45 +0000 (10:25 +0200)]
Fix scan-build-py executable lookup path

Once installed, scan-build-py doesn't know anything about its auxiliary
executable and can't find them.
Use relative path wrt. scan-build-py script.

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

2 years ago[mlir] Update bazel build for 802bf02a738e091d5bf22c03e83204a38d2c7950
Benjamin Kramer [Mon, 13 Sep 2021 08:51:08 +0000 (10:51 +0200)]
[mlir] Update bazel build for 802bf02a738e091d5bf22c03e83204a38d2c7950

2 years ago[lldb] Remove PluginInterface::GetPluginVersion
Pavel Labath [Fri, 10 Sep 2021 12:38:27 +0000 (14:38 +0200)]
[lldb] Remove PluginInterface::GetPluginVersion

In all these years, we haven't found a use for this function (it has
zero callers). Lets just remove the boilerplate.

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

2 years ago[Test] Add more sophisticated tests for switch UB opt
Max Kazantsev [Mon, 13 Sep 2021 08:27:33 +0000 (15:27 +0700)]
[Test] Add more sophisticated tests for switch UB opt

Optimizer is being too smart with existing tests, and the transform
gets concealed by following transforms.

2 years ago[RISCV] Rename prefix `FeatureExt*` to `FeatureStdExt*` for all sub-extension
Jim Lin [Mon, 13 Sep 2021 05:52:03 +0000 (13:52 +0800)]
[RISCV] Rename prefix `FeatureExt*` to `FeatureStdExt*` for all sub-extension

Rename prefix `FeatureExt*` to `FeatureStdExt*` for all sub-extension for consistency

Reviewed By: HsiangKai, asb

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

2 years ago[XCOFF] Fix the program abortion issue in XCOFFObjectFile::getSectionContents.
Esme-Yi [Mon, 13 Sep 2021 07:54:33 +0000 (07:54 +0000)]
[XCOFF] Fix the program abortion issue in XCOFFObjectFile::getSectionContents.

Summary: Use std::move(E) to avoid `Program aborted due to an unhandled Error`

Reviewed By: jhenderson

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

2 years ago[X86][SLM] Fix DIVPD/DIVPS/RCPPS/RSQRTPS/SQRTPD/SQRTPS/DPPD/DPPS uops, latency and...
Simon Pilgrim [Sat, 11 Sep 2021 19:29:25 +0000 (20:29 +0100)]
[X86][SLM] Fix DIVPD/DIVPS/RCPPS/RSQRTPS/SQRTPD/SQRTPS/DPPD/DPPS uops, latency and throughput

The packed variants of the instructions had been modelled as the same as the scalar variants.

Reported during a run of llvm-exegesis on a cheap SLM box and matches what Agner / InstLatX64 report as well.

2 years ago[InstCombine] Add PR51784 test cases
Simon Pilgrim [Sat, 11 Sep 2021 19:17:10 +0000 (20:17 +0100)]
[InstCombine] Add PR51784 test cases

2 years ago[lldb][NFC] Cleanup EditlineHistory
Raphael Isemann [Mon, 13 Sep 2021 06:57:18 +0000 (08:57 +0200)]
[lldb][NFC] Cleanup EditlineHistory

2 years ago[JITLink] Add initial native TLS support to ELFNix platform
luxufan [Sat, 11 Sep 2021 03:11:48 +0000 (11:11 +0800)]
[JITLink] Add initial native TLS support to ELFNix platform

This patch use the same way as the https://reviews.llvm.org/rGfe1fa43f16beac1506a2e73a9f7b3c81179744eb to handle the thread local variable.

It allocates 2 * pointerSize space in GOT to represent the thread key and data address. Instead of using the _tls_get_addr function, I customed a function __orc_rt_elfnix_tls_get_addr to get the address of thread local varible. Currently, this is a wip patch, only one TLS relocation R_X86_64_TLSGD is supported and I need to add the corresponding test cases.

To allocate the TLS  descriptor in GOT, I need to get the edge kind information in PerGraphGOTAndPLTStubBuilder, So I add a `Edge::Kind K` argument in some functions in PerGraphGOTAndPLTStubBuilder.h. If it is not suitable, I can think further to solve this problem.

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

2 years ago[mlir] Allows to query traits from types and attributes
Mathieu Fehr [Mon, 13 Sep 2021 06:22:19 +0000 (06:22 +0000)]
[mlir] Allows to query traits from types and attributes

Types and attributes now have a `hasTrait` function that allow users to check
if a type defines a trait.
Also, AbstractType and AbstractAttribute has now a `hasTraitFn` field to carry
the implementation of the `hasTrait` function of the concrete type or attribute.
This patch also adds the remaining functions to access type and attribute traits
in TableGen.

Reviewed By: rriddle

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

2 years agoAdd sanity check in MLIR ODS to catch case where an arguments/results/regions/success...
Mehdi Amini [Thu, 9 Sep 2021 00:10:16 +0000 (00:10 +0000)]
Add sanity check in MLIR ODS to catch case where an arguments/results/regions/successors names overlap

This is making a tablegen crash with a more friendly error.

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

2 years ago[lldb] [testsuite] Fix false failures on "\n" regex match
Jan Kratochvil [Mon, 13 Sep 2021 05:35:12 +0000 (07:35 +0200)]
[lldb] [testsuite] Fix false failures on "\n" regex match

Regex is matching a binary so it needs `re.DOTALL`.
vFile:fstat packet data ATTACHMENT is not hex-encoded but it is only
escaped.

It is difficult to reproduce, it came from buildbot:
  https://lab.llvm.org/staging/#/builders/16/builds/10597

******************** TEST 'lldb-api :: tools/lldb-server/TestGdbRemotePlatformFile.py' FAILED ********************
FAIL: test_platform_file_fstat_llgs (TestGdbRemotePlatformFile.TestGdbRemotePlatformFile)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py", line 52, in test_method
    return attrvalue(self)
  File "lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py", line 259, in test_platform_file_fstat
    context = self.expect_gdbremote_sequence()
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py", line 621, in expect_gdbremote_sequence
    return expect_lldb_gdbserver_replay(
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py", line 198, in expect_lldb_gdbserver_replay
    context = sequence_entry.assert_match(
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py", line 479, in assert_match
    return self._assert_regex_match(asserter, actual_packet, context)
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py", line 446, in _assert_regex_match
    asserter.fail(
AssertionError: regex '^\$F([0-9a-fA-F]+);(.*)#[0-9a-fA-F]{2}$' failed to match against content '$F40;^@^@^@ ^@
^C<8d>^@^@<81><80>^@^@^@^A^@^@^CX^@^@^CX^@^@^@^@^@^@^@^@^@^@^@^W^@^@^@^@^@^@^P^@^@^@^@^@^@^@^@
a=XXa=XXa=XX#6b'

2 years ago[OpenMP] [OMPD] OPENMP_INSTALL_LIBDIR is set for the install dir
Vignesh Balasubramanian [Mon, 13 Sep 2021 04:47:44 +0000 (10:17 +0530)]
[OpenMP] [OMPD] OPENMP_INSTALL_LIBDIR is set for the install dir

OPENMP_INSTALL_LIBDIR is set to the installation path of shared and static
libompd.This should avoid the mixing of 32 and 64 bit on same path in
multi-lib set-up.

Reviewed By: @mceier
Differential Revision: https://reviews.llvm.org/D109352

2 years agoAdd semantic token modifier for non-const reference parameter
Tom Praschan [Mon, 13 Sep 2021 04:34:02 +0000 (00:34 -0400)]
Add semantic token modifier for non-const reference parameter

See https://github.com/clangd/clangd/issues/839

Reviewed By: sammccall

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

2 years ago[NFC][CoroSplit] Directly use Function::getFunctionType()
Arthur Eubanks [Mon, 13 Sep 2021 04:33:55 +0000 (21:33 -0700)]
[NFC][CoroSplit] Directly use Function::getFunctionType()

2 years ago[IndVars] Break backedge and replace PHIs if loop exits on 1st iteration
Max Kazantsev [Mon, 13 Sep 2021 04:29:33 +0000 (11:29 +0700)]
[IndVars] Break backedge and replace PHIs if loop exits on 1st iteration

Implement TODO in optimizeLoopExits. Now if we have proved that some loop exit
is taken on 1st iteration, we make all branches in the following exiting blocks
always branch out of the loop and their conditions simplified away.

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D108910
Reviewed By: lebedev.ri

2 years ago[IndVars] Replace PHIs if loop exits on 1st iteration
Max Kazantsev [Mon, 13 Sep 2021 03:48:42 +0000 (10:48 +0700)]
[IndVars] Replace PHIs if loop exits on 1st iteration

This is a part of D108910.
We replace all loop PHIs with values coming from the loop preheader if
we proved that backedge is never taken.

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D109596
Reviewed By: lebedev.ri

2 years ago[NFC] Directly use OpenMPIRBuilder::Ident instead of IdentPtr->getPointerElementType()
Arthur Eubanks [Mon, 13 Sep 2021 03:45:14 +0000 (20:45 -0700)]
[NFC] Directly use OpenMPIRBuilder::Ident instead of IdentPtr->getPointerElementType()

2 years ago[PowerPC] [NFC] Add Big-Endian checks for existing MMA tests
Ahsan Saghir [Mon, 13 Sep 2021 00:39:35 +0000 (19:39 -0500)]
[PowerPC] [NFC] Add Big-Endian checks for existing MMA tests

This patch adds Big-Endian checks for the existing MMA test cases.
It also changes the target for these test cases to pwr10.

Reviewed By: #powerpc, nemanjai

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

2 years ago[Attributor][FIX] AACallEdges, fix propagation error.
Kuter Dinel [Sun, 12 Sep 2021 23:41:54 +0000 (02:41 +0300)]
[Attributor][FIX] AACallEdges, fix propagation error.

This patch fixes a error made in 2cc6f7c8e108. That patch
added a call site position but there was a small error with the way
the presence of a unknown call edge was being propagated from call site
to function. This patch fixes that error. This error was effecting some
AMDGPU tests.

2 years ago[NFC] Avoid using pointee types in PPCISelLowering
Arthur Eubanks [Mon, 13 Sep 2021 00:36:46 +0000 (17:36 -0700)]
[NFC] Avoid using pointee types in PPCISelLowering

A cmpxchg's new value type is the same as the pointer operand's pointee type.

2 years ago[RISCV] Initial support .insn directive for the assembler.
Craig Topper [Sun, 12 Sep 2021 20:45:52 +0000 (13:45 -0700)]
[RISCV] Initial support .insn directive for the assembler.

This allows for a custom encoding to be emitted. It can also be
used with inline assembly to allow the custom instruction to be
register allocated like other instructions.

I initially started from SystemZ's implementation, but some of
the formats allow operands to be specified in multiple ways so I
had to add support for matching different operand class lists for
the same format. That implementation is a simplified version of
what is emitted by tablegen for regular instructions.

I've left out the compressed formats. And I haven't supported the
named opcodes like LUI or OP_IMM_32. Those can be added in future
patches.

Documentation can be found here https://sourceware.org/binutils/docs-2.37/as/RISC_002dV_002dFormats.html

Reviewed By: jrtc27, MaskRay

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

2 years ago[Attributor] AAFunctionReachability, Handle CallBase Reachability.
Kuter Dinel [Tue, 20 Jul 2021 21:42:47 +0000 (00:42 +0300)]
[Attributor] AAFunctionReachability, Handle CallBase Reachability.

This patch makes it possible to query callbase reachability
(Can a callbase reach a function Fn transitively).
The patch moves the reachability query handling logic to a member class,
this class will have more users within the AA once we add other function
reachability queries.

Reviewed By: jdoerfert

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

2 years ago[Attributor] Create a call site position for AACalledges
Kuter Dinel [Sun, 12 Sep 2021 03:02:51 +0000 (06:02 +0300)]
[Attributor] Create a call site position for AACalledges

This patch adds a call site position for AACallEdges, this
allows us to ask questions about which functions a specific
`CallBase` might call.

Reviewed By: jdoerfert

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

2 years ago[NFC][SVE] Precommit tests for adr instruction
Usman Nadeem [Sun, 12 Sep 2021 22:06:28 +0000 (15:06 -0700)]
[NFC][SVE] Precommit tests for adr instruction

Change-Id: I8148481a5ce3b721113327cc9b684f091cae5a8d

2 years ago[VPlan] Fix crash caused by not updating all users properly.
Florian Hahn [Sun, 12 Sep 2021 16:53:40 +0000 (17:53 +0100)]
[VPlan] Fix crash caused by not updating all users properly.

Users of VPValues are managed in a vector, so we need to be more
careful when iterating over users while updating them. For now, just
copy them.

Fixes 51798.

2 years ago[CGP] Support opaque pointers in address mode fold
Nikita Popov [Sun, 12 Sep 2021 15:30:40 +0000 (17:30 +0200)]
[CGP] Support opaque pointers in address mode fold

Rather than inspecting the pointer element type, use the access
type of the load/store/atomicrmw/cmpxchg.

In the process of doing this, simplify the logic by storing the
address + type in MemoryUses, rather than an Instruction + Operand
pair (which was then used to fetch the address).

2 years ago[Scalar] Use make_early_inc_range (NFC)
Kazu Hirata [Sun, 12 Sep 2021 15:17:18 +0000 (08:17 -0700)]
[Scalar] Use make_early_inc_range (NFC)

2 years ago[InstCombine] remove casts from splat-a-bit pattern
Sanjay Patel [Sun, 12 Sep 2021 13:18:14 +0000 (09:18 -0400)]
[InstCombine] remove casts from splat-a-bit pattern

https://alive2.llvm.org/ce/z/_AivbM

This case seems clear since we can reduce instruction count
and avoid an intermediate type change, but we might want to
use mask-and-compare for other sequences.

Currently, we can generate more instructions on some related
patterns by trying to use bit-hacks instead of mask+cmp, so
something is not behaving as expected.

2 years ago[WebAssembly] Convert to new "dylink.0" section format
Sam Clegg [Fri, 10 Sep 2021 11:21:28 +0000 (07:21 -0400)]
[WebAssembly] Convert to new "dylink.0" section format

This format is based on sub-sections (like the "linking" and "name"
sections) and is therefore easier to extend going forward.

spec change: https://github.com/WebAssembly/tool-conventions/pull/170
binaryen change: https://github.com/WebAssembly/binaryen/pull/4141
wabt change:  https://github.com/WebAssembly/wabt/pull/1707
emscripten change: https://github.com/emscripten-core/emscripten/pull/15019

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

2 years ago[AArch64] Regenerate some test checks. NFC
David Green [Sun, 12 Sep 2021 11:13:29 +0000 (12:13 +0100)]
[AArch64] Regenerate some test checks. NFC

This regenerates some of the tests that had very-close-to-updated check
line already, in order to make them more maintainable.

2 years ago[OpenMP][MLIR] Add a conversion pattern for the master op
Kiran Chandramohan [Sun, 12 Sep 2021 10:13:14 +0000 (10:13 +0000)]
[OpenMP][MLIR] Add a conversion pattern for the master op

The conversion pattern is particularly useful for conversion of
block arguments in the master op.

Reviewed By: ftynse

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

2 years ago[Clang][AVR] Fix definitions on AVR target
Mara Sophie Grosch [Sat, 11 Sep 2021 17:26:32 +0000 (19:26 +0200)]
[Clang][AVR] Fix definitions on AVR target

Fix definitions for MCUs xmega16a4u and xmega128a4u to match avr-libc

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

2 years ago[ORC] Temporarily remove the lljit-with-remote-debugging test.
Lang Hames [Sun, 12 Sep 2021 08:52:30 +0000 (18:52 +1000)]
[ORC] Temporarily remove the lljit-with-remote-debugging test.

This is broken now that llvm-jitlink-executor uses SimpleRemoteEPC.

The example will be updated to use SimpleRemoteEPC in a future commit.

2 years ago[ORC] Add bootstrap symbols to ExecutorProcessControl.
Lang Hames [Sun, 12 Sep 2021 08:38:57 +0000 (18:38 +1000)]
[ORC] Add bootstrap symbols to ExecutorProcessControl.

Bootstrap symbols are symbols whose addresses may be required to bootstrap
the rest of the JIT. The bootstrap symbols map generalizes the existing
JITDispatchInfo class provide an arbitrary map of symbol names to addresses.

The JITDispatchInfo class will be replaced by bootstrap symbols with reserved
names in upcoming commits.

2 years ago[ORC] Add OrcTargetProcess dependency on LLVM_PTHREAD_LIB
Lang Hames [Sun, 12 Sep 2021 08:17:06 +0000 (18:17 +1000)]
[ORC] Add OrcTargetProcess dependency on LLVM_PTHREAD_LIB

2 years ago[ORC] Add OrcShared dependency on LLVM_PTHREAD_LIB
Lang Hames [Sun, 12 Sep 2021 06:02:02 +0000 (16:02 +1000)]
[ORC] Add OrcShared dependency on LLVM_PTHREAD_LIB

2 years ago[ORC] Fix missing std::move
Lang Hames [Sun, 12 Sep 2021 05:27:19 +0000 (15:27 +1000)]
[ORC] Fix missing std::move

2 years ago[ORC] Fix out-of-range comparison errors.
Lang Hames [Sun, 12 Sep 2021 04:47:20 +0000 (14:47 +1000)]
[ORC] Fix out-of-range comparison errors.

2 years ago[ORC] Fix missing '&' in definition of deleted move-assignment.
Lang Hames [Sun, 12 Sep 2021 04:45:46 +0000 (14:45 +1000)]
[ORC] Fix missing '&' in definition of deleted move-assignment.

2 years ago[gn build] Port bb72f073808a
LLVM GN Syncbot [Sun, 12 Sep 2021 04:32:13 +0000 (04:32 +0000)]
[gn build] Port bb72f073808a

2 years agoRe-apply bb27e456435 and 5629afea910 with fixes.
Lang Hames [Sat, 11 Sep 2021 09:07:16 +0000 (19:07 +1000)]
Re-apply bb27e456435 and 5629afea910 with fixes.

This reapplies bb27e4564355243e479cab40885d6e0f7f640572 (SimpleRemoteEPC
support) and 2269a941a450a0d395161cfb792be58870b2875b (#include <mutex>
fix) with further fixes to support building with LLVM_ENABLE_THREADS=Off.

2 years ago[Vectorize] Fix "unused variable" warnings
Kazu Hirata [Sat, 11 Sep 2021 19:06:42 +0000 (12:06 -0700)]
[Vectorize] Fix "unused variable" warnings

2 years ago[clang] Enable the special enable_if_t diagnostics for libc++'s __enable_if_t as...
Arthur O'Dwyer [Wed, 8 Sep 2021 13:07:34 +0000 (09:07 -0400)]
[clang] Enable the special enable_if_t diagnostics for libc++'s __enable_if_t as well.

This comes from lengthy discussion between Quuxplusone and ldionne over on D108216.
Right now, libc++ uses a "SCARY metaprogramming" version of _EnableIf that bypasses
all of Clang's clever diagnostic stuff and thus produces bad diagnostics. My recent
benchmarks ( https://quuxplusone.github.io/blog/2021/09/04/enable-if-benchmark/ )
have determined that the SCARYness is not buying us any speedup; therefore we are
happy to drop it and go back to using the standard std::enable_if for all our
SFINAE needs. However, we don't want to type out typename std::enable_if<X>::type
all over the library; we want to use an alias template. And we can't use
std::enable_if_t because we need a solution that works in C++11, and we do not
provide std::enable_if_t in C++11.

Therefore, D109435 switches us from SCARY `_EnableIf` to a normal `__enable_if_t`
(at least in C++11 mode, and possibly everywhere for consistency).
Simultaneously, this Clang patch enables the good diagnostics for `__enable_if_t`.
We don't need to enable good diagnostics for `_EnableIf` because the name
`_EnableIf` has only ever been used for the SCARY version where the good diagnostics
don't trigger anyway.

(Btw, this existing code is all sorts of broken, theoretically speaking.
I filed https://bugs.llvm.org/show_bug.cgi?id=51696 about it last week.
So if someone wants to use this PR as an excuse to go down the rabbit hole
and fix it for real, that would be cool too.)

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

2 years ago[libcxxabi] NFC: fix incorrect indentation of braces
Zhouyi Zhou [Sat, 11 Sep 2021 18:39:24 +0000 (13:39 -0500)]
[libcxxabi] NFC: fix incorrect indentation of braces

Some functions in cxa_exception_storage.cpp have incorrect indentation
of braces; fix them.
Original patch by Zhouyi Zhou <zhouzhouyi@gmail.com>

Also, remove a line of commented-out (and no-longer-possible-to-compile)
code. That thread-safe-static initialization of `init` was replaced
with the call to pthread_once directly above it, back in 2012.

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

2 years ago[AArch64] Regenerate some test checks. NFC
David Green [Sat, 11 Sep 2021 18:39:28 +0000 (19:39 +0100)]
[AArch64] Regenerate some test checks. NFC

This regenerates some of the tests that had very-close-to-updated check
line already, in order to make them more maintainable.

2 years ago[LAA] Pass access type to getPtrStride()
Nikita Popov [Sat, 11 Sep 2021 17:00:37 +0000 (19:00 +0200)]
[LAA] Pass access type to getPtrStride()

Pass the access type to getPtrStride(), so it is not determined
from the pointer element type. Many cases still fetch the element
type at a higher level though, so this only partially addresses
the issue.

2 years ago[llvm-shlib] Fix the i686 MSVC triple check for listing symbols to export in LLVM...
Martin Storsjö [Thu, 9 Sep 2021 08:19:55 +0000 (08:19 +0000)]
[llvm-shlib] Fix the i686 MSVC triple check for listing symbols to export in LLVM-C.dll

https://reviews.llvm.org/D47381 / eb46c95c3e7aeba4d183ca614fe238067eddf97f
changed the triples set up by GetHostTriple.cmake for i686 MSVC
from i686-pc-win32 to i686-pc-windows-msvc without changing
the corresponding condition in llvm-shlib.

Since then, the 32 bit x86 build of LLVM-C.dll has contained no
exported symbols at all.

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

2 years ago[InstCombine] update code/test comments; NFC
Sanjay Patel [Sat, 11 Sep 2021 14:52:00 +0000 (10:52 -0400)]
[InstCombine] update code/test comments; NFC

Follow-up for post-commit suggestion on:
28afaed691a0a7ca46bb9f64fac11

The comments were partly copied from the original
code, but not updated to match the new code.

2 years ago[ARM] Support neon.vld auto-upgrade with opaque pointers
Nikita Popov [Sat, 11 Sep 2021 14:33:19 +0000 (16:33 +0200)]
[ARM] Support neon.vld auto-upgrade with opaque pointers

This code manually constructs the intrinsic name, so we need to
use p0 instead of p0i8 in opaque pointer mode.

2 years ago[GlobalOpt] Use make_early_inc_range (NFC)
Kazu Hirata [Sat, 11 Sep 2021 14:23:21 +0000 (07:23 -0700)]
[GlobalOpt] Use make_early_inc_range (NFC)

2 years ago[InstCombine] fold sub of min/max intrinsics with invertible ops
Sanjay Patel [Sat, 11 Sep 2021 13:18:46 +0000 (09:18 -0400)]
[InstCombine] fold sub of min/max intrinsics with invertible ops

This is a translation of the existing code to handle the intrinsics
and another step towards D98152.

https://alive2.llvm.org/ce/z/jA7eBC

This pattern is already handled by underlying folds if there are
less uses, so the minimal tests in this case have extra uses.

The larger cmyk tests show the motivation - when combined with
other folds, we invert a larger sequence and eliminate 'not' ops.

2 years ago[LLDB] Skip TestDyldLaunchLinux.py on Arm/Linux
Muhammad Omair Javaid [Sat, 11 Sep 2021 11:18:20 +0000 (16:18 +0500)]
[LLDB] Skip TestDyldLaunchLinux.py on Arm/Linux

TestDyldLaunchLinux.py has been recently added and is failing on LLDB
Arm/Linux buildbot. I am marking it skip till I come back and look at
it in more detail.

2 years ago[BitcodeReader] Delay select until all constants resolved
guopeilin [Sat, 11 Sep 2021 10:50:30 +0000 (18:50 +0800)]
[BitcodeReader] Delay select until all constants resolved

Like the shuffle, we should treat the select delayed so that
all constants can be resolved.

Reviewed By: efriedma

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

2 years ago[X86][SLM] Fix PSAD/MPSAD uops, latency and throughput
Simon Pilgrim [Sat, 11 Sep 2021 10:11:37 +0000 (11:11 +0100)]
[X86][SLM] Fix PSAD/MPSAD uops, latency and throughput

Noticed while trying to improve generic reduction costs via the D103695 helper script. Confirmed with Intel AoM / Agner / InstLatX64.

2 years ago[X86][SLM] Fix HADD/HSUB uops, latency and throughput
Simon Pilgrim [Tue, 7 Sep 2021 21:30:21 +0000 (22:30 +0100)]
[X86][SLM] Fix HADD/HSUB uops, latency and throughput

Noticed while trying to improve generic reduction costs via the D103695 helper script. Confirmed with Intel AoM / Agner / InstLatX64.

2 years ago[X86][SLM] Swap LoadLat and LoadUOps in the SLMWriteResPair<> helper. NFC.
Simon Pilgrim [Tue, 7 Sep 2021 20:51:52 +0000 (21:51 +0100)]
[X86][SLM] Swap LoadLat and LoadUOps in the SLMWriteResPair<> helper. NFC.

We set the LoadUOps argument a lot more frequently that LoadLat, by swapping them we can simplify a number of declarations.

2 years ago[X86] Support *_set1_pch(Float16 _Complex h)
Wang, Pengfei [Sat, 11 Sep 2021 09:45:30 +0000 (17:45 +0800)]
[X86] Support *_set1_pch(Float16 _Complex h)

Reviewed By: LuoYuanke

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

2 years ago[gn build] Port 2269a941a450
LLVM GN Syncbot [Sat, 11 Sep 2021 09:02:52 +0000 (09:02 +0000)]
[gn build] Port 2269a941a450

2 years agoRevert 5629afea910 and bb27e456435 while I look into bot failures.
Lang Hames [Sat, 11 Sep 2021 08:58:30 +0000 (18:58 +1000)]
Revert 5629afea910 and bb27e456435 while I look into bot failures.

This reverts commit 5629afea9109d3b72064cbe70e1ca91ffb9dc0a2 ("[ORC] Add missing
include."), and bb27e4564355243e479cab40885d6e0f7f640572 ("[ORC] Add
SimpleRemoteEPC: ExecutorProcessControl over SPS + abstract transport.").

The SimpleRemoteEPC patch currently assumes availability of threads, and needs
to be rewritten with LLVM_ENABLE_THREADS guards.

2 years ago[gn build] Port bb27e4564355
LLVM GN Syncbot [Sat, 11 Sep 2021 08:51:51 +0000 (08:51 +0000)]
[gn build] Port bb27e4564355

2 years ago[ORC] Add missing include.
Lang Hames [Sat, 11 Sep 2021 08:51:16 +0000 (18:51 +1000)]
[ORC] Add missing include.

2 years ago[ORC] Add SimpleRemoteEPC: ExecutorProcessControl over SPS + abstract transport.
Lang Hames [Tue, 7 Sep 2021 23:24:45 +0000 (09:24 +1000)]
[ORC] Add SimpleRemoteEPC: ExecutorProcessControl over SPS + abstract transport.

SimpleRemoteEPC is an ExecutorProcessControl implementation (with corresponding
new server class) that uses ORC SimplePackedSerialization (SPS) to serialize and
deserialize EPC-messages to/from byte-buffers. The byte-buffers are sent and
received via a new SimpleRemoteEPCTransport interface that can be implemented to
run SimpleRemoteEPC over whatever underlying transport system (IPC, RPC, network
sockets, etc.) best suits your use case.

The SimpleRemoteEPCServer class provides executor-side support. It uses a
customizable SimpleRemoteEPCServer::Dispatcher object to dispatch wrapper
function calls to prevent the RPC thread from being blocked (a problem in some
earlier remote-JIT server implementations). Almost all functionality (beyond the
bare basics needed to bootstrap) is implemented as wrapper functions to keep the
implementation simple and uniform.

Compared to previous remote JIT utilities (OrcRemoteTarget*,
OrcRPCExecutorProcessControl), more consideration has been given to
disconnection and error handling behavior: Graceful disconnection is now always
initiated by the ORC side of the connection, and failure at either end (or in
the transport) will result in Errors being delivered to both ends to enable
controlled tear-down of the JIT and Executor (in the Executor's case this means
"as controlled as the JIT'd code allows").

The introduction of SimpleRemoteEPC will allow us to remove other remote-JIT
support from ORC (including the legacy OrcRemoteTarget* code used by lli, and
the OrcRPCExecutorProcessControl and OrcRPCEPCServer classes), and then remove
ORC RPC itself.

The llvm-jitlink and llvm-jitlink-executor tools have been updated to use
SimpleRemoteEPC over file descriptors. Future commits will move lli and other
tools and example code to this system, and remove ORC RPC.

2 years agoFix python 2-vs-3 issues in add_new_check.py and rename_check.py
Matt Beardsley [Sat, 11 Sep 2021 07:52:47 +0000 (09:52 +0200)]
Fix python 2-vs-3 issues in add_new_check.py and rename_check.py

As of this commit:
  https://github.com/llvm/llvm-project/commit/307b1fdd

If either of those scripts are invoked with python 2, neither works due to:
  "TypeError: write() argument 1 must be unicode, not str"

And if rename_check.py is invoked with python 3:
  "ValueError: binary mode doesn't take an encoding argument"
(referring to `with io.open(filename, 'wb', encoding='utf8') as f:`), and

Another issue in rename_check.py in python 2:
  "TypeError: list object is not an iterator"
(referring to `next(filter( ... os.listdir(old_module_path)))`)

(so, rename_check doesn't work with either 2 or 3, and add_new_check
doesn't work with 2, but does work with 3)

I ran these steps to test both python versions:
(manually - appears to be the "status quo" for these files)

  python3 clang-tools-extra/clang-tidy/add_new_check.py readability ggggg
  python3 clang-tools-extra/clang-tidy/rename_check.py readability-ggggg readability-hhhhh

  git checkout HEAD -- clang-tools-extra/clang-tidy/readability/CMakeLists.txt clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp clang-tools-extra/docs/ReleaseNotes.rst clang-tools-extra/docs/clang-tidy/checks/list.rst
  rm -f clang-tools-extra/clang-tidy/readability/GggggCheck.cpp clang-tools-extra/clang-tidy/readability/GggggCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-ggggg.rst clang-tools-extra/test/clang-tidy/checkers/readability-ggggg.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-hhhhh.rst

  python2 clang-tools-extra/clang-tidy/add_new_check.py readability ggggg
  python2 clang-tools-extra/clang-tidy/rename_check.py readability-ggggg readability-hhhhh

  git checkout HEAD -- clang-tools-extra/clang-tidy/readability/CMakeLists.txt clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp clang-tools-extra/docs/ReleaseNotes.rst clang-tools-extra/docs/clang-tidy/checks/list.rst
  rm -f clang-tools-extra/clang-tidy/readability/GggggCheck.cpp clang-tools-extra/clang-tidy/readability/GggggCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-ggggg.rst clang-tools-extra/test/clang-tidy/checkers/readability-ggggg.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-hhhhh.rst

Reviewed By: kbobyrev

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

2 years ago[AArch64][GlobalISel] Select full-fp16 s16 G_FCONSTANT as a constant pool load
Jessica Paquette [Mon, 30 Aug 2021 23:36:47 +0000 (16:36 -0700)]
[AArch64][GlobalISel] Select full-fp16 s16 G_FCONSTANT as a constant pool load

When we have full-fp16 support, we should (manually select) s16 G_FCONSTANT to
a constant pool load.

Add support for that to `emitLoadFromConstantPool` + the existing constant
selection code.

Also tidy up the constant selection code a little. There were some out-of-date
comments + some dead code.

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

2 years ago[llvm-cov] Add error for invalid -path-equivalence format
Keith Smiley [Wed, 1 Sep 2021 05:35:44 +0000 (22:35 -0700)]
[llvm-cov] Add error for invalid -path-equivalence format

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

2 years ago[JITLink] Working memory shouldn't be subject to alignment constraints.
Lang Hames [Wed, 8 Sep 2021 12:30:08 +0000 (22:30 +1000)]
[JITLink] Working memory shouldn't be subject to alignment constraints.

Refactors copyBlockContentToWorkingMemory to use offsets rather than direct
pointers to working memory. This simplifies the problem of maintaining
alignments between blocks in working memory, without requiring the working
memory itself to be aligned.

2 years ago[ORC] Fix missing newline in debugging output.
Lang Hames [Tue, 7 Sep 2021 11:41:39 +0000 (21:41 +1000)]
[ORC] Fix missing newline in debugging output.

2 years ago[ORC] Merge LLVMSPSSerializers.h into SimplePackedSerialization.h.
Lang Hames [Mon, 6 Sep 2021 00:02:56 +0000 (10:02 +1000)]
[ORC] Merge LLVMSPSSerializers.h into SimplePackedSerialization.h.

Since the ORC runtime and LLVM are no longer sharing SPS code (the ORC runtime
has its own copy) there is no reason to keep these separate.

2 years ago[ORC] Use EPC for EPCGeneric MemoryAccess / JITLinkMemoryManager construction.
Lang Hames [Sun, 5 Sep 2021 08:29:05 +0000 (18:29 +1000)]
[ORC] Use EPC for EPCGeneric MemoryAccess / JITLinkMemoryManager construction.

This allows these classes to be created during EPC construction, before an
ExecutionSession is available.

2 years agoRevert "Revert "[AArch64][SVE][InstCombine] Canonicalize aarch64_sve_dup_x intrinsic...
Usman Nadeem [Sat, 11 Sep 2021 00:57:29 +0000 (17:57 -0700)]
Revert "Revert "[AArch64][SVE][InstCombine] Canonicalize aarch64_sve_dup_x intrinsic to IR splat operation""

This reverts commit eee7d225ded98f42d37c05ec292bbb18560ce06b.
Effectively relanding 98c37247d81dfc967ecc49eee7a15612b6510f67
after fixing the failing tests.

Change-Id: I5d7461aeb820a2d5f1895457d824a8de4d316ee5

2 years agonullptr initialize variables, spotted on msan bots.
Eric Christopher [Sat, 11 Sep 2021 01:10:16 +0000 (18:10 -0700)]
nullptr initialize variables, spotted on msan bots.

2 years ago[docs] Improve description of LLVM_BUILD_TESTS
Keith Smiley [Thu, 2 Sep 2021 00:20:13 +0000 (17:20 -0700)]
[docs] Improve description of LLVM_BUILD_TESTS

This makes it clear that this only has an effect if you use the all
build target.

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