platform/upstream/llvm.git
12 months ago[compiler-rt][xray] Fix alignment of XRayFileHeader
Leandro Lupori [Tue, 11 Jul 2023 20:08:13 +0000 (20:08 +0000)]
[compiler-rt][xray] Fix alignment of XRayFileHeader

XRayFileHeader storage was obtained from std::aligned_storage
using its default alignment and not the struct's alignment
requirement. This was causing a bus error on AArch32, on armv8
machines, where vld1.64/vst1.64 instructions with 128-bit
alignment requirement were being used to copy XRayFileHeader.

There is still another issue with fdr-single-thread.cpp test on
armv7. Now it runs until completion and produces a valid log file,
but for some reason the function name appears as _end in it,
instead of the expected mangled fn name.

Reviewed By: MaskRay

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

12 months ago[clang-format] Fix support for ObjC blocks with pointer return types
Jared Grubb [Fri, 14 Jul 2023 17:26:09 +0000 (10:26 -0700)]
[clang-format] Fix support for ObjC blocks with pointer return types

The ObjC-block detection code only supports a single token as the return type. Add support to detect pointers, too (ObjC has lots of object-pointers).

For example, using `BasedOnStyle: WebKit`, the following is stable output:

```
int* p = ^int*(void)
{ //
    return nullptr;
}
();
```

After the patch, this is stable:

```
int* p = ^int*(void) { //
    return nullptr;
}();
```

Differential Review: https://reviews.llvm.org/D146434

12 months ago[libc++][NFC] Remove unnecessary declarations in __thread/id.h
Louis Dionne [Tue, 4 Jul 2023 21:45:24 +0000 (17:45 -0400)]
[libc++][NFC] Remove unnecessary declarations in __thread/id.h

12 months ago[libc++][NFC] clang-format __thread/id.h since it just got moved
Louis Dionne [Tue, 4 Jul 2023 21:42:31 +0000 (17:42 -0400)]
[libc++][NFC] clang-format __thread/id.h since it just got moved

12 months ago[libc++] Remove internal "build-with-external-thread-library" configuration
Louis Dionne [Tue, 4 Jul 2023 22:44:00 +0000 (18:44 -0400)]
[libc++] Remove internal "build-with-external-thread-library" configuration

Our threading support layer is currently a huge mess. There are too many
configurations with too many confusing names, and none of them are tested
in the usual CI. Here's a list of names related to these configurations:

  LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY
  _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL

  LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY
  _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL

  LIBCXX_HAS_EXTERNAL_THREAD_API
  _LIBCPP_HAS_THREAD_API_EXTERNAL

This patch cleans this up by removing the ability to build libc++ with
an "external" threading library for testing purposes, removing 4 out of
6 "names" above. That setting was meant to be used by libc++ developers,
but we don't use it in-tree and it's not part of our CI.

I know the ability to use an external threading API is used by some folks
out-of-tree, and this patch doesn't change that. This only changes the
way they will have to test their external threading support. After this
patch, the intent would be for them to set `-DLIBCXX_HAS_EXTERNAL_THREAD_API=ON`
when building the library, and to provide their usual `<__external_threading>`
header when they are testing the library. This can be done easily now
that we support custom lit configuration files in test suites.

The motivation for this patch is that our threading support layer is
basically unmaintainable -- anything beyond adding a new "backend" in
the slot designed for it requires incredible attention. The complexity
added by this setting just doesn't pull its weigh considering the
available alternatives.

Concretely, this will also allow future patches to clean up
`<__threading_support>` significantly.

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

12 months ago[Flang][OpenMP][MLIR] An mlir transformation pass for marking FuncOp's implicitly...
Andrew Gozillon [Mon, 17 Jul 2023 13:20:13 +0000 (08:20 -0500)]
[Flang][OpenMP][MLIR] An mlir transformation pass for marking FuncOp's implicitly called from TargetOp's and declare target marked FuncOp's as implicitly declare target

This pass will mark functions called from TargetOp's
and declare target functions as implicitly declare
target by adding the MLIR declare target attribute
directly to the function.

This pass executes after the initial lowering of Fortran's PFT
to MLIR (FIR/OMP+Arith etc.) and is one of a series of passes
that aim to clean up the MLIR for offloading (seperate passes
in different patches, one for early outlining, another for declare
target function filtering).

Reviewers: jsjodin, skatrak, kiaranchandramohan

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

12 months ago[mlir][OpenMP] Fixed internal compiler error with atomic update operation verification
Nimish Mishra [Mon, 17 Jul 2023 12:57:47 +0000 (18:27 +0530)]
[mlir][OpenMP] Fixed internal compiler error with atomic update operation verification

Fixes https://github.com/llvm/llvm-project/issues/61089 by updating the
verification followed like translation from OpenMP+LLVM MLIR
dialect to LLVM IR.

Reviewed By: kiranchandramohan

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

12 months agoFix Clang Sphinx build
Aaron Ballman [Mon, 17 Jul 2023 13:01:51 +0000 (09:01 -0400)]
Fix Clang Sphinx build

This addresses the issues accidentally introduced in
b0697a1cb0b539c773548f62402816e2d9b6f107

12 months ago[clang][Interp][NFC] Fix a doc comment and a typo
Timm Bäder [Sat, 15 Jul 2023 13:11:27 +0000 (15:11 +0200)]
[clang][Interp][NFC] Fix a doc comment and a typo

12 months ago[Triple] Add llvm::Triple::isLoongArch{32,64}
Weining Lu [Mon, 17 Jul 2023 12:34:32 +0000 (20:34 +0800)]
[Triple] Add llvm::Triple::isLoongArch{32,64}

Reviewed By: MaskRay

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

12 months ago[mlir][NVGPU][NFC] Clean up code structure
Matthias Springer [Mon, 17 Jul 2023 08:30:06 +0000 (10:30 +0200)]
[mlir][NVGPU][NFC] Clean up code structure

* Move passes to `Transforms` directory.
* Add `Utils.h` (will be utilized in a subsequent change).

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

12 months ago[AMDGPU] Add targets gfx1150 and gfx1151
Jay Foad [Mon, 17 Jul 2023 08:34:45 +0000 (09:34 +0100)]
[AMDGPU] Add targets gfx1150 and gfx1151

This is the target definition only. Currently they are treated the same
as GFX 11.0.x.

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

12 months ago[clang][Interp] Diagnose callsite for implicit functions
Timm Bäder [Sat, 8 Jul 2023 08:44:43 +0000 (10:44 +0200)]
[clang][Interp] Diagnose callsite for implicit functions

We don't have any code to point at here, so the diagnostics would just
point to the record declaration. Make them point to the call site
intead.

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

12 months ago[AMDGPU] Add test case for zext of f16 to i32
Jay Foad [Mon, 17 Jul 2023 11:55:27 +0000 (12:55 +0100)]
[AMDGPU] Add test case for zext of f16 to i32

Preserve the test case from this abandoned review:
D51925 [AMDGPU] Fix issue for zext of f16 to i32

12 months ago[libc][NFC] Split memcmp implementations per platform
Guillaume Chatelet [Thu, 13 Jul 2023 11:38:21 +0000 (11:38 +0000)]
[libc][NFC] Split memcmp implementations per platform

This is a follow up on D154800 and D154770 to make the code structure more principled and avoid too many nested #ifdef/#endif.

Reviewed By: courbet

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

12 months ago[compiler-rt] [Arm] Make the tests for the runtime functions __aeabi_c{d,f} work...
Simi Pallipurath [Thu, 13 Jul 2023 13:32:05 +0000 (14:32 +0100)]
[compiler-rt] [Arm] Make the tests for the runtime functions __aeabi_c{d,f} work on Big-Endian.

We are trying to build the compiler-rt as big-endian. And found that the tests compiler-rt/test/builtins/Unit/arm/aeabi_cdcmpeq_test.c and compiler-rt/test/builtins/Unit/arm/aeabi_cfcmpeq_test.c do not work on big endian at the moment. This patch makes these tests work on big endian as well.

Reviewed By: peter.smith, simon_tatham

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

12 months ago[libc][NFC] Split memset implementations per platform
Guillaume Chatelet [Thu, 13 Jul 2023 10:58:41 +0000 (10:58 +0000)]
[libc][NFC] Split memset implementations per platform

This is a follow up on D154800 and D154770 to make the code structure more principled and avoid too many nested #ifdef/#endif.

Reviewed By: courbet

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

12 months ago[NFC][AMDGPU] Default initialize the Subtarget
Jakub Chlanda [Mon, 17 Jul 2023 09:34:54 +0000 (11:34 +0200)]
[NFC][AMDGPU] Default initialize the Subtarget

This is to address a static analizer warning:

The pointer field will point to an arbitrary memory location, any
attempt to write may cause corruption. In <unnamed>
R600DAGToDAGISel.:R600DAGToDAGISel (llvm::TargetMachine &,
livm::CodeGenOpt::Level): A pointer field is not initialized in the
constructor (CWE-457)

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

12 months ago[AArch64] Regenerate CostModel tests with update_analyze_test_checks. NFC
David Green [Mon, 17 Jul 2023 09:23:27 +0000 (10:23 +0100)]
[AArch64] Regenerate CostModel tests with update_analyze_test_checks. NFC

12 months ago[X86] Canonicalize vXi64 SIGN_EXTEND_INREG vXi1 to use v2Xi32 splatted shifts instead
Simon Pilgrim [Fri, 14 Jul 2023 13:37:58 +0000 (14:37 +0100)]
[X86] Canonicalize vXi64 SIGN_EXTEND_INREG vXi1 to use v2Xi32 splatted shifts instead

If somehow a vXi64 bool sign_extend_inreg pattern has been lowered to vector shifts (without PSRAQ support), then try to canonicalize to vXi32 shifts to improve likelihood of value tracking being able to fold them away.

Using a PSLLQ and bitcasted PSRAD node make it very difficult for later fold to recover from this.

12 months ago[ScalarizeMaskedMemIntrin] Use poison instead of undef as placeholder [NFC]
Nuno Lopes [Mon, 17 Jul 2023 09:11:14 +0000 (10:11 +0100)]
[ScalarizeMaskedMemIntrin] Use poison instead of undef as placeholder [NFC]
This is used for masked out lanes, that are replaced with the passthrough value

12 months ago[mlir][bazel] Fix build.
Oleg Shyshkov [Mon, 17 Jul 2023 08:47:51 +0000 (10:47 +0200)]
[mlir][bazel] Fix build.

12 months ago[lldb][AArch64] Add test predicate for systems with SME enabled
David Spickett [Tue, 13 Jun 2023 14:11:44 +0000 (15:11 +0100)]
[lldb][AArch64] Add test predicate for systems with SME enabled

"sme" is just one of many cpuinfo features for SME but it's the
only one we need for testing.

The rest are related to the use of certain instructions and
don't change the register state available.

Reviewed By: omjavaid

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

12 months ago[AArch64] NFC: Replace 'forceStreamingCompatibleSVE' with 'isNeonAvailable'.
Sander de Smalen [Mon, 10 Jul 2023 10:58:52 +0000 (11:58 +0100)]
[AArch64] NFC: Replace 'forceStreamingCompatibleSVE' with 'isNeonAvailable'.

The AArch64Subtarget interface 'isNeonAvailable' is more appropriate going
forward, as we may also want to generate 'streaming SVE' code (not just
'streaming-compatible SVE' code), but here we must still make sure not to
use NEON instructions which are invalid in streaming SVE mode.

12 months ago[SVE][CodeGen] Improve codegen for some zero-extends of masked loads
David Sherwood [Thu, 13 Jul 2023 15:21:31 +0000 (15:21 +0000)]
[SVE][CodeGen] Improve codegen for some zero-extends of masked loads

When doing a masked load of an illegal unpacked type and then
zero-extending to some illegal wider types we sometimes end up
with pointless 'and' instructions that are trying to zero bits
that we already know are zero. This patch fixes that by adding
more cases to performSVEAndCombine.

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

12 months ago[RISCV] Add VL nodes and VP patterns for unary zvbb instructions
Luke Lau [Thu, 13 Jul 2023 18:55:08 +0000 (19:55 +0100)]
[RISCV] Add VL nodes and VP patterns for unary zvbb instructions

This follows the pattern of lowering VP nodes to equivalent
RISCVISD::*_VL nodes. The nodes are modelled after the VP ISD nodes rather
than the actual zvbb instructions, and I've included a merge operand to be
consistent with the underlying pseudos that were recently refactored.

I've defined the nodes in RISCVInstrInfoVVLpatterns.td as the nodes aren't Zvk
specific, but the patterns are in RISCVInstrInfoZvk.td.

Reviewed By: craig.topper

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

12 months ago[RISCV] Fix predicates on zvbb patterns
Luke Lau [Fri, 14 Jul 2023 16:58:15 +0000 (17:58 +0100)]
[RISCV] Fix predicates on zvbb patterns

The zvbb extension predicate was getting overwritten by the vtype predicates.
There's no change in the tests though because the ISD nodes were getting
expanded before instruction selection.

Reviewed By: craig.topper

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

12 months ago[MLIR] [TOSA]: Move reshape(reshape(x)) -> reshape(x) from canonicalization to fold
Matthias Gehre [Thu, 13 Jul 2023 06:53:47 +0000 (08:53 +0200)]
[MLIR] [TOSA]: Move reshape(reshape(x)) -> reshape(x) from canonicalization to fold

reshape(reshape(x)) -> reshape(x) can be directly written as a fold instead of a canonicalization,
to help other passes cleanup while they work.

This initially broke ReshapeConverterExpand/Collapse, which relies on creating foldable reshapes and a carefully crafted
benefit priority of patterns.
I turned this into a single pattern on reshapes, which does expand and/or collapse as needed in one go.

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

12 months ago[lldb][AArch64] Fix flakiness in TestSVEThreadedDynamic
David Spickett [Fri, 7 Jul 2023 11:46:56 +0000 (11:46 +0000)]
[lldb][AArch64] Fix flakiness in TestSVEThreadedDynamic

This test runs to a breakpoint on thread 0. Thread 0 then starts
thread 2 and 3, which both have breakpoints in them.

In https://lab.llvm.org/buildbot/#/builders/96/builds/41674
I think that we managed to do the first check on thread 2 before
thread 3 had started. Therefore "thread continue 3" failed.

So wait for all three to startup before we check their status.

I considered putting a timeout on the while like the wait_for... methods,
but the test itself already has a global timeout. Plus, I'd rather
not be tuning a timeout per piece of hardware this runs on.

99% of the time we will already have 3 threads when the check is done.

Reviewed By: omjavaid

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

12 months ago[Flang][OpenMP][MLIR] Filter emitted code depending on declare target and device
Sergio Afonso [Thu, 29 Jun 2023 11:20:25 +0000 (12:20 +0100)]
[Flang][OpenMP][MLIR] Filter emitted code depending on declare target and device

This patch adds support for selecting which functions are lowered to LLVM IR
from MLIR depending on declare target information and whether host or device
code is being generated.

The approach proposed by this patch is to perform the filtering in two stages:
  - An MLIR transformation pass, which is added to the Flang translation flow
    after the `OMPEarlyOutliningPass`. The functions that are kept are those
    that match the OpenMP processor (host or device) the compiler invocation
    is targeting, according to the presence of the `-fopenmp-is-target-device`
    compiler option and declare target information. All functions contaning an
    `omp.target` are also kept, regardless of the declare target information of
    the function, due to the need for keeping target regions visible for both
    host and device compilation.
  - A filtering step during translation to LLVM IR, which is peformed for those
    functions that were kept because of the presence of a target region inside.
    If the targeted OpenMP processor does not match the declare target
    information of the function, then it is removed from the LLVM IR after its
    contents have been processed and translated. Since they should only contain
    an omp.target operation which, in turn, should have been outlined into
    another LLVM IR function, the wrapper can be deleted at that point.

Depends on D150328 and D150329.

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

12 months ago[SVE][CodeGen] Add more test cases for zero-extends of masked loads
David Sherwood [Fri, 14 Jul 2023 08:39:13 +0000 (08:39 +0000)]
[SVE][CodeGen] Add more test cases for zero-extends of masked loads

This patch adds test cases for extending masked loads of illegal
unpacked types into illegal wider types.

Pre-commits tests for D155281

12 months agocmake: set _LARGEFILE_SOURCE=1 to fix a cmake error
Sylvestre Ledru [Sun, 16 Jul 2023 21:06:01 +0000 (23:06 +0200)]
cmake: set _LARGEFILE_SOURCE=1 to fix a cmake error

```
-- Performing additional configure checks with target flags: -mips32r2;-mabi=32;-D_LARGEFILE_SOURCE;-D_FILE_OFFSET_BITS=64
-- Performing Test COMPILER_RT_HAS_mips_FLOAT16
CMake Error: Parse error in command line argument: _LARGEFILE_SOURCE
 Should be: VAR:type=value
```
See: https://buildd.debian.org/status/fetch.php?pkg=llvm-toolchain-16&arch=mips64el&ver=1%3A16.0.6-4&stamp=1689111818&raw=0

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

12 months ago[clang] Fix delayed template parsing
Serge Pavlov [Mon, 17 Jul 2023 07:51:34 +0000 (14:51 +0700)]
[clang] Fix delayed template parsing

Commit 98390ccb80569e8fbb20e6c996b4b8cff87fbec6 fixed late template
instantiation by clearing FP pragma stack before instantiation. This
solution was based on the assumptions:

- FP pragma stack is not used anymore and it is safe to clear it,
- Default FP options are determined by command line options.

Both the assumptions are wrong. When compilation produces precompiled
header file, state of the stack is serialized and then restored when the
precompiled header is used. Delayed template parsing occurs at the end
of translation unit but before serialization, so clearing FP pragma
stack effects serialized representation. When the precompiled file is
loaded, some conditions can be broken and clang crashed, it was
described in https://github.com/llvm/llvm-project/issues/63704. The
crash was observed only in few cases, on most buildbots it was absent.

The violation of expected conditions was caused by violation of the
second assumption. FPEvalMethod can be modified by target, so it is not
possible to deduce it from LangOptions only. So default FP state read
from precompiled header was different from the state in the initialized
Sema, and this was the crash reason.

Only two targets do such modification of default FP options, these are
i386 and AIX. so the problem was hard to reproduce.

Delayed template parsing should occur with empty pragma stack, so it
must be cleared before the instantiation, but the stack now is saved
and restored after the instantiation is done.

This change should fix https://github.com/llvm/llvm-project/issues/63704.

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

12 months ago[compiler-rt][NFC] Avoid implicit-integer-sign-change in FuzzedDataProvider::ConsumeI...
MarcoFalke [Thu, 13 Jul 2023 14:27:38 +0000 (16:27 +0200)]
[compiler-rt][NFC] Avoid implicit-integer-sign-change in FuzzedDataProvider::ConsumeIntegralInRange

This makes the implicit conversion that is happening explicit.
Otherwise, each user is forced to suppress this
implicit-integer-sign-change runtime error in their their UBSAN
suppressions file.

For example, the runtime error might look like:

runtime error: implicit conversion from type 'long' of value -9223372036854775808 (64-bit, signed) to type 'uint64_t' (aka 'unsigned long') changed the value to 9223372036854775808 (64-bit, unsigned)
    #0 0x55fe29dea91d in long FuzzedDataProvider::ConsumeIntegralInRange<long>(long, long) src/./test/fuzz/FuzzedDataProvider.h:233:25
    [...]
SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change test/fuzz/FuzzedDataProvider.h:233:25 in

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

12 months ago[clang][dataflow] Add `refreshStructValue()`.
Martin Braenne [Mon, 17 Jul 2023 06:31:36 +0000 (06:31 +0000)]
[clang][dataflow] Add `refreshStructValue()`.

Besides being a useful abstraction, this function will help insulate existing clients of the framework from upcoming changes to the API of `StructValue` and `AggregateStorageLocation`.

Depends On D155202

Reviewed By: ymandel, xazax.hun

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

12 months ago[clang][dataflow] Simplify implementation of `transferStdForwardCall()` in optional...
Martin Braenne [Mon, 17 Jul 2023 06:31:03 +0000 (06:31 +0000)]
[clang][dataflow] Simplify implementation of `transferStdForwardCall()` in optional check.

The argument and return value of `std::forward` is always a reference, so we can simply forward the storage location.

Depends On D155075

Reviewed By: ymandel, gribozavr2, xazax.hun

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

12 months ago[clang][dataflow] Add `DataflowEnvironment::createObject()`.
Martin Braenne [Mon, 17 Jul 2023 06:27:59 +0000 (06:27 +0000)]
[clang][dataflow] Add `DataflowEnvironment::createObject()`.

This consolidates the code used in various places to initialize objects (usually for variables) into one central location.

It will also help reduce the number of changes needed when we make the upcoming API changes to `AggregateStorageLocation` and `StructValue`.

Depends On D155074

Reviewed By: ymandel, xazax.hun

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

12 months ago[clang][dataflow] Add a test for not explicitly initialized fields in aggregate initi...
Martin Braenne [Mon, 17 Jul 2023 06:27:42 +0000 (06:27 +0000)]
[clang][dataflow] Add a test for not explicitly initialized fields in aggregate initialization.

Reviewed By: ymandel

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

12 months ago[CMake] Switch the CMP0091 policy (MSVC_RUNTIME_LIBRARY) to the new behaviour
Martin Storsjö [Wed, 12 Jul 2023 12:40:37 +0000 (12:40 +0000)]
[CMake] Switch the CMP0091 policy (MSVC_RUNTIME_LIBRARY) to the new behaviour

With the new behaviour, the /MD or similar options aren't added to
e.g. CMAKE_CXX_FLAGS_RELEASE, but are added separately by CMake.
They can be changed by the cmake variable
CMAKE_MSVC_RUNTIME_LIBRARY or with the target property
MSVC_RUNTIME_LIBRARY.

LLVM has had its own custom CMake flags, e.g. LLVM_USE_CRT_RELEASE,
which affects which CRT is used for release mode builds. Deprecate
these and direct users to use CMAKE_MSVC_RUNTIME_LIBRARY directly
instead (and do a best effort attempt at setting CMAKE_MSVC_RUNTIME_LIBRARY
based on the existing LLVM_USE_CRT_ flags). This only handles the
simple cases, it doesn't handle multi-config generators with
different LLVM_USE_CRT_* variables for different configs though,
but that's probably fine - we should move over to the new upstream
CMake mechanism anyway, and push users towards that.

Change code in compiler-rt, that previously tried to override the
CRT choice to /MT, to set CMAKE_MSVC_RUNTIME_LIBRARY instead of
meddling in the old variables.

This resolves the policy issue in
https://github.com/llvm/llvm-project/issues/63286, and should
handle the issues that were observed originally when the
minimum CMake version was bumped, in
https://github.com/llvm/llvm-project/issues/62719 and
https://github.com/llvm/llvm-project/issues/62739.

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

12 months ago[mlir][ODS] Add support for passing properties to `ref` in `custom`
Markus Böck [Fri, 14 Jul 2023 14:49:09 +0000 (16:49 +0200)]
[mlir][ODS] Add support for passing properties to `ref` in `custom`

This is essentially a follow up to https://reviews.llvm.org/D155072

This adds support for also passing properties as `ref` parameter to `custom`. This requires the property to have been bound previously and will error otherwise. This makes it possible for an implementation of `custom` to take previously parsed data into account, creating nice context-dependent grammars :-)

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

12 months ago[clang-tidy][NFC] Fix syntax in release notes
Piotr Zegar [Mon, 17 Jul 2023 06:20:17 +0000 (06:20 +0000)]
[clang-tidy][NFC] Fix syntax in release notes

Add missing : character to links in release notes
so they could shown properly.

12 months ago[NFC][clang] Fix format in UnsafeBufferUsage.cpp
Evan Wilde [Mon, 17 Jul 2023 05:43:47 +0000 (22:43 -0700)]
[NFC][clang] Fix format in UnsafeBufferUsage.cpp

There were two whitespaces on an otherwise empty that were causing the
bots to fail due to formatting issues. Deleting extra whitespace now.

12 months ago[gn build] Port 42179bbf6bcc
LLVM GN Syncbot [Mon, 17 Jul 2023 05:11:41 +0000 (05:11 +0000)]
[gn build] Port 42179bbf6bcc

12 months ago[clang-tidy] Add check for possibly incomplete switch statements
Shivam Gupta [Sun, 16 Jul 2023 16:43:55 +0000 (22:13 +0530)]
[clang-tidy] Add check for possibly incomplete switch statements

While clang warns about a possibly incomplete switch statement when switching over an enum variable and failing to cover all enum values (either explicitly or with a default case), no such warning is emitted if a plain integer variable is used as switch variable.

Add a clang-tidy check to diagnose these scenarios.

No fixit hint is provided since there are multiple possible solutions.

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

12 months ago[RISCV] Implement prefetch locality by NTLH
Piyou Chen [Mon, 17 Jul 2023 02:23:19 +0000 (19:23 -0700)]
[RISCV] Implement prefetch locality by NTLH

We add the MemOperand then backend will generate NTLH automatically.

```
__builtin_prefetch(ptr,  0 /* rw==read */, 0 /* locality */); => ntl.all + prefetch.r (ptr)
__builtin_prefetch(ptr,  0 /* rw==read */, 1 /* locality */); => ntl.pall + prefetch.r (ptr)
__builtin_prefetch(ptr,  0 /* rw==read */, 2 /* locality */); => ntl.p1 + prefetch.r (ptr)
__builtin_prefetch(ptr,  0 /* rw==read */, 3 /* locality */); => prefetch.r (ptr)
```

Reviewed By: craig.topper

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

12 months ago[RISCV] Adjust the Zfhmin handling in RISCVInstrInfo::copyPhysReg.
Craig Topper [Mon, 17 Jul 2023 03:15:52 +0000 (20:15 -0700)]
[RISCV] Adjust the Zfhmin handling in RISCVInstrInfo::copyPhysReg.

Instead of checking '!Zfh && Zhfmin' first, handle Zfh. Then assert
that the other case is F+Zfhmin. The F+Zfhmin check will need to be
relaxed for bfloat16 support. As it was written before there would
be now error to catch that. Instead it would just silently create
fsgnj.h instructions.

12 months ago[ORC] In defineMaterializing, error out early if tracker is defunct.
Lang Hames [Mon, 17 Jul 2023 00:33:02 +0000 (17:33 -0700)]
[ORC] In defineMaterializing, error out early if tracker is defunct.

An in-flight materialization may try to claim responsibility for new symbols
(via MaterializationResponsibility::defineMaterializing) after the tracker that
is associated with the materialization is removed, leaving the tracker defunct.

Failure to error out early here could leave the JITDylib in an invalid state,
with defineMaterializing associating new symbols with the already-defunct
tracker. Erroring out early prevents this.

12 months ago[Driver] Warn about all instances -mios-version-min not just the last
Cassie Jones [Sun, 16 Jul 2023 23:45:30 +0000 (16:45 -0700)]
[Driver] Warn about all instances -mios-version-min not just the last

Follow-up to D155123, uniformly handle cases where there are duplicate
-mios-verion-min arguments.

Reviewed By: MaskRay

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

12 months ago[ORC] Assert that ExecutionSession is still open when JITDylibs are created.
Lang Hames [Sun, 16 Jul 2023 23:37:09 +0000 (16:37 -0700)]
[ORC] Assert that ExecutionSession is still open when JITDylibs are created.

12 months ago[InferAddressSpaces] Use poison instead of undef as placeholder [NFC]
Nuno Lopes [Sun, 16 Jul 2023 21:33:00 +0000 (22:33 +0100)]
[InferAddressSpaces] Use poison instead of undef as placeholder [NFC]
This placeholder is only used during the execution of the algorithm, and it's patched with a
concrete value at the end

12 months ago[LoopIdiomRecognize] Use poison instead of undef as placeholder [NFC]
Nuno Lopes [Sun, 16 Jul 2023 21:31:17 +0000 (22:31 +0100)]
[LoopIdiomRecognize] Use poison instead of undef as placeholder [NFC]
It was using undef as placeholder for getting the TTI cost for cttz
While at it, update the comments about cttz's last argument (is_zero_poison)

12 months ago[RISCV] Move comments before 'if' instead of after. NFC
Craig Topper [Sun, 16 Jul 2023 19:56:41 +0000 (12:56 -0700)]
[RISCV] Move comments before 'if' instead of after. NFC

This allows us to remove some curly braces around the if body.
The code wasn't consistent about it anyway. Comments before is
used in other places in this file already.

Reviewed By: wangpc, MaskRay

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

12 months ago[RISCV] Make selectSETCC return SDValue instead of bool. NFC
Craig Topper [Sun, 16 Jul 2023 19:56:03 +0000 (12:56 -0700)]
[RISCV] Make selectSETCC return SDValue instead of bool. NFC

We can use a null SDValue for the 'false' case. This avoids the
need for an output parameter. This is consistent with other
SelectionDAG code.

Reviewed By: wangpc

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

12 months ago[clang-tidy] Improve build-in type handling in bugprone-swapped-arguments
Piotr Zegar [Sun, 16 Jul 2023 18:28:39 +0000 (18:28 +0000)]
[clang-tidy] Improve build-in type handling in bugprone-swapped-arguments

Improved detection of argument swaps involving integral and floating-point
types by enhancing handling of implicit conversions. Now implicit casts
from float to double are also considered, same for integers.
Improved documentation.

Fixes: #62926

Reviewed By: carlosgalvezp

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

12 months ago[JITLink] Replace isInRangeForImm* functions with isInt / isUInt equivalents.
Lang Hames [Sun, 16 Jul 2023 17:03:38 +0000 (10:03 -0700)]
[JITLink] Replace isInRangeForImm* functions with isInt / isUInt equivalents.

Avoids some code duplication.

12 months agoCreate diagnostic group for definition deprecation warning
Nuri Amari [Sun, 16 Jul 2023 16:35:25 +0000 (12:35 -0400)]
Create diagnostic group for definition deprecation warning

In https://reviews.llvm.org/D126664, a warning is introduced
warning against the deprecated out of line definition of a
static constexpr member in C++17 and later. Prior to this patch,
the only diagnostic group controlling this diagnostic was -Wdeprecated,
which controls many many diagnostics. This patch creates
a diagnostic group specifically for this warning so it can
be controlled in isolation, while also being included with -Wdeprecated.

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

12 months ago[libc++] Implement stringstream members of P0408R7 (Efficient Access to basic_stringb...
Piotr Fusik [Sun, 16 Jul 2023 13:33:05 +0000 (15:33 +0200)]
[libc++] Implement stringstream members of P0408R7 (Efficient Access to basic_stringbuf's Buffer)

Reviewed By: Mordante, #libc

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

12 months ago[NewGVN] Canonicalize expressions for commutative intrinsics
ManuelJBrito [Fri, 14 Jul 2023 16:29:44 +0000 (17:29 +0100)]
[NewGVN] Canonicalize expressions for commutative intrinsics

Ensure that commutative intrinsics that only differ by a permutation
of their operands get the same value number by sorting the operand value
numbers.

Fixes https://github.com/llvm/llvm-project/issues/46753

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

12 months ago[docs][JITLink] Update JITLink COFF/x86-64 backend status.
Lang Hames [Sun, 16 Jul 2023 16:12:57 +0000 (09:12 -0700)]
[docs][JITLink] Update JITLink COFF/x86-64 backend status.

The COFF/x86-64 backend has been usable since LLVM 16.

12 months ago[libc++] Implement ostringstream members of P0408R7 (Efficient Access to basic_string...
Piotr Fusik [Sun, 16 Jul 2023 13:18:20 +0000 (15:18 +0200)]
[libc++] Implement ostringstream members of P0408R7 (Efficient Access to basic_stringbuf's Buffer)

Reviewed By: #libc, Mordante

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

12 months ago[GlobalISel] Fix infinite loop in reassociation combine
Jay Foad [Fri, 14 Jul 2023 10:33:20 +0000 (11:33 +0100)]
[GlobalISel] Fix infinite loop in reassociation combine

Don't reassociate (C1+C2)+Y -> C1+(C2+Y).

Fixes https://github.com/llvm/llvm-project/issues/63849

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

12 months ago[gn] port f0dfe682bca0 (no more _LIBCPP_ENABLE_ASSERTIONS_DEFAULT)
Nico Weber [Sun, 16 Jul 2023 11:25:55 +0000 (07:25 -0400)]
[gn] port f0dfe682bca0 (no more _LIBCPP_ENABLE_ASSERTIONS_DEFAULT)

12 months ago[NFC][libc++] Fixes some comments.
Mark de Wever [Sun, 16 Jul 2023 09:34:41 +0000 (11:34 +0200)]
[NFC][libc++] Fixes some comments.

12 months agoRevert "[RISCV] Move comments before 'if' instead of after. NFC"
Craig Topper [Sun, 16 Jul 2023 05:54:06 +0000 (22:54 -0700)]
Revert "[RISCV] Move comments before 'if' instead of after. NFC"

This reverts commit ef1ccc493e6167488ac10da2842fa7cac2746565.

Committed by mistake.

12 months ago[RISCV] Use isScalarInteger instead of isInteger. NFC
Craig Topper [Sun, 16 Jul 2023 05:52:36 +0000 (22:52 -0700)]
[RISCV] Use isScalarInteger instead of isInteger. NFC

The type should only be scalar here and the isScalarInteger
should be a simpler check.

12 months ago[RISCV] Move comments before 'if' instead of after. NFC
Craig Topper [Sun, 16 Jul 2023 05:46:38 +0000 (22:46 -0700)]
[RISCV] Move comments before 'if' instead of after. NFC

This allows us to remove some curly braces around the if body.
The code wasn't consistent about it anyway. Comments before is
used in other places in this file already.

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

12 months ago[RISCV] Move vector handling earlier in lowerSELECT. NFC
Craig Topper [Sun, 16 Jul 2023 05:34:16 +0000 (22:34 -0700)]
[RISCV] Move vector handling earlier in lowerSELECT. NFC

This keeps all the scalar code together.

12 months ago[RISCV] Remove 'else' after 'return'. NFC
Craig Topper [Sun, 16 Jul 2023 05:25:26 +0000 (22:25 -0700)]
[RISCV] Remove 'else' after 'return'. NFC

12 months ago[RISCV] Merge rv32/rv64 vector single-width shift intrinsic tests that have the same...
Jim Lin [Wed, 12 Jul 2023 09:40:38 +0000 (17:40 +0800)]
[RISCV] Merge rv32/rv64 vector single-width shift intrinsic tests that have the same content. NFC.

12 months ago[docs] Update JITLink's support matrix in the JITLink doc.
Lang Hames [Sun, 16 Jul 2023 00:19:35 +0000 (17:19 -0700)]
[docs] Update JITLink's support matrix in the JITLink doc.

12 months ago[clangd] Implement end-definition-comment inlay hints
daiyousei-qz [Sat, 15 Jul 2023 23:15:44 +0000 (01:15 +0200)]
[clangd] Implement end-definition-comment inlay hints

This patch implements a new inlay hint feature proposed in https://github.com/clangd/clangd/issues/1634. It introduces a new inlay hint kind BlockEnd which shows a comment-like hint after a definition brace pair, including function/type/namespace. For example,
```
void foo() {
} ^
```
In the code shown above, a hint should be displayed at ^ labelling `// foo`. Such hint only shows when there's no trailing character after the position except whitespaces and optionally ';'.

Also, new configurations are introduced in the inlay hints block
```
InlayHints:
    BlockEnd: Yes # toggling the feature
```

Reviewed By: sammccall

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

12 months agoRe-land "5b012bf5ab5fcb840fe7f6c8664b8981ce6f24f3"
ziqingluo-90 [Sat, 15 Jul 2023 23:11:37 +0000 (16:11 -0700)]
Re-land "5b012bf5ab5fcb840fe7f6c8664b8981ce6f24f3"

Removed dependency on `clangSema` from UnsafeBufferAnalysis.

12 months ago[InstCombine] Generalise ((x1 ^ y1) | (x2 ^ y2)) == 0 transform
Maksim Kita [Sat, 15 Jul 2023 20:55:04 +0000 (15:55 -0500)]
[InstCombine] Generalise ((x1 ^ y1) | (x2 ^ y2)) == 0 transform

Generalise ((x1 ^ y1) | (x2 ^ y2)) == 0 transform to more than two pairs of variables https://github.com/llvm/llvm-project/issues/57831.
Depends D154384.

Reviewed By: goldstein.w.n, nikic

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

12 months ago[InstCombine] Generalise ((x1 ^ y1) | (x2 ^ y2)) == 0 transform tests
Maksim Kita [Sat, 15 Jul 2023 20:55:03 +0000 (15:55 -0500)]
[InstCombine] Generalise ((x1 ^ y1) | (x2 ^ y2)) == 0 transform tests

Precommit tests for D154306.

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

12 months ago[Mips] Set setMaxAtomicSizeInBitsSupported
Brad Smith [Sat, 15 Jul 2023 21:26:05 +0000 (17:26 -0400)]
[Mips] Set setMaxAtomicSizeInBitsSupported

Set setMaxAtomicSizeInBitsSupported for Mips. Set the value as appropriate for 64-bit MIPS vs 32-bit.

Reviewed By: efriedma

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

12 months ago[ELF] Support operator ^ and ^=
Fangrui Song [Sat, 15 Jul 2023 21:10:40 +0000 (14:10 -0700)]
[ELF] Support operator ^ and ^=

GNU ld added ^ support in July 2023 and it looks like ^= is in plan as
well.

For now, we don't support `a^=0` (^= without a preceding space).

12 months ago[amdgpu] Accept an optional max to amdgpu-lds-size attribute for use in PromoteAlloca
Jon Chesterfield [Sat, 15 Jul 2023 19:38:15 +0000 (20:38 +0100)]
[amdgpu] Accept an optional max to amdgpu-lds-size attribute for use in PromoteAlloca

12 months agoUse empty symbol name for XCOFF text csect
Stephen Peckham [Thu, 13 Jul 2023 21:15:48 +0000 (17:15 -0400)]
Use empty symbol name for XCOFF text csect

When generating XCOFF, the compiler generates a csect with an internal
name.  Each function results in a label within the csect.  This patch
replaces the internal name ".text" with an empty string "".  This avoids
adding special code to handle a function text() in the source file, and
works better with some XCOFF tools that are confused when the csect and
the first function have the same address.

Reviewed By: hubert.reinterpretcast

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

12 months agoAdd option -fkeep-persistent-storage-variables to emit all variables that have a...
Zheng Qian [Sat, 15 Jul 2023 00:02:13 +0000 (20:02 -0400)]
Add option -fkeep-persistent-storage-variables to emit all variables that have a persistent storage duration

This patch adds a new option -fkeep-persistent-storage-variables to emit
all variables that have a persistent storage duration, including global,
static and thread-local variables. This could be useful in cases where
the presence of all these variables as symbols in the object file are
required, so that they can be directly addressed.

Reviewed By: hubert.reinterpretcast

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

12 months ago[amdgpu][nfc] Use unsigned for getIntegerPairAttribute to match the only call sites
Jon Chesterfield [Sat, 15 Jul 2023 19:38:15 +0000 (20:38 +0100)]
[amdgpu][nfc] Use unsigned for getIntegerPairAttribute to match the only call sites

12 months ago[lldb][LocateModuleCallback] Fix LocateModuleCallbackTest
Kazuki Sakamoto [Fri, 14 Jul 2023 17:59:39 +0000 (10:59 -0700)]
[lldb][LocateModuleCallback] Fix LocateModuleCallbackTest

ModuleList unexpectedly caches module beyond test.
Tear it down.

- https://green.lab.llvm.org/green/view/LLDB/job/as-lldb-cmake/2260/testReport/junit/lldb-unit/Target___TargetTests_LocateModuleCallbackTest/GetOrCreateModuleWithCachedModule/
- https://green.lab.llvm.org/green/view/LLDB/job/as-lldb-cmake/2260/testReport/junit/lldb-unit/Target___TargetTests_LocateModuleCallbackTest/GetOrCreateModuleWithCachedModuleAndSymbol/

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

12 months ago[docs] GettingStarted.rst cmake should reference build
Farid Zakaria [Sat, 15 Jul 2023 18:36:13 +0000 (11:36 -0700)]
[docs] GettingStarted.rst cmake should reference build

The next sections in GettingStarted assume you are still in the root
directory llvm-project when using ninja.

Make the `cmake --build` command match it as well.

Note: I am a new cmake user and this confused me.

Reviewed By: MaskRay

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

12 months ago[llvm-objcopy] Remove unused internal helper function template makeStringError. NFC
Thomas Köppe [Sat, 15 Jul 2023 18:22:53 +0000 (11:22 -0700)]
[llvm-objcopy] Remove unused internal helper function template makeStringError. NFC

Reviewed By: jhenderson, MaskRay

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

12 months ago[RISCV] Use unsigned instead of signed types for Zk* and Zb* builtins.
Craig Topper [Sat, 15 Jul 2023 18:19:18 +0000 (11:19 -0700)]
[RISCV] Use unsigned instead of signed types for Zk* and Zb* builtins.

Unsigned is a better representation for bitmanipulation and cryptography.w

The only exception being the return values for clz and ctz intrinsics is
a signed int. That matches the target independent clz and ctz builtins.

This is consistent with the current scalar crypto proposal
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/44

Reviewed By: VincentWu

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

12 months ago[clang-format] Correctly annotate overloaded operator function name
Owen Pan [Sat, 15 Jul 2023 07:45:18 +0000 (00:45 -0700)]
[clang-format] Correctly annotate overloaded operator function name

The operator keyword preceded by a template closer should be annotated as
TT_FunctionDeclarationName.

Fixes #63879.

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

12 months ago[libc++][Modules] Restore the <string> include to <__format/format_functions.h>
Ian Anderson [Wed, 12 Jul 2023 20:54:16 +0000 (13:54 -0700)]
[libc++][Modules] Restore the <string> include to <__format/format_functions.h>

<__format/format_functions.h> was using <string>, we need to bring the include back that was removed in D154122.

Reviewed By: Mordante, #libc

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

12 months ago[ubsan] Disable sigaction.cpp on archs for debugging
Caslyn Tonelli [Fri, 14 Jul 2023 17:45:54 +0000 (17:45 +0000)]
[ubsan] Disable sigaction.cpp on archs for debugging

Add `ubsan-tsan` condition to test disablement.

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

12 months ago[X86] LowerMemArgument - remove else clause after return (style). NFC.
Simon Pilgrim [Sat, 15 Jul 2023 14:57:32 +0000 (15:57 +0100)]
[X86] LowerMemArgument - remove else clause after return (style). NFC.

12 months ago[X86] getIRStackGuard - remove else clause after return (style). NFC.
Simon Pilgrim [Sat, 15 Jul 2023 14:55:40 +0000 (15:55 +0100)]
[X86] getIRStackGuard - remove else clause after return (style). NFC.

12 months ago[X86] Fix znver4 fcmp/fma throughputs
Simon Pilgrim [Sat, 15 Jul 2023 14:46:16 +0000 (15:46 +0100)]
[X86] Fix znver4 fcmp/fma throughputs

Reported by SeeSpring - it looks like when the numbers were copied from the znver3 model, the resources were altered when it should have just been the latency.

Now matches uops.info / Agner / AMD SoG

Fixes #63877

12 months ago[libc++] Adds a missing include.
Mark de Wever [Sat, 15 Jul 2023 14:29:36 +0000 (16:29 +0200)]
[libc++] Adds a missing include.

It turns out D153336 needs a new include. This should fix the broken
LLVM CI runners.

12 months ago[libc++][tests] Fix a test testing wrong class
Piotr Fusik [Sat, 15 Jul 2023 09:14:02 +0000 (11:14 +0200)]
[libc++][tests] Fix a test testing wrong class

Reviewed By: #libc, Mordante

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

12 months ago[NFC][libc++][bitset] Refactors constructors.
Mark de Wever [Sun, 9 Jul 2023 13:36:12 +0000 (15:36 +0200)]
[NFC][libc++][bitset] Refactors constructors.

Based on the review comments in D153201 this combines the string and
c-string constructors. The common constructor is using a string_view:
- it allows propagating the _Traits, which are required to be used for
  comparison.
- it avoids allocating
- libc++ supports it in C++03

Reviewed By: philnik, #libc, ldionne

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

12 months ago[ValueTracking] Support vscale assumes for isKnownToBeAPowerOfTwo
zhongyunde [Sat, 15 Jul 2023 11:40:25 +0000 (19:40 +0800)]
[ValueTracking] Support vscale assumes for isKnownToBeAPowerOfTwo

This patch is separated from D154953 to see what tests are affected by this
change alone according comment.
Depend on the related updating of LangRef on D155193.

Reviewed By: paulwalker-arm, nikic, david-arm
Differential Revision: https://reviews.llvm.org/D155350

12 months ago[tests] precommit tests for D155350
zhongyunde [Sat, 15 Jul 2023 11:36:05 +0000 (19:36 +0800)]
[tests] precommit tests for D155350

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

12 months ago[libc++] add basic runtime assertions to <barrier>
Edoardo Sanguineti [Sat, 15 Jul 2023 10:48:10 +0000 (12:48 +0200)]
[libc++] add basic runtime assertions to <barrier>

Adding assertions will aid users that have bugs in their code to receive better error messages.

Reviewed By: #libc, ldionne

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

12 months ago[libc++][chrono] Fixes formatter duration.
Mark de Wever [Sat, 26 Nov 2022 17:15:45 +0000 (18:15 +0100)]
[libc++][chrono] Fixes formatter duration.

@EricWF spotted this issue in the post-commit review comments of
D134742. However the suggestion to just use chrono calculations can
result in similar issues when using small fractional seconds.

Reviewed By: EricWF, #libc

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

12 months ago[libc++] Fixes thread::id's operator<<.
Mark de Wever [Fri, 2 Jun 2023 09:25:50 +0000 (11:25 +0200)]
[libc++] Fixes thread::id's operator<<.

The output of

  template<class charT, class traits>
    basic_ostream<charT, traits>&
      operator<<(basic_ostream<charT, traits>& out, thread::id id);

is affected by the state of out. The wording states

[thread.thread.id]/2
  The text representation for the character type charT of an object of
  type thread::id is an unspecified sequence of charT such that, for two
  objects of type thread::id x and y, if x == y is true, the thread::id
  objects have the same text representation, and if x != y is true, the
  thread::id objects have distinct text representations.

[thread.thread.id]/9
  template<class charT, class traits>
    basic_ostream<charT, traits>&
      operator<< (basic_ostream<charT, traits>& out, thread::id id);

  Effects: Inserts the text representation for charT of id into out.

This wording changed in C++23 due to adding a formatter specialization for
thread::id. However the requirement was the same in older versions of C++.

This issue is that thread::id is an integral or pointer and affected by the
formatting manipulators for them. Thus the text representation can differ if
x == y which violates the requirements.

The fix has to hard-code some formatting style for the text
representation. It uses the Standard specified default values

Table 124: basic_ios::init() effects [tab:basic.ios.cons] flags()
  flags() skipws | dec

Fixes PR: https://llvm.org/PR62073

Reviewed By: #libc, ldionne

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

12 months ago[libc++][NFC] Remove redundant defined(_LIBCPP_BUILDING_LIBRARY)
Nikolas Klauser [Sat, 15 Jul 2023 08:38:07 +0000 (01:38 -0700)]
[libc++][NFC] Remove redundant defined(_LIBCPP_BUILDING_LIBRARY)

12 months agoRevert "Revert "[MemCpyOpt] implement single BB stack-move optimization which unify...
khei4 [Thu, 13 Jul 2023 09:59:21 +0000 (18:59 +0900)]
Revert "Revert "[MemCpyOpt] implement single BB stack-move optimization which unify the static unescaped allocas""

This reverts commit 36a6eb7d12a9f827bf3d5d4e5fdc68b8a62807b2.

[MemCpyOpt] check that load/store and dest/src alloca are all in the same bb

Differential Revision: https://reviews.llvm.org/D153453
Co-authored-by: serge-sans-paille <sguelton@mozilla.com>