platform/upstream/llvm.git
22 months ago[RISCV] Add zihintntl instructions
Shao-Ce SUN [Mon, 22 Aug 2022 03:53:16 +0000 (11:53 +0800)]
[RISCV] Add zihintntl instructions

Reviewed By: kito-cheng

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

22 months ago[LoongArch] Support Load and Store with 14-bit signed immediate operands
gonglingqin [Mon, 22 Aug 2022 02:58:29 +0000 (10:58 +0800)]
[LoongArch] Support Load and Store with 14-bit signed immediate operands

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

22 months ago[libcxx][NFC] utilises compiler builtins for unary transform type-traits
Christopher Di Bella [Mon, 22 Aug 2022 01:07:08 +0000 (01:07 +0000)]
[libcxx][NFC] utilises compiler builtins for unary transform type-traits

Depends on D116203

Reviewed By: #libc, philnik

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

22 months ago[clang] adds unary type transformations as compiler built-ins
Christopher Di Bella [Mon, 22 Aug 2022 00:27:10 +0000 (00:27 +0000)]
[clang] adds unary type transformations as compiler built-ins

Adds

* `__add_lvalue_reference`
* `__add_pointer`
* `__add_rvalue_reference`
* `__decay`
* `__make_signed`
* `__make_unsigned`
* `__remove_all_extents`
* `__remove_extent`
* `__remove_const`
* `__remove_volatile`
* `__remove_cv`
* `__remove_pointer`
* `__remove_reference`
* `__remove_cvref`

These are all compiler built-in equivalents of the unary type traits
found in [[meta.trans]][1]. The compiler already has all of the
information it needs to answer these transformations, so we can skip
needing to make partial specialisations in standard library
implementations (we already do this for a lot of the query traits). This
will hopefully improve compile times, as we won't need use as much
memory in such a base part of the standard library.

[1]: http://wg21.link/meta.trans

Co-authored-by: zoecarver
Reviewed By: aaron.ballman, rsmith

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

22 months ago[PowerPC][Coroutines] Add tail-call check with call information for coroutines
Ting Wang [Mon, 22 Aug 2022 02:20:40 +0000 (22:20 -0400)]
[PowerPC][Coroutines] Add tail-call check with call information for coroutines

Fixes #56679.

Reviewed By: ChuanqiXu, shchenz

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

22 months ago[AArch64][NFC] Replace setOperationAction and AddPromotedToType
wanglian [Fri, 19 Aug 2022 08:37:53 +0000 (16:37 +0800)]
[AArch64][NFC] Replace setOperationAction and AddPromotedToType
with setOperationPromotedToType.

Reviewed By: dmgreen

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

22 months ago[sanitizer] use ../runtimes path to build libcxx
Vitaly Buka [Mon, 22 Aug 2022 01:41:55 +0000 (18:41 -0700)]
[sanitizer] use ../runtimes path to build libcxx

22 months ago[clang-format] Fix BeforeHash indent of comments above PPDirective
owenca [Thu, 18 Aug 2022 05:12:07 +0000 (22:12 -0700)]
[clang-format] Fix BeforeHash indent of comments above PPDirective

Fixes #56326.

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

22 months ago[ADT] Remove `is_invocable` from `STLExtras.h`
Joe Loser [Sun, 21 Aug 2022 00:48:05 +0000 (18:48 -0600)]
[ADT] Remove `is_invocable` from `STLExtras.h`

As a follow-up of https://reviews.llvm.org/D132318, now that the callers have
been adjusted to use `std::is_invocable`, remove `llvm::is_invocable` and its
tests.

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

22 months ago[ADT] Clarify llvm::bit_cast implementation comment
Joe Loser [Sun, 21 Aug 2022 16:41:13 +0000 (10:41 -0600)]
[ADT] Clarify llvm::bit_cast implementation comment

When reviewing https://reviews.llvm.org/D132330, I noticed a few pre-existing
comments regarding the implementation of `llvm::bit_cast`. One comment is a bit
misleading since `std::bit_cast` is a C++20 standard library thing, not a
C++17 one (otherwise we could use it directly). Clarify that in the comment.

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

22 months ago[RISCV] Remove impossible TODO in RISCVRedundantCopyElimination. NFC
Craig Topper [Sun, 21 Aug 2022 20:14:31 +0000 (13:14 -0700)]
[RISCV] Remove impossible TODO in RISCVRedundantCopyElimination. NFC

If there are multiple conditional branches we shouldn't do any
optimization.

22 months ago[RISCV] Optimize x <s -1 ? x : -1. Improve x >u 1 ? x : 1.
Craig Topper [Sun, 21 Aug 2022 18:46:05 +0000 (11:46 -0700)]
[RISCV] Optimize x <s -1 ? x : -1. Improve x >u 1 ? x : 1.

Similar to D132211, we can optimize x <s -1 ? x : -1 -> x <s 0 ? x : -1

Also improve the unsigned case from D132211 to use x != 0 which
will give a bnez instruction which might be compressible.

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

22 months ago[RISCV] Be more strict about LUI+ADDI macrofusion pre-RA.
Craig Topper [Sun, 21 Aug 2022 17:56:24 +0000 (10:56 -0700)]
[RISCV] Be more strict about LUI+ADDI macrofusion pre-RA.

Don't macrofuse if the LUI has more than 1 user. That will likely
require the LUI to have a different destination register post-RA.
LUI+ADDI can only be fused if they write the same register.

22 months ago[ADT] Simplify llvm::bit_cast (NFC)
Kazu Hirata [Sun, 21 Aug 2022 17:39:21 +0000 (10:39 -0700)]
[ADT] Simplify llvm::bit_cast (NFC)

This patch removes macro tricks to check GCC versions.

The commit message from 19262fc5966ab569f21f3d440f8b001bca666f17
states that "is_trivially_copyable is only in GCC 5.1 and later".
Note that we now require GCC 7.1 or higher.

Since both std::is_trivially_constructible and
std::is_trivially_copyable are C++11 features, and we now require
C++17, we probably don't need to worry about the availability of the
C++11 features.

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

22 months agoRemove llvm::is_trivially_copyable (NFC)
Kazu Hirata [Sun, 21 Aug 2022 17:39:19 +0000 (10:39 -0700)]
Remove llvm::is_trivially_copyable (NFC)

This patch removes llvm::is_trivially_copyable as it seems to be dead.
Once I remove it, HAVE_STD_IS_TRIVIALLY_COPYABLE has no users, so this
patch removes the macro also.

The comment on llvm::is_trivially_copyable mentions GCC 4.9, but note
that we now require GCC 7.1 or higher.

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

22 months ago[flang][OpenMP] Parser support for Target directive and Device clause
Sesha Kalyur [Sun, 21 Aug 2022 16:53:51 +0000 (22:23 +0530)]
[flang][OpenMP] Parser support for Target directive and Device clause

This patch adds support for the device clause on `Target` directive.
Device clause was added in OpenMP specification version 4.5 to
create a device data environment for the extent of a region. On
target construct, the device expression be either be `ancestor`
(taking after the parent) or assign a new `device_num`.

Reviewed By: kiranchandramohan

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

22 months ago[CostModel][X86] Add CodeSize handling for fadd/fsub/fmul/fsqrt ops
Simon Pilgrim [Sun, 21 Aug 2022 16:42:05 +0000 (17:42 +0100)]
[CostModel][X86] Add CodeSize handling for fadd/fsub/fmul/fsqrt ops

Eventually this will be part of the cost table lookup

22 months ago[ADT] Replace `void_t` equivalent with `std::void_t`
Joe Loser [Sat, 20 Aug 2022 23:53:58 +0000 (17:53 -0600)]
[ADT] Replace `void_t` equivalent with `std::void_t`

Use `std::void_t` instead of defining our own equivalent in `STLExtras.h` now
that C++17 is available for use.

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

22 months agoRevert rG15de7aaae52ef4be9f9ff3b130804e5b5ccd29f4 "[CostModel][X86] Add CodeSize...
Simon Pilgrim [Sun, 21 Aug 2022 15:51:45 +0000 (16:51 +0100)]
Revert rG15de7aaae52ef4be9f9ff3b130804e5b5ccd29f4 "[CostModel][X86] Add CodeSize/SizeLatency handling for fadd/fsub/fmul/fsqrt ops"

This is unintentionally affecting some backend tests

22 months ago[CostModel][X86] Add CodeSize/SizeLatency handling for fadd/fsub/fmul/fsqrt ops
Simon Pilgrim [Sun, 21 Aug 2022 15:39:47 +0000 (16:39 +0100)]
[CostModel][X86] Add CodeSize/SizeLatency handling for fadd/fsub/fmul/fsqrt ops

Eventually this will be part of the cost table lookup

22 months ago[NFC][libc++][doc] Improves rst formatting.
Mark de Wever [Sun, 21 Aug 2022 15:16:14 +0000 (17:16 +0200)]
[NFC][libc++][doc] Improves rst formatting.

22 months ago[NFC][mlir][affine] Typo in Affine Analysis test
Kai Sasaki [Sun, 21 Aug 2022 14:54:44 +0000 (20:24 +0530)]
[NFC][mlir][affine] Typo in Affine Analysis test

Reviewed By: Groverkss

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

22 months ago[libc++] Fix typos in deprecation messages for experimental searchers
Joe Loser [Sat, 20 Aug 2022 23:21:13 +0000 (17:21 -0600)]
[libc++] Fix typos in deprecation messages for experimental searchers

Fix the typo in the deprecated messages for these searchers:
`s/exprerimental/experimental`.

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

22 months ago[InstCombine] reassociate bitwise logic chains based on uses
Sanjay Patel [Sun, 21 Aug 2022 13:42:14 +0000 (09:42 -0400)]
[InstCombine] reassociate bitwise logic chains based on uses

(X op Y) op Z --> (Y op Z) op X

This isn't a complete solution (see TODO tests for possible refinements),
but it shows some nice wins and doesn't seem to cause any harm. I think
the most potential danger is from conflicting with other folds and causing
an infinite loop - that's the reason for avoiding patterns with constant
operands.

Alternatively, we could try this in the reassociate pass, but we would not
immediately see all of the logic folds that instcombine provides. I also
looked at improving ValueTracking's isImpliedCondition() (and we should
still add some enhancements there), but that would not work in general for
bitwise logic reduction.

The tests that reduce completely to 0/-1 are motivated by issue #56653.

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

22 months ago[CMake] Weaken 176db3b3ab25ff8a9b2405f50ef5a8bd9304a6d5
John Ericson [Sun, 21 Aug 2022 12:57:01 +0000 (08:57 -0400)]
[CMake] Weaken 176db3b3ab25ff8a9b2405f50ef5a8bd9304a6d5

That commit (D132324) made putting libc++ in LLVM_ENABLE_RUNTIMES a hard
error, but ther are some out-of-tree CI jobs (especially docs that need
fixing).

I am thus making it a "soft error" for now, until that is resolved.

22 months ago[PhaseOrdering][X86] Regenerate vdiv.ll
Simon Pilgrim [Sun, 21 Aug 2022 12:39:55 +0000 (13:39 +0100)]
[PhaseOrdering][X86] Regenerate vdiv.ll

Noticed while cleaning up x86 cost tables for upcoming cost kind support and it affected this test

22 months ago[RISCV] Optimize x > 1 ? x : 1 -> x > 0 ? x : 1
LiaoChunyu [Fri, 19 Aug 2022 08:14:19 +0000 (16:14 +0800)]
[RISCV] Optimize x > 1 ? x : 1 -> x > 0 ? x : 1

if x == 1,
  x > 1 ? x : 1  return x, which is also 1.
  x > 0 ? x : 1  return 1.

Reduce the number of load 1 instructions.

Reviewed By: craig.topper

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

22 months ago[libcxxabi][cmake] Allow building without libcxx again
John Ericson [Sat, 20 Aug 2022 15:04:41 +0000 (11:04 -0400)]
[libcxxabi][cmake] Allow building without libcxx again

This allows `-DLLVM_ENABLE_RUNTIMES=libcxxabi` to work.

This functionality was removed in D125561 (among other such removals) as
dead code, because it was only available as part of the standalone build
before.

The functionality as added back as it was, except `target_include_directories` is used instead of the cruder `target_compile_options` (with an MSVC vs not MSVC conditional split). That is just wholly better.

Reviewed By: phosek, #libc_abi

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

22 months ago[RFC] Remove support for building C++ with `LLVM_ENABLE_PROJECTS`
John Ericson [Sun, 21 Aug 2022 01:47:45 +0000 (21:47 -0400)]
[RFC] Remove support for building C++ with `LLVM_ENABLE_PROJECTS`

This has been officially deprecated since D112724, meaning the
deprecation warning is present in released 14 and 15.

This makes me think that now, shortly after the 15 release is branched,
is a good time to pull the trigger.

Reviewed By: phosek

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

22 months ago[CostModel][X86] Add trunc cost kinds tests
Simon Pilgrim [Sun, 21 Aug 2022 11:33:10 +0000 (12:33 +0100)]
[CostModel][X86] Add trunc cost kinds tests

22 months ago[CostModel][X86] Split integer div/rem cost kinds tests
Simon Pilgrim [Sun, 21 Aug 2022 11:03:01 +0000 (12:03 +0100)]
[CostModel][X86] Split integer div/rem cost kinds tests

It's going to be much easier to maintain these tests (and all the check prefix combinations) if we don't mix cost kinds in the same file.

22 months ago[Orc] Improve deintialize and shutdown logic
Anubhab Ghosh [Sat, 20 Aug 2022 20:19:34 +0000 (01:49 +0530)]
[Orc] Improve deintialize and shutdown logic

When deinitializing, the allocation needs to be removed from the
allocation list of its associated reservation so that remaining
allocations can be deinitialized when releasing the reservation.

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

22 months ago[Orc] Provide correct Reservation address for slab allocations
Anubhab Ghosh [Sat, 20 Aug 2022 20:13:20 +0000 (01:43 +0530)]
[Orc] Provide correct Reservation address for slab allocations

When slab allocator is used, the MappingBase is not necessarily
the same as the original reservation base as the allocation could
be a part of the whole reservation.

In this case the original reservation address needs to be passed to
ExecutorSharedMemoryMapperService to associate the new allocation
with the original reservation.

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

22 months ago[Orc] Only unmap shared memory in controller process destructor
Anubhab Ghosh [Sat, 20 Aug 2022 20:00:15 +0000 (01:30 +0530)]
[Orc] Only unmap shared memory in controller process destructor

By the time SharedMemoryMapper destructor is called, the RPC
connection is no longer available causing the release() call to
always fail. Instead at this point only shared memory regions
can be unmapped safely.

Deinitializers are called and mapped memory is released at the
executor side by ExecutorSharedMemoryMapperService::shutdown()
instead. Memory can also be released earlier by calling release()
earlier before RPC connection is closed.

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

22 months ago[Orc] Actually save the callback
Anubhab Ghosh [Sat, 20 Aug 2022 19:49:48 +0000 (01:19 +0530)]
[Orc] Actually save the callback

The callback function was captured by reference but it lived on the
stack and was in danger of being overwritten and could cause a crash.

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

22 months ago[CostModel][X86] Split int/fp arithmetic cost kinds tests
Simon Pilgrim [Sun, 21 Aug 2022 10:49:27 +0000 (11:49 +0100)]
[CostModel][X86] Split int/fp arithmetic cost kinds tests

It's going to be much easier to maintain these tests (and all the check prefix combinations) if we don't mix cost kinds in the same file.

22 months ago[mlir][normalize-memrefs] NFC Follow-up D125854
Tung D. Le [Sat, 20 Aug 2022 02:00:28 +0000 (07:30 +0530)]
[mlir][normalize-memrefs] NFC Follow-up D125854

NFC follow-up D125854 to reflect some remaining comments in D125854

Reviewed By: bondhugula

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

22 months ago[CostModel] Add CostKind argument to getShuffleCost
Simon Pilgrim [Sun, 21 Aug 2022 09:19:21 +0000 (10:19 +0100)]
[CostModel] Add CostKind argument to getShuffleCost

Defaults to TCK_RecipThroughput - as most explicit calls were assuming TCK_RecipThroughput (vectorizers) or was just doing a before-vs-after comparison (vectorcombiner). Calls via getInstructionCost were just dropping the CostKind, so again there should be no change at this time (as getShuffleCost and its expansions don't use CostKind yet) - but it will make it easier for us to better account for size/latency shuffle costs in inline/unroll passes in the future.

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

22 months ago[C++20][Modules] Improve handing of Private Module Fragment diagnostics.
Iain Sandoe [Wed, 22 Jun 2022 08:15:53 +0000 (09:15 +0100)]
[C++20][Modules] Improve handing of Private Module Fragment diagnostics.

This adds a check for exported inline functions, that there is a definition in
the definition domain (which, in practice, can only be the module purview but
before any PMF starts) since the PMF definition domain cannot contain exports.

This is:
[dcl.inline]/7
If an inline function or variable that is attached to a named module is declared in
a definition domain, it shall be defined in that domain.

The patch also amends diagnostic output by excluding the PMF sub-module from the
set considered as sources of missing decls.  There is no point in telling the user
that the import of a PMF object is missing - since such objects are never reachable
to an importer.  We still show the definition (as unreachable), to help point out
this.

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

22 months ago[mlir][Bazel] Fix Bazel build
Anlun Xu [Sun, 21 Aug 2022 08:01:04 +0000 (01:01 -0700)]
[mlir][Bazel] Fix Bazel build

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

22 months agoRevert "Use std::is_same_v instead of std::is_same (NFC)"
Kazu Hirata [Sun, 21 Aug 2022 06:00:39 +0000 (23:00 -0700)]
Revert "Use std::is_same_v instead of std::is_same (NFC)"

This reverts commit c5da37e42d388947a40654b7011f2a820ec51601.

This patch seems to break builds with some versions of MSVC.

22 months agoUse std::is_same_v instead of std::is_same (NFC)
Kazu Hirata [Sun, 21 Aug 2022 05:36:26 +0000 (22:36 -0700)]
Use std::is_same_v instead of std::is_same (NFC)

22 months agoUse range-based for loops (NFC)
Kazu Hirata [Sun, 21 Aug 2022 04:18:32 +0000 (21:18 -0700)]
Use range-based for loops (NFC)

22 months agoUse llvm::drop_begin (NFC)
Kazu Hirata [Sun, 21 Aug 2022 04:18:30 +0000 (21:18 -0700)]
Use llvm::drop_begin (NFC)

22 months agoRemove redundant initialization of Optional (NFC)
Kazu Hirata [Sun, 21 Aug 2022 04:18:28 +0000 (21:18 -0700)]
Remove redundant initialization of Optional (NFC)

22 months agoUse llvm::is_contained (NFC)
Kazu Hirata [Sun, 21 Aug 2022 04:18:27 +0000 (21:18 -0700)]
Use llvm::is_contained (NFC)

22 months ago[Scalar] Qualify auto in range-based for loops (NFC)
Kazu Hirata [Sun, 21 Aug 2022 04:18:25 +0000 (21:18 -0700)]
[Scalar] Qualify auto in range-based for loops (NFC)

Identified with readability-qualified-auto.

22 months agoEnsure newlines at the end of files (NFC)
Kazu Hirata [Sun, 21 Aug 2022 04:18:23 +0000 (21:18 -0700)]
Ensure newlines at the end of files (NFC)

22 months ago[libunwind] Fixed a number of typos
Gabriel Ravier [Sun, 21 Aug 2022 01:09:03 +0000 (18:09 -0700)]
[libunwind] Fixed a number of typos

I went over the output of the following mess of a command:

`(ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less)`

and proceeded to spend a few days looking at it to find probable typos
and fixed a few hundred of them in all of the llvm project (note, the
ones I found are not anywhere near all of them, but it seems like a
good start).

Reviewed By: #libunwind, MaskRay

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

22 months ago[mlir] Use std::is_invocable instead of llvm::is_invocable
Joe Loser [Sat, 20 Aug 2022 23:30:14 +0000 (17:30 -0600)]
[mlir] Use std::is_invocable instead of llvm::is_invocable

Now that MLIR is built with C++17, use the standard library equivalent of
`llvm::is_invocable`: `std::is_invocable`.

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

22 months ago[llvm] Remove llvm::is_trivially_{copy/move}_constructible (NFC)
Kazu Hirata [Sat, 20 Aug 2022 21:06:42 +0000 (14:06 -0700)]
[llvm] Remove llvm::is_trivially_{copy/move}_constructible (NFC)

This patch removes llvm::is_trivially_{copy/move}_constructible in
favor of std::is_trivially_{copy/move}_constructible.

The previous attempt to remove them in Dec 2020,
c8d406c93c5bb01599990201f78d8428dd29d289, broke builds with "some
versions of GCC" according to
6cd9608fb37ca2418fb44b57ec955bb5efe10689.

It's been 20 months since then, and the minimum requirement for GCC
has been updated to 7.1 from 5.1.

FWIW, I was able to build llvm with gcc 8.4.0.

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

22 months ago[JITLink] Fix LinkGraph::makeAbsolute, add unit test.
Lang Hames [Sat, 20 Aug 2022 20:32:06 +0000 (13:32 -0700)]
[JITLink] Fix LinkGraph::makeAbsolute, add unit test.

makeAbsolute was not updating the symbol address when applied to external
symbols.

This commit adds a unit test for makeAbsolute, and updates the makeExternal unit
test to check that makeExternal works correctly for absolute symbols.

22 months ago[libc++][string] Removes obsolete constexpr.
Mark de Wever [Sun, 14 Aug 2022 12:14:09 +0000 (14:14 +0200)]
[libc++][string] Removes obsolete constexpr.

Addresses the final review comment of D131421.

Reviewed By: philnik, #libc

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

22 months ago[gn build] Fix oversight in 3adda398cef7f56d0
Nico Weber [Sat, 20 Aug 2022 17:39:45 +0000 (13:39 -0400)]
[gn build] Fix oversight in 3adda398cef7f56d0

22 months ago[bolt][llvm][cmake] Use `CMAKE_INSTALL_LIBDIR` too
John Ericson [Sat, 20 Aug 2022 14:33:21 +0000 (10:33 -0400)]
[bolt][llvm][cmake] Use `CMAKE_INSTALL_LIBDIR` too

Working back towards D130586.

Bolt didn't use `LLVM_LIBDIR_SUFFIX` before, and has no in-tree reverse
dependencies, it seems easier to add.

The change in LLVM itself is to prevent some unexpected `lib64` from
cropping up due to the `CMAKE_INSTALL_LIBDIR` defaulting logic.

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

22 months ago[clang][lldb][cmake] Use new `*_INSTALL_LIBDIR_BASENAME` CPP macro
John Ericson [Sat, 20 Aug 2022 15:20:12 +0000 (11:20 -0400)]
[clang][lldb][cmake] Use new `*_INSTALL_LIBDIR_BASENAME` CPP macro

Use this instead of `*_LIBDIR_SUFFIX`, from which it is computed.

This gets us ready for D130586, in which `*_LIBDIR_SUFFIX` is
deprecated.

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

22 months ago[ADT] Simplify llvm::sort with constexpr if (NFC)
Kazu Hirata [Sat, 20 Aug 2022 16:34:36 +0000 (09:34 -0700)]
[ADT] Simplify llvm::sort with constexpr if (NFC)

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

22 months ago[ADT] Deprecate Any::hasValue
Kazu Hirata [Sat, 20 Aug 2022 16:34:35 +0000 (09:34 -0700)]
[ADT] Deprecate Any::hasValue

This patch deprecates Any::hasValue as I've migrated all known uses of
it to Any::has_value.  I'm planning to remove the deprecated method in
3 months or so.

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

22 months ago[clang] Use Any::has_value instead of Any::hasValue (NFC)
Kazu Hirata [Sat, 20 Aug 2022 15:40:18 +0000 (08:40 -0700)]
[clang] Use Any::has_value instead of Any::hasValue (NFC)

22 months ago[flang] Add semantic checks for interoperability of derived type (C1806)
Peixin Qiao [Sat, 20 Aug 2022 15:34:47 +0000 (23:34 +0800)]
[flang] Add semantic checks for interoperability of derived type (C1806)

As Fortran 2018 C1806, each component of a derived type with the BIND
attribute shall be a nonpointer, nonallocatable data component with
interoperable type.

Reviewed By: klausler

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

22 months ago[flang][OpenMP] Handle the data race for firstprivate and lastprivate
Peixin Qiao [Sat, 20 Aug 2022 15:31:13 +0000 (23:31 +0800)]
[flang][OpenMP] Handle the data race for firstprivate and lastprivate

Remove barriers for firstprivate except if the variable is also
lastprivatized. Re-arrange code and put all last-privates inside a
single scf.if.

As OpenMP Spec 5.0, to avoid the data races, concurrent updates of the
original list item must be synchronized with the read of the original
list item that occurs as a result of the firstprivate clause. Adding
barrier(s) before and/or after the worksharing region would remove the
data races, and it is the application(user)'s job. However, when
one list item is in both firstprivate and lastprivate clauses, the
standard (https://www.openmp.org/spec-html/5.0/openmpsu105.html) states
the following:
```
If a list item appears in both firstprivate and lastprivate clauses, the
update required for the lastprivate clause occurs after all
initializations for the firstprivate clause.
```

So, the synchronization should be ensured by compiler such as emiting
one barrier since the lastprivate clause follows the reads of the
original list item performed for the initialization of each of the
firstprivate list item.

Add FIXME for two special cases, sections construct and linear clause.

The data race problem for single construct will be handled later.

This implementation is based on the discussion with OpenMP committee and
clang code (clang/lib/CodeGen/CGStmtOpenMP.cpp).

Reviewed By: kiranchandramohan, NimishMishra

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

22 months ago[lldb] Use Any::has_value instead of ANy::hasValue (NFC)
Kazu Hirata [Sat, 20 Aug 2022 14:28:06 +0000 (07:28 -0700)]
[lldb] Use Any::has_value instead of ANy::hasValue (NFC)

22 months ago[ADT] Implement Any::has_value
Kazu Hirata [Sat, 20 Aug 2022 14:28:04 +0000 (07:28 -0700)]
[ADT] Implement Any::has_value

This patch implements Any::has_value for consistency with std::any in
C++17.

My plan is to deprecate Any::hasValue after migrating all of its uses
to Any::has_value.  Since I am about to do so, this patch simply
replaces hasValue with has_value in the unit test instead of adding
tests for has_value.

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

22 months ago[ADT] Simplify llvm::reverse with constexpr if (NFC)
Kazu Hirata [Sat, 20 Aug 2022 14:28:03 +0000 (07:28 -0700)]
[ADT] Simplify llvm::reverse with constexpr if (NFC)

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

22 months ago[EarlyCSE][ConstantFolding] do not constant fold atan2(+/-0.0, +/-0.0), part 2
Sanjay Patel [Sat, 20 Aug 2022 12:33:46 +0000 (08:33 -0400)]
[EarlyCSE][ConstantFolding] do not constant fold atan2(+/-0.0, +/-0.0), part 2

Follow-up to 7f1262a322c0d80f3. That patch avoided removing the
call, but it still allowed the constant-folded result. This
makes the behavior consistent with 1-arg libm folding: if the
call potentially raises an exception, then we just bail out.

It seems likely that there are other corner-cases like this,
but the tests are incomplete, so we have lived with these
discrepancies for a long time. This was untested before the
the constant folding was expanded in D127964.

22 months ago[X86] Fold PMULUDQ(X,1) -> AND(X,(1<<32)-1) 'getZeroExtendInReg'
Simon Pilgrim [Sat, 20 Aug 2022 13:58:25 +0000 (14:58 +0100)]
[X86] Fold PMULUDQ(X,1) -> AND(X,(1<<32)-1) 'getZeroExtendInReg'

Fix cases where shl/srem/urem expansion results in a mulh/mul_lohi(x,1) 'pass through' that gets lowered to pmuludq.

Fixes #56684

22 months ago[X86] Add vector test coverage of 'one-bit-diff' and/or icmp ne/eq patterns
Simon Pilgrim [Sat, 20 Aug 2022 13:13:38 +0000 (14:13 +0100)]
[X86] Add vector test coverage of 'one-bit-diff' and/or icmp ne/eq patterns

22 months ago[libc++][doc] Updates status of P2291R3.
Mark de Wever [Sat, 20 Aug 2022 12:45:17 +0000 (14:45 +0200)]
[libc++][doc] Updates status of P2291R3.

Work on the paper has started but it's blocked by PR52954.
Updating the status to avoid duplicated effort implementing this paper.

22 months agoMore llvm-docs-sphinx buildbot fixes
Tom Stellard [Sat, 20 Aug 2022 08:42:48 +0000 (08:42 +0000)]
More llvm-docs-sphinx buildbot fixes

Broken by 7225c0bd0115c947f3c081599e6268cfa027722f and
662a11bd062ac7d938569212fe1c5dc01c1a1b34.

22 months agoFix llvm-docs-sphinx buildbot after 7225c0bd0115c947f3c081599e6268cfa027722f
Tom Stellard [Sat, 20 Aug 2022 08:31:32 +0000 (01:31 -0700)]
Fix llvm-docs-sphinx buildbot after 7225c0bd0115c947f3c081599e6268cfa027722f

22 months agoHowToReleaseLLVM: Add annual release schedule template
Tom Stellard [Sat, 20 Aug 2022 08:25:11 +0000 (01:25 -0700)]
HowToReleaseLLVM: Add annual release schedule template

Reviewed By: ldionne, thieta

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

22 months agoHowToReleaseLLVM: Add some more details about website updates
Tom Stellard [Sat, 20 Aug 2022 08:22:00 +0000 (01:22 -0700)]
HowToReleaseLLVM: Add some more details about website updates

Reviewed By: thieta

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

22 months agoworkflows/llvm-project-tests: Workaround an issue with lldb builds on Windows
Tom Stellard [Sat, 20 Aug 2022 07:15:14 +0000 (00:15 -0700)]
workflows/llvm-project-tests: Workaround an issue with lldb builds on Windows

For some reason cmake started selecting a 32-bit version of python on
Windows instead of the 64-bit version when building windows.  Explicitly
setting the default python to 3.10 fixes this problem.

Reviewed By: thieta

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

22 months agoFix unused variable warnings
Kazu Hirata [Sat, 20 Aug 2022 07:12:35 +0000 (00:12 -0700)]
Fix unused variable warnings

These warnings came up with gcc-11.3.0.

22 months agoReland "[lldb] [test] Disable new CommunicationTests on Windows"
Michał Górny [Fri, 19 Aug 2022 14:22:55 +0000 (16:22 +0200)]
Reland "[lldb] [test] Disable new CommunicationTests on Windows"

This change was wrongly reverted and re-broke the Windows buildbot.

Sponsored by: The FreeBSD Foundation

22 months ago[NFC][AMDGPU] Fix typo.
Thomas [Sat, 20 Aug 2022 06:30:04 +0000 (08:30 +0200)]
[NFC][AMDGPU] Fix typo.

22 months ago[mlir][docs] Migrate away from deprecated llvm::Optional methods
Fangrui Song [Sat, 20 Aug 2022 06:29:31 +0000 (23:29 -0700)]
[mlir][docs] Migrate away from deprecated llvm::Optional methods

22 months ago[lldb] [gdb-remote] Include PID in vCont packets if multiprocess
Michał Górny [Fri, 12 Aug 2022 10:37:18 +0000 (12:37 +0200)]
[lldb] [gdb-remote] Include PID in vCont packets if multiprocess

Try to always send vCont packets and include the PID in them if running
multiprocess.  This is necessary to ensure that with the upcoming full
multiprocess support always resumes the correct process without having
to resort to the legacy Hc packets.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D131758

22 months ago(Reland) [fastalloc] Support allocating specific register class in fastalloc
Luo, Yuanke [Thu, 18 Aug 2022 01:50:55 +0000 (09:50 +0800)]
(Reland) [fastalloc] Support allocating specific register class in fastalloc

This reverts commit 853bb192c407f5d9e75a5fd55cc089151530cbd3.

22 months agoworkflows/version-check: Fix check for release candidates
Tom Stellard [Sat, 20 Aug 2022 04:51:00 +0000 (21:51 -0700)]
workflows/version-check: Fix check for release candidates

Reviewed By: thieta

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

22 months ago[lldb] Use Optional::value instead of Optional::getValue (NFC)
Kazu Hirata [Sat, 20 Aug 2022 04:40:48 +0000 (21:40 -0700)]
[lldb] Use Optional::value instead of Optional::getValue (NFC)

22 months ago[lldb] Use Optional::transform instead of Optional::map (NFC)
Kazu Hirata [Sat, 20 Aug 2022 04:40:47 +0000 (21:40 -0700)]
[lldb] Use Optional::transform instead of Optional::map (NFC)

22 months ago[msan] Bump max allocation on aarch64
Vitaly Buka [Sat, 20 Aug 2022 04:16:02 +0000 (21:16 -0700)]
[msan] Bump max allocation on aarch64

22 months ago[MC][LoongArch] Make .reloc support arbitrary relocation types
wanglei [Sat, 20 Aug 2022 04:06:45 +0000 (12:06 +0800)]
[MC][LoongArch] Make .reloc support arbitrary relocation types

Similar to D76746 (ARM), D76754 (AArch64), D77018 (RISCV)  and
llvmorg-11-init-6967-g152d14da64c (x86)

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

22 months ago[LoongArch] Add some fixups and relocations
wanglei [Sat, 20 Aug 2022 02:13:29 +0000 (10:13 +0800)]
[LoongArch] Add some fixups and relocations

This patch only add %pc_hi20/%pc_lo12/%plt relocations in order
to be able to generate gnu ld linkable relocation file for the
`hello world` IR :
```
@.str = private unnamed_addr constant [14 x i8] c"Hello world!\0A\00", align 1

define dso_local signext i32 @main() nounwind {
entry:
  %call = call signext i32 (ptr, ...) @printf(ptr noundef @.str)
  ret i32 0
}

declare dso_local signext i32 @printf(ptr noundef, ...)
```

This patch also updates some test cases due to new modifiers introduced.
New test: test/MC/LoongArch/Relocations/relocations.s

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

22 months ago[LoongArch] Add codegen support for fsqrt
gonglingqin [Sat, 20 Aug 2022 02:20:30 +0000 (10:20 +0800)]
[LoongArch] Add codegen support for fsqrt

Reviewed By: xen0n, SixWeining

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

22 months ago[docs] Remove lld/ELF release note about --package-metadata= which is in release...
Fangrui Song [Sat, 20 Aug 2022 02:08:28 +0000 (19:08 -0700)]
[docs] Remove lld/ELF release note about --package-metadata= which is in release/15.x

22 months ago[VP] Add splitting for VP_STRIDED_STORE and VP_STRIDED_LOAD
Lorenzo Albano [Sat, 20 Aug 2022 01:15:56 +0000 (18:15 -0700)]
[VP] Add splitting for VP_STRIDED_STORE and VP_STRIDED_LOAD

Following the comment's thread of D117235, I added checks for the widening + splitting case, which also causes a split with one of the resulting vectors to be empty. Due to the same issues described in that same thread, the `fixed-vectors-strided-store.ll` test is missing the widening + splitting case, while the same case in the `strided-vpload.ll` test requires to manually split the loaded vector.

Reviewed By: craig.topper

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

22 months ago[libc++][NFC][spaceship] Update status doc
Adrian Vogelsgesang [Sat, 20 Aug 2022 00:31:19 +0000 (17:31 -0700)]
[libc++][NFC][spaceship] Update status doc

22 months ago[tti] Consolidate getOperandInfo without OperandValueProperties copies [nfc]
Philip Reames [Fri, 19 Aug 2022 23:21:14 +0000 (16:21 -0700)]
[tti] Consolidate getOperandInfo without OperandValueProperties copies [nfc]

22 months ago[AMDGPU] Add iglp_opt builtin and MFMA GEMM Opt strategy
Austin Kerbow [Wed, 17 Aug 2022 17:00:06 +0000 (10:00 -0700)]
[AMDGPU] Add iglp_opt builtin and MFMA GEMM Opt strategy

Adds a builtin that serves as an optimization hint to apply specific optimized
DAG mutations during scheduling. This also disables any other mutations or
clustering that may interfere with the desired pipeline. The first optimization
strategy that is added here is designed to improve the performance of small gemm
kernels on gfx90a.

Reviewed By: jrbyrnes

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

22 months ago[DWARF][BOLT] Fix handling of converting range accesss from ofset to index.
Alexander Yermolovich [Fri, 19 Aug 2022 22:27:55 +0000 (15:27 -0700)]
[DWARF][BOLT] Fix handling of converting range accesss from ofset to index.

Wasn't handling correctly creating DW_AT_rnglists_base in UnitDie when
converting access pattern for DW_AT_ranges from offset to index for DWARF5.

Reviewed By: rafauler

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

22 months ago[lldb] Support specifying a custom libcxx for the API tests
Jonas Devlieghere [Fri, 19 Aug 2022 22:14:15 +0000 (15:14 -0700)]
[lldb] Support specifying a custom libcxx for the API tests

This patch combines D129166 (to always pick the just-built libc++) and
D132257 (to allow customizing the libc++ for testing). The common goal
is to avoid picking up an unexpected libc++ for testing.

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

22 months ago[gn build] Port 57c9780d60b1
LLVM GN Syncbot [Fri, 19 Aug 2022 21:56:27 +0000 (21:56 +0000)]
[gn build] Port 57c9780d60b1

22 months ago[lld][ELF] Rename SymbolTable::symbols() to SymbolTable::getSymbols(). NFC
Sam Clegg [Fri, 29 Jul 2022 17:16:57 +0000 (10:16 -0700)]
[lld][ELF] Rename SymbolTable::symbols() to SymbolTable::getSymbols(). NFC

This change renames this method match its original name and the name
used in the wasm linker.

Back in d8f8abbd4a2823f223bd7bc56445541fb221b512 the ELF SymbolTable
method `getSymbols()` was replaced with `forEachSymbol`.

Then in a2fc96441788fba1e4709d63677f34ed8e321dae `forEachSymbol` was
replaced with a `llvm::iterator_range`.

Then in e9262edf0d11a907763098d8e101219ccd9c43e9 we came full circle
and the `llvm::iterator_range` was replaced with a `symbols()` accessor
that was identical the original `getSymbols()`.

`getSymbols` also matches the name used elsewhere in the ELF linker as
well as in both COFF and wasm backend (e.g. `InputFiles.h` and
`SyntheticSections.h`)

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

22 months ago[clang][ExtractAPI] Record availability information on all platforms
Daniel Grumberg [Mon, 1 Aug 2022 13:55:08 +0000 (14:55 +0100)]
[clang][ExtractAPI] Record availability information on all platforms

Currently ExtractAPI only emits availability information for the
current platform. This makes it easy for clients to get all availability
information for a given symbol in one invocation as opposed to having to invoke
clang once per-platform and then merge the symbol-graphs.

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

22 months agoRevert "[NFC] Precommit test for D132255."
Nico Weber [Fri, 19 Aug 2022 21:53:36 +0000 (17:53 -0400)]
Revert "[NFC] Precommit test for D132255."

This reverts commit 01e3a376955864be6c20fe1134107eb4aa5f2e9c.
Breaks tests on mac and win, see comments on https://reviews.llvm.org/D132255

22 months ago[libc][NFC] Move blockstore out of the CPP folder
Guillaume Chatelet [Fri, 19 Aug 2022 21:51:40 +0000 (21:51 +0000)]
[libc][NFC] Move blockstore out of the CPP folder

22 months ago[RISCV] Add test coverage for 64 bit splat constants
Philip Reames [Fri, 19 Aug 2022 21:39:19 +0000 (14:39 -0700)]
[RISCV] Add test coverage for 64 bit splat constants

22 months ago[libc][NFC] Use STL case for bitset and simplify implementation
Guillaume Chatelet [Fri, 19 Aug 2022 21:39:02 +0000 (21:39 +0000)]
[libc][NFC] Use STL case for bitset and simplify implementation