Commit Graph

10463 Commits

Author SHA1 Message Date
Martin Storsjö
fcbbd9649a [libcxx] Fix using std::wcout/wcin on Windows with streams configured in wide mode
On Windows, the underlying file descriptors for stdout/stdin/stderr
can be reconfigured to wide mode. In the default (narrow) mode, the
charset usually isn't utf8 (as libcxx assumes), but normally a locale
specific codepage (where each codepage only can represent a small
subset of unicode characters).

By configuring the stdout file descriptor to wide mode, the user can
output wchar_t based strings without convesion to the narrow charset.
Within libcxx, don't try to use codecvt to convert this to a narrow
character encoding, but output these strings as such with fputwc.

In wide mode, such strings could be output directly with fwrite too,
but if the file descriptor hasn't been configured in wide mode, that
breaks the output (which currently works reasonably). By always
outputting one character at a time with fputwc, it works regardless
of mode of the stdout file descriptor.

For the narrow output stream, std::cout, outputting (via fwrite)
does fail when the file descriptor is set to wide mode. This matches
how it behaves with both MS STL and GNU libstdc++ too, so this is
probably acceptable.

This fixes https://github.com/llvm/llvm-project/issues/46646, and
the downstream bugs https://github.com/mstorsjo/llvm-mingw/issues/145
and https://github.com/mstorsjo/llvm-mingw/issues/222.

Differential Revision: https://reviews.llvm.org/D146398
2023-06-03 23:11:39 +03:00
Louis Dionne
3b12d34a70 [libc++] Remove min_max_macros test
This test is redundant since we already test the same thing in our
nasty_macros test.

Differential Revision: https://reviews.llvm.org/D152007
2023-06-02 10:05:43 -07:00
Louis Dionne
c0f4b12da4 [libc++] Transition several remaining generated tests to the new .gen format
In addition to reducing the amount of boilerplate we need to generate
whenever a new header is added, this also improves the existing tests
by running them in separate Lit tests (so they can be parallelized).
This also creates separate translation units for most header tests,
which is what we really should have done from the start since it
isolates each header we're testing.

Differential Revision: https://reviews.llvm.org/D151654
2023-06-02 10:02:15 -07:00
Louis Dionne
bb9b12907e [libc++] Fix broken transitive includes test 2023-06-02 07:23:44 -07:00
Louis Dionne
45307f1b0d [libc++] Refactor the mandatory header inclusion tests to .gen.py
This allows removing a bunch of boilerplate from the test suite and
reducing the amount of manual stuff contributors have to do when they
add a new public header.

Differential Revision: https://reviews.llvm.org/D151830
2023-06-01 19:56:30 -07:00
Louis Dionne
6091025b85 [libc++] Make sure we use POSIX paths in header_information.py
Otherwise, the various lists of headers have different content based
on whether they are run on Windows or other platforms, which makes it
really difficult to write .gen.py tests correctly.

Differential Revision: https://reviews.llvm.org/D151913
2023-06-01 19:56:06 -07:00
Nikolas Klauser
d51a84b405 [libc++][PSTL] Implement std::stable_sort
Reviewed By: #libc, ldionne

Spies: ldionne, libcxx-commits

Differential Revision: https://reviews.llvm.org/D151573
2023-06-01 15:07:28 -07:00
Louis Dionne
460d1367c3 [libc++] Extract ccache stats after the bootstrapping build 2023-06-01 13:16:19 -07:00
Louis Dionne
1a6586e88c [libc++] Add a few more mising HIDE_FROM_ABI macros 2023-06-01 11:07:50 -07:00
Piotr Fusik
0b8c8bc874 [NFC][libc++][tests] Move directories under stringstream
Reviewed By: #libc, philnik

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D151884
2023-06-01 08:59:34 -07:00
Nikolas Klauser
ee6ec2c5f1 [libc++][PSTL] Implement std::reduce and std::transform_reduce
Reviewed By: ldionne, #libc

Spies: libcxx-commits, miyuki

Differential Revision: https://reviews.llvm.org/D150736
2023-06-01 08:52:08 -07:00
Louis Dionne
185739af4e [libc++][NFC] Use TEST_HAS_NO_FILESYSTEM_LIBRARY in the test suite
This replaces some uses of internal libc++ macros with the equivalent
macro from "test_macros.h".

Differential Revision: https://reviews.llvm.org/D151825
2023-06-01 08:20:27 -07:00
Louis Dionne
86ab93828a [libc++] Use .gen.py tests to generate _LIBCPP_VERSION tests
This removes the need for contributors to do some manual steps
when adding a new public header.

Differential Revision: https://reviews.llvm.org/D151831
2023-06-01 08:18:43 -07:00
Louis Dionne
99941f6308 [libc++][NFC] Fix header guard for <typeinfo> 2023-06-01 08:06:58 -07:00
Nikolas Klauser
b1dc43aa3a [libc++] Optimize for_each for segmented iterators
```
---------------------------------------------------
Benchmark                       old             new
---------------------------------------------------
bm_for_each/1               3.00 ns         2.98 ns
bm_for_each/2               4.53 ns         4.57 ns
bm_for_each/3               5.82 ns         5.82 ns
bm_for_each/4               6.94 ns         6.91 ns
bm_for_each/5               7.55 ns         7.75 ns
bm_for_each/6               7.06 ns         7.45 ns
bm_for_each/7               6.69 ns         7.14 ns
bm_for_each/8               6.86 ns         4.06 ns
bm_for_each/16              11.5 ns         5.73 ns
bm_for_each/64              43.7 ns         4.06 ns
bm_for_each/512              356 ns         7.98 ns
bm_for_each/4096            2787 ns         53.6 ns
bm_for_each/32768          20836 ns          438 ns
bm_for_each/262144        195362 ns         4945 ns
bm_for_each/1048576       685482 ns        19822 ns
```

Reviewed By: ldionne, Mordante, #libc

Spies: arichardson, libcxx-commits

Differential Revision: https://reviews.llvm.org/D151274
2023-05-31 18:15:25 -07:00
Nikolas Klauser
dc124cda7c [libc++] Introduce __for_each_segment and use it in copy/move
This simplifies the code inside copy/move and makes it easier to apply the optimization to other algorithms.

Reviewed By: ldionne, Mordante, #libc

Spies: arichardson, libcxx-commits

Differential Revision: https://reviews.llvm.org/D151265
2023-05-31 18:15:20 -07:00
Vitaly Buka
1ab4438920 Revert "[2a/3][ASan][libcxx] std::deque annotations"
This reverts commit 605b9c76e0.
2023-05-31 13:50:04 -07:00
Louis Dionne
87acf6ddc7 [libc++][docs] Add note about RFCs for significant changes
Differential Revision: https://reviews.llvm.org/D150813
2023-05-31 12:25:56 -07:00
Louis Dionne
af7f0f2220 [libc++] Add a few missing _LIBCPP_HIDE_FROM_ABI annotations 2023-05-31 12:23:37 -07:00
Mark de Wever
f29f1c7e23 [libc++]{CI] Bumps clang-tidy version used.
The CI can no longer run with clang-tidy 16 increment it to version 17.
Whether permanently moving to the latest development version is being
discussed on Discourse.

Depends on D149455

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D151628
2023-05-31 17:25:42 +02:00
Mark de Wever
cf64668b8c [libc++][test] Prefers the newer clang-tidy version.
Module require Clang 17, since Clang 16 requires the magic # __FILE__
line. Therefore, if available, use clang-tidy 17 too. This change should
be reverted after LLVM 17 is released.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D149455
2023-05-31 17:24:37 +02:00
Mark de Wever
5d4281d549 [libc++] Gives ignore external linkage.
A slightly different fix is in D144994.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D151490
2023-05-31 17:22:52 +02:00
Mark de Wever
ac7d60f73a [libc++] Fixes use-after move diagnostic.
The diagnostic is issued by clang-tidy 17.

This just suppressed the diagnostic. The move operations are non-standard extensions and the class itself is deprecated.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D151223
2023-05-31 17:21:38 +02:00
Hristo Hristov
6614d36d71 [libc++][spaceship] Additional tests for operator<=> map and multimap
- Added additional tests
- Improved existing tests
- Moved misplaced test files to the correct location

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D151205
2023-05-31 10:36:57 +03:00
Mark de Wever
4de9936fe0 [libc++][CI] Escape quoting.
This should fix the Clang CI.
2023-05-31 07:55:05 +02:00
Pengxuan Zheng
fef23e8d87 [libc++] Include "bits/alltypes.h" to provide mbstate_t when using musl libc
With D148542, we ran into the following libc++ build error when using musl libc.

```
.../musl/include/bits/alltypes.h:354:16:
error: definition of type '__mbstate_t' conflicts with typedef of the same name
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
               ^
.../sysroot/usr/include/bits/types/__mbstate_t.h:21:3: note: '__mbstate_t' declared here
} __mbstate_t;
  ^
1 error generated.
```
This is because the mbstate_t definition in musl libc conflicts with the one
from "bits/types/mbstate_t.h", and this patch attempts to fix this build issue
when musl libc is used.

Reviewed By: iana

Differential Revision: https://reviews.llvm.org/D151740
2023-05-30 17:59:32 -07:00
Nikolas Klauser
bf63b15bd4 [libc++][PSTL] Implement std::merge
Reviewed By: ldionne, #libc

Spies: pcwang-thead, libcxx-commits

Differential Revision: https://reviews.llvm.org/D151375
2023-05-30 15:07:06 -07:00
Louis Dionne
19ef02e3f4 [libc++][ci] Use ccache in the jobs that build Clang
This is an attempt to reduce the time taken by the Bootstrapping
build job and the Clang CI job that builds the compiler from scratch.

Differential Revision: https://reviews.llvm.org/D150908
2023-05-30 13:10:03 -07:00
Mark de Wever
0ee73debf7 [libc++][format] Fixes year formatter on Windows.
Windows' libc, like some other libc implementations do not work as
specified for %Y and %y. This uses the fixes used for other libc
implementations.

The work was part of D150593.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D151612
2023-05-30 18:57:55 +02:00
Mark de Wever
66c7388c83 [libc++] Deprecate the classes in strstream.
These have been deprecated since their initial version in libc++. It
seems they were never properly marked as deprecated.

Discovered while working on D151223.

Reviewed By: #libc, ldionne, philnik

Differential Revision: https://reviews.llvm.org/D151474
2023-05-30 18:57:09 +02:00
Mark de Wever
d951c6a533 [libc++][CI] Installs libomp.
This is needed to build clang-tidy plugins using clang-tidy 17.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D151488
2023-05-30 18:40:36 +02:00
Louis Dionne
49614c1dc9 [libc++] Add missing _LIBCPP_HIDE_FROM_ABI macro on constructor 2023-05-29 14:24:15 -07:00
Louis Dionne
1ee839d0ce [libc++] Use the new .gen tests to implement __verbose_abort tests
This reduces the amount of boilerplate that we need to generate
for each commit. It also resolves a problem where the modular CI
would run extremely slow on this test because we'd define a macro
before including the standard library, defeating the module cache.

Differential Revision: https://reviews.llvm.org/D151156
2023-05-29 12:28:52 -07:00
Hristo Hristov
f8b5ac34ad [libc++][spaceship] Implement operator<=> for multiset and set
Implements parts of P1614R2

Implemented `operator<=>` for `multiset` and `set`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D148416
2023-05-29 09:00:14 +03:00
Martin Storsjö
684facbb43 [libcxx] [test] Fix the new alloc tests for Windows
Use ASSERT_WITH_OPERATOR_NEW_FALLBACKS where relevant to waive
the known cases where operator new isn't overridden as expected,
in MinGW DLL configurations.

Clarify the reason for why the fallback in
new.delete.array/new.size_align_nothrow.replace.indirect doesn't
work as expected, which can be considered a vcruntime bug.

Differential Revision: https://reviews.llvm.org/D151304
2023-05-28 13:18:08 +03:00
Mark de Wever
48985f58b4 [libc++][format][test] Adds Windows support.
These tests pass on Windows without additional changes. This has been
tested in D150593.
2023-05-27 13:57:26 +02:00
Mark de Wever
cbaa3597aa Reland "[CMake] Bumps minimum version to 3.20.0.
This reverts commit d763c6e5e2.

Adds the patch by @hans from
https://github.com/llvm/llvm-project/issues/62719
This patch fixes the Windows build.

d763c6e5e2 reverted the reviews

D144509 [CMake] Bumps minimum version to 3.20.0.

This partly undoes D137724.

This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193

Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.

D150532 [OpenMP] Compile assembly files as ASM, not C

Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent)
when compiling a file which has been set as having the language
C. This behaviour change only takes place if "cmake_minimum_required"
is set to 3.20 or newer, or if the policy CMP0119 is set to new.

Attempting to compile assembly files with "-x c" fails, however
this is workarounded in many cases, as OpenMP overrides this with
"-x assembler-with-cpp", however this is only added for non-Windows
targets.

Thus, after increasing cmake_minimum_required to 3.20, this breaks
compiling the GNU assembly for Windows targets; the GNU assembly is
used for ARM and AArch64 Windows targets when building with Clang.
This patch unbreaks that.

D150688 [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump

The build uses other mechanism to select the runtime.

Fixes #62719

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D151344
2023-05-27 12:51:21 +02:00
Louis Dionne
69f16f75c6 [libc++][NFC] Add additional test case for modules issue in Objective-C++
Differential Revision: https://reviews.llvm.org/D151467
2023-05-26 12:40:06 -07:00
Nikolas Klauser
b1cf54f12e [libc++][PSTL] Add a test to make sure that customization points work properly
Reviewed By: #libc, ldionne

Spies: ldionne, libcxx-commits

Differential Revision: https://reviews.llvm.org/D151257
2023-05-26 10:53:08 -07:00
Louis Dionne
437ec156ef [libc++][ci] Install ccache in the Docker image
This will allow using ccache in the jobs that build Clang, which
should speed up those jobs.

Differential Revision: https://reviews.llvm.org/D150907
2023-05-26 10:42:26 -07:00
Nikolas Klauser
9d1b27f9ae [libc++] Fix C++26 transitive includes list
Reviewed By: vitalybuka

Spies: vitalybuka, libcxx-commits

Differential Revision: https://reviews.llvm.org/D151508
2023-05-25 22:32:35 -07:00
Louis Dionne
f039caec33 [libc++] Add support for generated tests in the libc++ test format
A recurring problem recently has been that libc++ has several generated
tests which all need to be re-generated before committing a change. This
creates noise during code reviews and friction for contributors.

Furthermore, the way we generated most of these tests resulted in
extremely bad compilation times when using modules, because we defined
a macro before compiling each file.

This commit introduces a new kind of test called a '.gen' test. These
tests are normal shell tests, however the Lit test format will run the
test to discover the actual Lit tests it should run. This basically
allows generating a Lit test suite on the fly using arbitrary code,
which can be used in the future to generate tests like our __verbose_abort
tests and several others.

Differential Revision: https://reviews.llvm.org/D151258
2023-05-25 14:17:45 -07:00
Mark de Wever
32d8c24277 [libc++][test] Mark throw_format_error as noreturn.
This fixes and GCC error. This was tested in D135787.
2023-05-25 19:45:50 +02:00
Nikolas Klauser
6bc78f0cdb [libc++][PSTL] Make sure that -fexperimental-library enables the PSTL
@Mordante noticed that this was missing while making `<format>` non-experimental.

Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits, Mordante

Differential Revision: https://reviews.llvm.org/D151240
2023-05-25 08:01:00 -07:00
Nikolas Klauser
1fd08edd58 [libc++] Forward to std::{,w}memchr in std::find
Reviewed By: #libc, ldionne

Spies: Mordante, libcxx-commits, ldionne, mikhail.ramalho

Differential Revision: https://reviews.llvm.org/D144394
2023-05-25 07:59:50 -07:00
Tobias Hieta
7bfaa0f09d
[NFC][Py Reformat] Reformat python files in libcxx/libcxxabi
This is an ongoing series of commits that are reformatting our
Python code.

Reformatting is done with `black`.

If you end up having problems merging this commit because you
have made changes to a python file, the best way to handle that
is to run git checkout --ours <yourfile> and then reformat it
with black.

If you run into any problems, post to discourse about it and
we will try to help.

RFC Thread below:

https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Reviewed By: #libc, kwk, Mordante

Differential Revision: https://reviews.llvm.org/D150763
2023-05-25 11:15:34 +02:00
Hristo Hristov
cc2d061266 [libc++][spaceship][NFC] Improved consistency - removed inline specifier for operator<=>
Removed `inline` specifier for consistency as discussed in D148416 previously.

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D151248
2023-05-25 10:20:18 +03:00
Nikolas Klauser
e837f4b7db [libc++][PSTL] Add a simple std::thread backend
This is just to test that the PSTL works with parallelization. This is not supposed to be a production-ready backend.

Reviewed By: ldionne, #libc

Spies: EricWF, arichardson, libcxx-commits

Differential Revision: https://reviews.llvm.org/D150284
2023-05-24 15:33:58 -07:00
Advenam Tacet
605b9c76e0 [2a/3][ASan][libcxx] std::deque annotations
This revision is a part of a series of patches extending AddressSanitizer C++ container overflow detection capabilities by adding annotations, similar to those existing in std::vector, to std::string and `std::deque` collections. These changes allow ASan to detect cases when the instrumented program accesses memory which is internally allocated by the collection but is still not in-use (accesses before or after the stored elements for `std::deque`, or between the size and capacity bounds for `std::string`).

The motivation for the research and those changes was a bug, found by Trail of Bits, in a real code where an out-of-bounds read could happen as two strings were compared via a std::equals function that took `iter1_begin`, `iter1_end`, `iter2_begin` iterators (with a custom comparison function). When object `iter1` was longer than `iter2`, read out-of-bounds on `iter2` could happen. Container sanitization would detect it.

This revision introduces annotations for `std::deque`. Each chunk of the container can now be annotated using the `__sanitizer_annotate_double_ended_contiguous_container` function, which was added in the rG1c5ad6d2c01294a0decde43a88e9c27d7437d157. Any attempt to access poisoned memory will trigger an ASan error. Although false negatives are rare, they are possible due to limitations in the ASan API, where a few (usually up to 7) bytes before the container may remain unpoisoned. There are no false positives in the same way as with `std::vector` annotations.

This patch only supports objects (deques) that use the standard allocator. However, it can be easily extended to support all allocators, as suggested in the D146815 revision.

Furthermore, the patch includes the addition of the `is_double_ended_contiguous_container_asan_correct` function to libcxx/test/support/asan_testing.h. This function can be used to verify whether a `std::deque` object has been correctly annotated.

Finally, the patch extends the unit tests to verify ASan annotations (added LIBCPP_ASSERTs).
If a program is compiled without ASan, all helper functions will be no-ops. In binaries with ASan, there is a negligible performance impact since the code from the change is only executed when the deque container changes in size and it’s proportional to the change. It is important to note that regardless of whether or not these changes are in use, every access to the container's memory is instrumented.

Reviewed By: #libc, philnik

Spies: vitalybuka, hans, mikhail.ramalho, Enna1, #sanitizers, philnik, libcxx-commits

Differential Revision: https://reviews.llvm.org/D132092
2023-05-24 14:26:57 -07:00
AdityaK
63a2b206fa [libc++, std::vector] call the optimized version of __uninitialized_allocator_copy for trivial types
See: https://github.com/llvm/llvm-project/issues/61987

Fix suggested by: @philnik and @var-const

Reviewers: philnik, ldionne, EricWF, var-const

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

Testing:
ninja check-cxx check-clang check-llvm

Benchmark Testcases (BM_CopyConstruct, and BM_Assignment) added.

performance improvement:

Run on (8 X 4800 MHz CPU s)
CPU Caches:
  L1 Data 48 KiB (x4)
  L1 Instruction 32 KiB (x4)
  L2 Unified 1280 KiB (x4)
  L3 Unified 12288 KiB (x1)
Load Average: 1.66, 3.02, 2.43

Comparing build-runtimes-base/libcxx/benchmarks/vector_operations.libcxx.out to build-runtimes/libcxx/benchmarks/vector_operations.libcxx.out
Benchmark                                                   Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------
BM_ConstructSize/vector_byte/5140480                     +0.0362         +0.0362        116906        121132        116902        121131
BM_CopyConstruct/vector_int/5140480                      -0.4563         -0.4577       1755224        954241       1755330        951987
BM_Assignment/vector_int/5140480                         -0.0222         -0.0220        990045        968095        989917        968125
BM_ConstructSizeValue/vector_byte/5140480                +0.0308         +0.0307        116970        120567        116977        120573
BM_ConstructIterIter/vector_char/1024                    -0.0831         -0.0831            19            17            19            17
BM_ConstructIterIter/vector_size_t/1024                  +0.0129         +0.0131            88            89            88            89
BM_ConstructIterIter/vector_string/1024                  -0.0064         -0.0018         54455         54109         54208         54112
OVERALL_GEOMEAN                                          -0.0845         -0.0842             0             0             0             0

FYI, the perf improvements for BM_CopyConstruct due to this patch is mostly subsumed by the https://reviews.llvm.org/D149826. However this patch still adds value by converting copy to memmove (the second testcase).

Before the patch:

```
define linkonce_odr dso_local void @_ZNSt3__16vectorIiNS_9allocatorIiEEE18__construct_at_endIPiS5_EEvT_T0_m(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #4 comdat align 2 {
  %5 = getelementptr inbounds %"class.std::__1::vector", ptr %0, i64 0, i32 1
  %6 = load ptr, ptr %5, align 8, !tbaa !12
  %7 = icmp eq ptr %1, %2
  br i1 %7, label %16, label %8

8:                                                ; preds = %4, %8
  %9 = phi ptr [ %13, %8 ], [ %1, %4 ]
  %10 = phi ptr [ %14, %8 ], [ %6, %4 ]
  %11 = icmp ne ptr %10, null
  tail call void @llvm.assume(i1 %11)
  %12 = load i32, ptr %9, align 4, !tbaa !14
  store i32 %12, ptr %10, align 4, !tbaa !14
  %13 = getelementptr inbounds i32, ptr %9, i64 1
  %14 = getelementptr inbounds i32, ptr %10, i64 1
  %15 = icmp eq ptr %13, %2
  br i1 %15, label %16, label %8, !llvm.loop !16

16:                                               ; preds = %8, %4
  %17 = phi ptr [ %6, %4 ], [ %14, %8 ]
  store ptr %17, ptr %5, align 8, !tbaa !12
  ret void
}
```

After the patch:
```
define linkonce_odr dso_local void @_ZNSt3__16vectorIiNS_9allocatorIiEEE18__construct_at_endIPiS5_EEvT_T0_m(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #4 comdat align 2 {
  %5 = getelementptr inbounds %"class.std::__1::vector", ptr %0, i64 0, i32 1
  %6 = load ptr, ptr %5, align 8, !tbaa !12
  %7 = ptrtoint ptr %2 to i64
  %8 = ptrtoint ptr %1 to i64
  %9 = sub i64 %7, %8
  %10 = ashr exact i64 %9, 2
  tail call void @llvm.memmove.p0.p0.i64(ptr align 4 %6, ptr align 4 %1, i64 %9, i1 false)
  %11 = getelementptr inbounds i32, ptr %6, i64 %10
  store ptr %11, ptr %5, align 8, !tbaa !12
  ret void
}
```

This is due to the optimized version of uninitialized_allocator_copy function.
2023-05-24 13:40:53 -07:00