platform/upstream/llvm.git
3 years ago[flang][OpenMP] Add parsing support for nontemporal clause.
Arnamoy Bhattacharyya [Mon, 13 Sep 2021 16:29:22 +0000 (12:29 -0400)]
[flang][OpenMP] Add parsing support for nontemporal clause.

This patch adds parsing support for the nontemporal clause.  Also adds a couple of test cases.

Reviewed By: clementval

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

3 years ago[ADT] Extend EnableIfCallable for callables with incomplete returns
Fehr Mathieu [Mon, 13 Sep 2021 18:15:13 +0000 (18:15 +0000)]
[ADT] Extend EnableIfCallable for callables with incomplete returns

std::is_convertible has no defined behavior when its arguments
are incomplete, even if they are equal. In practice, it returns false.
Adding std::is_same allows us to use the constructor using a callable,
even if the return value is incomplete. We also check the case where
we convert a T into a const T.

Reviewed By: DaniilSuchkov

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

Committer: Daniil Suchkov <dsuchkov@azul.com>

3 years agoReorder mmt4d shapes:
Benoit Jacob [Mon, 13 Sep 2021 19:08:54 +0000 (12:08 -0700)]
Reorder mmt4d shapes:

* Revert https://reviews.llvm.org/D107307 so that both LHS and RHS have
  the same layout with K0 as the innermost dimension.

* Continuing from https://reviews.llvm.org/D107003, move also 'K'
  to the outer side, so that now the inter-tile dimensions as all outer,
  and the intra-tile dimensions are all inner.

Reviewed By: asaadaldien

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

3 years ago[Sanitizers] intercept getgrouplist on Linux and FreeBSD.
David Carlier [Mon, 13 Sep 2021 17:42:43 +0000 (18:42 +0100)]
[Sanitizers] intercept getgrouplist on Linux and FreeBSD.

Reviewed By: vitalyb

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

3 years ago[lldb] Fix warning in MinidumpFileBuilder.cpp
Alex Langford [Mon, 13 Sep 2021 17:34:31 +0000 (10:34 -0700)]
[lldb] Fix warning in MinidumpFileBuilder.cpp

Fixes the following warning:

$llvm_project/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp:744:11: warning:
format specifies type 'long' but the argument has type 'lldb::offset_t' (aka 'unsigned long long') [-Wformat]
          m_data.GetByteSize());
          ^~~~~~~~~~~~~~~~~~~~

3 years ago[openmp] Apply test change from D109500
Jon Chesterfield [Mon, 13 Sep 2021 17:01:07 +0000 (18:01 +0100)]
[openmp] Apply test change from D109500

3 years ago[openmp] Apply code change from D109500
Jon Chesterfield [Mon, 13 Sep 2021 17:00:15 +0000 (18:00 +0100)]
[openmp] Apply code change from D109500

3 years agoRevert "[openmp] Fix 51647, corrupt bitcode on amdgpu"
Jon Chesterfield [Mon, 13 Sep 2021 16:58:33 +0000 (17:58 +0100)]
Revert "[openmp] Fix 51647, corrupt bitcode on amdgpu"

This reverts commit d5c049a3f68791490e8c87d9974e9831ede0ada0.
Going to re-commit it in pieces for easier application to 13

3 years agoRevert "[IndVars] Replace PHIs if loop exits on 1st iteration"
Philip Reames [Mon, 13 Sep 2021 17:11:18 +0000 (10:11 -0700)]
Revert "[IndVars] Replace PHIs if loop exits on 1st iteration"

This reverts commit 5a6dfb27ca7424f15a20f9bb7ec90d858865faa3.  See original review for why.

3 years agoRevert "[IndVars] Break backedge and replace PHIs if loop exits on 1st iteration"
Philip Reames [Mon, 13 Sep 2021 17:10:49 +0000 (10:10 -0700)]
Revert "[IndVars] Break backedge and replace PHIs if loop exits on 1st iteration"

This reverts commit d9ca444835e67960df927d5b8cade57776fdd8cb.  See review for why.

3 years ago[gn build] Fix typos in config visibility lists
Nico Weber [Mon, 13 Sep 2021 16:50:30 +0000 (12:50 -0400)]
[gn build] Fix typos in config visibility lists

GN https://gn-review.googlesource.com/c/gn/+/12140 identified these
typos. Fix them.

No effective behavior change.

3 years ago[RegScavenger][NFC] Refer to the already initialized local variable for spill slot...
vnalamot [Mon, 13 Sep 2021 15:21:17 +0000 (20:51 +0530)]
[RegScavenger][NFC] Refer to the already initialized local variable for spill slot index

Reviewed By: arsenm

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

3 years ago[mlir][Linalg] Insert static buffers as high as possible during ComprehensiveBufferiz...
Nicolas Vasilache [Mon, 13 Sep 2021 12:39:29 +0000 (12:39 +0000)]
[mlir][Linalg] Insert static buffers as high as possible during ComprehensiveBufferization.

This revision allows hoisting static alloc/dealloc pairs as high as possible during ComprehensiveBufferization.
This also aligns such allocated buffers to 128B by default.

This change exhibited some issues wrt insertion points and a missing copy that are also fixed in this revision; tests are updated accordingly.

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

3 years ago[Utils] Use make_early_inc_range (NFC)
Kazu Hirata [Mon, 13 Sep 2021 15:57:23 +0000 (08:57 -0700)]
[Utils] Use make_early_inc_range (NFC)

3 years ago[mlir][emitc] Print signed integers properly
Simon Camphausen [Mon, 13 Sep 2021 14:57:09 +0000 (16:57 +0200)]
[mlir][emitc] Print signed integers properly

Previously negative integers were printed as large unsigned values.

Reviewed By: marbre

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

3 years ago[APInt] Add APIntOps::ScaleBitMask helper
Simon Pilgrim [Mon, 13 Sep 2021 15:26:57 +0000 (16:26 +0100)]
[APInt] Add APIntOps::ScaleBitMask helper

APInt is used to describe a bit mask in a variety of value tracking and demanded bits/elts functions.

When traversing through dst/src operands, we have a number of places where these masks need to widened/narrowed to translate through bitcasts, reductions etc. to a different type.

This patch add a APIntOps::ScaleBitMask common helper, adds unit test coverage, and updates a number of cases to use the the helper instead of their own implementation.

This came up on D109065 where we currently have to add yet another implementation of the same code.

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

3 years ago[SelectionDAG][NFC] Fix typo in VerifyDAGDiverence() function name
vnalamot [Mon, 13 Sep 2021 15:16:42 +0000 (20:46 +0530)]
[SelectionDAG][NFC] Fix typo in VerifyDAGDiverence() function name

Reviewed By: arsenm

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

3 years ago[MLIR] Mark test case XFAIL on SystemZ for now.
Jonas Paulsson [Mon, 13 Sep 2021 14:44:49 +0000 (16:44 +0200)]
[MLIR]  Mark test case XFAIL on SystemZ for now.

mlir-cpu-runner/math_polynomial_approx.mlir

This test case is currently failing on SystemZ, but it does not appear to
necessarily be a target specific problem. See discussion at
https://bugs.llvm.org/show_bug.cgi?id=51204.

3 years agoRevert "[libc] Some clean work with memmove."
Guillaume Chatelet [Mon, 13 Sep 2021 14:32:08 +0000 (14:32 +0000)]
Revert "[libc] Some clean work with memmove."

This reverts commit b659b789c03ac339e28d7b91406b67bb887a426d.

3 years ago[openmp] Fix 51647, corrupt bitcode on amdgpu
dpalermo [Mon, 13 Sep 2021 14:21:21 +0000 (15:21 +0100)]
[openmp] Fix 51647, corrupt bitcode on amdgpu

Patch by @dpalermo

The corrupt bitcode reported in https://bugs.llvm.org/show_bug.cgi?id=51647 seems to be a result of a later pass changing the workfn variable to addrspace(5) (thread private, on the stack). That seems reasonable for an alloca without an address space so it's an open question why that can crash the bitcode reader.

This change puts it in the thread private address space to begin with which means whatever misfired further down the pipeline does not break it. That matches the codegen from clang where stack variables are always annotated (5) and then addrspace cast prior to following use.

This therefore patches around whatever unsuccessfully moved the alloca variable to addrspace(5). That solves the problem of openmp opt producing code that crashes the bitcode reader. It should be possible to create a minimal repro for the underlying bug based on some handwritten IR that uses an alloca in a generic address space.

Reviewed By: ronlieb, jdoerfert, dpalermo-phab

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

3 years ago[gn build] (semi-manually) port 4247381e26dd
Nico Weber [Mon, 13 Sep 2021 14:03:29 +0000 (10:03 -0400)]
[gn build] (semi-manually) port 4247381e26dd

3 years ago[lldb] [test] Remove parent output checks from follow-child tests
Michał Górny [Mon, 13 Sep 2021 13:43:12 +0000 (15:43 +0200)]
[lldb] [test] Remove parent output checks from follow-child tests

Remove the parent output checks, as they make the test flaky while
serving no real purpose.  If the parent crashed/hanged, it will never
resume the child and the test would fail anyway.

3 years ago[SystemZ][z/OS] Missing wchar functions libc++
Muiez Ahmed [Mon, 13 Sep 2021 13:43:21 +0000 (09:43 -0400)]
[SystemZ][z/OS] Missing wchar functions libc++

The aim is to add the missing z/OS specific implementations for mbsnrtowcs and wcsnrtombs, as part of libc++.

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

3 years ago[mlir][linalg] ComprehensiveBufferize: Do not copy InitTensorOps
Matthias Springer [Mon, 13 Sep 2021 13:26:40 +0000 (22:26 +0900)]
[mlir][linalg] ComprehensiveBufferize: Do not copy InitTensorOps

Do not copy InitTensorOps or casts thereof.

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

3 years ago[VPlan] Add test that requires duplicating recipe for sinking.
Florian Hahn [Mon, 14 Jun 2021 18:33:12 +0000 (19:33 +0100)]
[VPlan] Add test that requires duplicating recipe for sinking.

3 years ago[lldb] Skip TestGuiBasicDebug due to pr51833
Pavel Labath [Mon, 13 Sep 2021 13:11:00 +0000 (15:11 +0200)]
[lldb] Skip TestGuiBasicDebug due to pr51833

3 years ago[InstCombining] Refactor checks for TryToSinkInstruction. NFC
Anna Thomas [Sun, 12 Sep 2021 19:11:26 +0000 (15:11 -0400)]
[InstCombining] Refactor checks for TryToSinkInstruction. NFC

Moved out the checks for profitability of TryToSinkInstructions
into a lambda function.
This will also allow us to easily add checks for bailing out if the
transform is not profitable.

Tests-Run: instCombine tests.

3 years ago[analyzer] MallocChecker: Add notes from NoOwnershipChangeVisitor only when a functio...
Kristóf Umann [Wed, 25 Aug 2021 14:07:56 +0000 (16:07 +0200)]
[analyzer] MallocChecker: Add notes from NoOwnershipChangeVisitor only when a function "intents", but doesn't change ownership, enable by default

D105819 Added NoOwnershipChangeVisitor, but it is only registered when an
off-by-default, hidden checker option was enabled. The reason behind this was
that it grossly overestimated the set of functions that really needed a note:

std::string getTrainName(const Train *T) {
  return T->name;
} // note: Retuning without changing the ownership of or deallocating memory
// Umm... I mean duh? Nor would I expect this function to do anything like that...

void foo() {
  Train *T = new Train("Land Plane");
  print(getTrainName(T)); // note: calling getTrainName / returning from getTrainName
} // warn: Memory leak

This patch adds a heuristic that guesses that any function that has an explicit
operator delete call could have be responsible for deallocating the memory that
ended up leaking. This is waaaay too conservative (see the TODOs in the new
function), but it safer to err on the side of too little than too much, and
would allow us to enable the option by default *now*, and add refinements
one-by-one.

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

3 years ago[JITLink] Factor out forEachRelocation() function from addRelocations() in ELF Aarch6...
Stefan Gränitz [Mon, 13 Sep 2021 12:49:01 +0000 (14:49 +0200)]
[JITLink] Factor out forEachRelocation() function from addRelocations() in ELF Aarch64 backend (NFC)

First step in reducing redundancy in `addRelocations()` implementations across ELF JITLink backends. The patch factors out common logic for ELF relocation traversal into the new helper function `forEachRelocation()` in the `ELFLinkGraphBuilder` base class. For now, this is applied to the Aarch64 implementation. Others may follow soon.

Reviewed By: lhames

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

3 years ago[clang] Make the driver not diagnose errors on nonexistent linker inputs
Nico Weber [Mon, 13 Sep 2021 12:57:38 +0000 (08:57 -0400)]
[clang] Make the driver not diagnose errors on nonexistent linker inputs

When nonexistent linker inputs are passed to the driver, the linker
now errors out, instead of the compiler. If the linker does not run,
clang now emits a "warning: linker input unused" instead of an error
for nonexistent files.

The motivation for this change is that I noticed that
`clang-cl /winsysroot sysroot main.cc ole32.lib` emitted a
"ole32.lib not found" error, even though the linker finds it just fine when
I run `clang-cl /winsysroot sysroot main.cc /link ole32.lib`.

The same problem occurs if running `clang-cl main.cc ole32.lib` in a
non-MSVC shell.

The problem is that DiagnoseInputExistence() only looked for libs in %LIB%,
but MSVCToolChain uses much more involved techniques.

For this particular problem, we could make DiagnoseInputExistence() ask
the toolchain to see if it can find a .lib file, but in general the
driver can't know what the linker will do to find files, so it shouldn't
try. For example, if we implement PR24616, lld-link will look in the
registry to determine a good default for %LIB% if it isn't set.

This is less or a problem for the gcc driver, since .a paths there are
either passed via -l flags (which honor -L), or via a qualified path
(that doesn't honor -L) -- but for example ld.lld's --chroot flag
can also trigger this problem. Without this patch,
`clang -fuse-ld=lld -Wl,--chroot,some/dir /file.o` will complain that
`/file.o` doesn't exist, even though
`clang -fuse-ld=lld -Wl,--chroot,some/dir -Wl,/file.o` succeeds just fine.

This implements rnk's suggestion on the old bug PR27234.

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

3 years agoSwiftAsync: use runtime-provided flag for extended frame if back-deploying
Tim Northover [Fri, 3 Sep 2021 08:59:02 +0000 (09:59 +0100)]
SwiftAsync: use runtime-provided flag for extended frame if back-deploying

When back-deploying Swift async code we can't always toggle the flag showing an
extended frame is present because it will confuse unwinders on systems released
before this feature. So in cases where the code might run there, we `or` in a
mask provided by the runtime (as an absolute symbol) telling us whether the
unwinders can cope.

When deploying only for newer OSs, we can still hard-code the bit-set for
greater efficiency.

3 years agoRevert "[clang] Check unsupported types in expressions"
Andrew Savonichev [Mon, 13 Sep 2021 12:34:21 +0000 (15:34 +0300)]
Revert "[clang] Check unsupported types in expressions"

This reverts commit ec6c847179fd019acae4d97a18f9e7d3961a6fdf.

Fails on check-openmp:

/b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/runtime/test/lock/Output/omp_init_lock.c.tmp
--
Exit Code: -11

3 years ago[gn build] Port 0213d7ec0c50
LLVM GN Syncbot [Mon, 13 Sep 2021 12:04:24 +0000 (12:04 +0000)]
[gn build] Port 0213d7ec0c50

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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.

3 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

3 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

3 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.

3 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

3 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

3 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

3 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

3 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

3 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.

3 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

3 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

3 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.

3 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

3 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.

3 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

3 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

3 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.

3 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

3 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

3 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

3 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.

3 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

3 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

3 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.

3 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

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

3 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

3 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

3 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

3 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'

3 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

3 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

3 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()

3 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

3 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

3 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()

3 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

3 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.

3 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.

3 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

3 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

3 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

3 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

3 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.

3 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).

3 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)

3 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.

3 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

3 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.

3 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

3 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

3 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.

3 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.

3 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

3 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

3 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

3 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.

3 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.