Skip to content

Commit 503e564

Browse files
committed
Merge remote-tracking branch 'upstream/main' into libcxx/ranges/join_with
2 parents e2351fe + 29db305 commit 503e564

File tree

3,729 files changed

+152135
-98474
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,729 files changed

+152135
-98474
lines changed

.ci/compute_projects_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def test_flang(self):
147147

148148
def test_invalid_subproject(self):
149149
env_variables = compute_projects.get_env_variables(
150-
[".ci/compute_projects.py"], "Linux"
150+
["third-party/benchmark/CMakeLists.txt"], "Linux"
151151
)
152152
self.assertEqual(env_variables["projects_to_build"], "")
153153
self.assertEqual(env_variables["project_check_targets"], "")
@@ -163,7 +163,7 @@ def test_top_level_file(self):
163163

164164
def test_exclude_runtiems_in_projects(self):
165165
env_variables = compute_projects.get_env_variables(
166-
[".ci/compute_projects.py", "libcxx/CMakeLists.txt"], "Linux"
166+
["libcxx/CMakeLists.txt"], "Linux"
167167
)
168168
self.assertEqual(env_variables["projects_to_build"], "")
169169
self.assertEqual(env_variables["project_check_targets"], "")
@@ -192,10 +192,10 @@ def test_ci(self):
192192
env_variables = compute_projects.get_env_variables(
193193
[".ci/compute_projects.py"], "Linux"
194194
)
195-
self.assertEqual(env_variables["projects_to_build"], "clang;lld;llvm;lldb")
195+
self.assertEqual(env_variables["projects_to_build"], "clang;lld;lldb;llvm")
196196
self.assertEqual(
197197
env_variables["project_check_targets"],
198-
"check-clang check-lld check-llvm check-lldb",
198+
"check-clang check-lld check-lldb check-llvm",
199199
)
200200
self.assertEqual(
201201
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"

.ci/generate_test_report_lib.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,17 @@ def plural(num_tests):
122122
]
123123
)
124124

125+
if failures or return_code != 0:
126+
report.extend(
127+
[
128+
"",
129+
"If these failures are unrelated to your changes (for example "
130+
"tests are broken or flaky at HEAD), please open an issue at "
131+
"https://github.com/llvm/llvm-project/issues and add the "
132+
"`infrastructure` label.",
133+
]
134+
)
135+
125136
report = "\n".join(report)
126137
if len(report.encode("utf-8")) > size_limit:
127138
return generate_report(

.ci/generate_test_report_lib_test.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ def test_no_failures_build_failed(self):
109109
110110
All tests passed but another part of the build **failed**.
111111
112-
[Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details."""
112+
[Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.
113+
114+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
113115
),
114116
"error",
115117
),
@@ -169,7 +171,9 @@ def test_report_single_file_single_testsuite(self):
169171
```
170172
Other output goes here
171173
```
172-
</details>"""
174+
</details>
175+
176+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
173177
),
174178
"error",
175179
),
@@ -203,7 +207,9 @@ def test_report_single_file_single_testsuite(self):
203207
```
204208
DEF/test_2 output goes here
205209
```
206-
</details>"""
210+
</details>
211+
212+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
207213
),
208214
"error",
209215
)
@@ -311,7 +317,9 @@ def test_report_dont_list_failures(self):
311317
312318
* 1 test failed
313319
314-
Failed tests and their output was too large to report. Download the build's log file to see the details."""
320+
Failed tests and their output was too large to report. Download the build's log file to see the details.
321+
322+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
315323
),
316324
"error",
317325
),
@@ -352,13 +360,16 @@ def test_report_dont_list_failures_link_to_log(self):
352360
353361
* 1 test failed
354362
355-
Failed tests and their output was too large to report. [Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details."""
363+
Failed tests and their output was too large to report. [Download](https://buildkite.com/organizations/organization_slug/pipelines/pipeline_slug/builds/build_number/jobs/job_id/download.txt) the build's log file to see the details.
364+
365+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
356366
),
357367
"error",
358368
),
359369
)
360370

361371
def test_report_size_limit(self):
372+
test_output = "f" * 1000
362373
self.assertEqual(
363374
generate_test_report_lib.generate_report(
364375
"Foo",
@@ -371,14 +382,16 @@ def test_report_size_limit(self):
371382
<testsuites time="0.02">
372383
<testsuite name="Bar" tests="1" failures="1" skipped="0" time="0.02">
373384
<testcase classname="Bar/test_1" name="test_1" time="0.02">
374-
<failure><![CDATA[Some long output goes here...]]></failure>
385+
<failure><![CDATA[{output}]]></failure>
375386
</testcase>
376387
</testsuite>
377-
</testsuites>"""
388+
</testsuites>""".format(
389+
output=test_output
390+
)
378391
)
379392
)
380393
],
381-
size_limit=128,
394+
size_limit=512,
382395
),
383396
(
384397
dedent(
@@ -387,7 +400,9 @@ def test_report_size_limit(self):
387400
388401
* 1 test failed
389402
390-
Failed tests and their output was too large to report. Download the build's log file to see the details."""
403+
Failed tests and their output was too large to report. Download the build's log file to see the details.
404+
405+
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label."""
391406
),
392407
"error",
393408
),

.ci/metrics/metrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
# name.
3030
GITHUB_JOB_TO_TRACK = {
3131
"github_llvm_premerge_checks": {
32-
"Build and Test Linux (Test Only - Please Ignore Results)": "premerge_linux",
33-
"Build and Test Windows (Test Only - Please Ignore Results)": "premerge_windows",
32+
"Build and Test Linux": "premerge_linux",
33+
"Build and Test Windows": "premerge_windows",
3434
}
3535
}
3636

.github/new-prs-labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,9 @@ tools:llvm-exegesis:
709709
- llvm/test/tools/llvm-exegesis/**
710710
- llvm/unittests/tools/llvm-exegesis/**
711711

712+
tools:llvm-reduce:
713+
- llvm/tools/llvm-reduce/**
714+
712715
platform:windows:
713716
- lld/COFF/**
714717
- clang/lib/Driver/MSVC.cpp

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,15 @@ RUN regsvr32 /S "C:\BuildTools\DIA SDK\bin\amd64\msdia140.dll" & \
3939

4040
# install tools as described in https://llvm.org/docs/GettingStartedVS.html
4141
# and a few more that were not documented...
42-
RUN choco install -y ninja git
42+
RUN choco install -y ninja git sccache
4343
# Pin an older version of Python; the current Python 3.10 fails when
4444
# doing "pip install" for the other dependencies, as it fails to find libxml
4545
# while compiling some package.
4646
RUN choco install -y python3 --version 3.9.7
4747

48-
# ActivePerl is currently not installable via Chocolatey, see
49-
# http://disq.us/p/2ipditb. Install StrawberryPerl instead. Unfortunately,
50-
# StrawberryPerl not only installs Perl, but also a redundant C/C++ compiler
51-
# toolchain, and a copy of pkg-config which can cause misdetections for other
52-
# built products, see
53-
# https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/11 for further
54-
# details. Remove the redundant and unnecessary parts of the StrawberryPerl
55-
# install.
56-
RUN choco install -y strawberryperl && \
57-
rmdir /q /s c:\strawberry\c && \
58-
del /q c:\strawberry\perl\bin\pkg-config*
59-
60-
# libcxx requires clang(-cl) to be available
61-
RUN choco install -y sccache llvm
48+
# Testing requires psutil
6249
RUN pip install psutil
6350

64-
RUN curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20230320/llvm-mingw-20230320-ucrt-x86_64.zip && \
65-
powershell Expand-Archive llvm-mingw-*-ucrt-x86_64.zip -DestinationPath . && \
66-
del llvm-mingw-*-ucrt-x86_64.zip && \
67-
ren llvm-mingw-20230320-ucrt-x86_64 llvm-mingw
68-
6951
# configure Python encoding
7052
ENV PYTHONIOENCODING=UTF-8
7153

@@ -103,11 +85,6 @@ RUN powershell -Command \
10385
RUN git config --system core.longpaths true & \
10486
git config --global core.autocrlf false
10587
106-
# handle for debugging of files beeing locked by some processes.
107-
RUN choco install -y handle
108-
109-
RUN pip3 install pywin32 buildbot-worker==2.8.4
110-
11188
ARG RUNNER_VERSION=2.324.0
11289
ENV RUNNER_VERSION=$RUNNER_VERSION
11390

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
stage1:
3838
if: github.repository_owner == 'llvm'
3939
runs-on: libcxx-self-hosted-linux
40-
container: ghcr.io/llvm/libcxx-linux-builder:2b57ebb50b6d418e70382e655feaa619b558e254
40+
container: ghcr.io/llvm/libcxx-linux-builder:b060022103f551d8ca1dad84122ef73927c86512
4141
continue-on-error: false
4242
strategy:
4343
fail-fast: false

.github/workflows/premerge.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ on:
1616
- closed
1717
push:
1818
branches:
19-
- 'main'
2019
- 'release/**'
2120

2221
concurrency:
@@ -25,7 +24,7 @@ concurrency:
2524

2625
jobs:
2726
premerge-checks-linux:
28-
name: Build and Test Linux (Test Only - Please Ignore Results)
27+
name: Build and Test Linux
2928
if: >-
3029
github.repository_owner == 'llvm' &&
3130
(github.event_name != 'pull_request' || github.event.action != 'closed')
@@ -43,9 +42,6 @@ jobs:
4342
# Mark the job as a success even if the step fails so that people do
4443
# not get notified while the new premerge pipeline is in an
4544
# experimental state.
46-
# TODO(boomanaiden154): Remove this once the pipeline is stable and we
47-
# are ready for people to start recieving notifications.
48-
continue-on-error: true
4945
run: |
5046
git config --global --add safe.directory '*'
5147
@@ -74,7 +70,7 @@ jobs:
7470
include-hidden-files: 'true'
7571

7672
premerge-checks-windows:
77-
name: Build and Test Windows (Test Only - Please Ignore Results)
73+
name: Build and Test Windows
7874
if: >-
7975
github.repository_owner == 'llvm' &&
8076
(github.event_name != 'pull_request' || github.event.action != 'closed')
@@ -110,9 +106,6 @@ jobs:
110106
# Mark the job as a success even if the step fails so that people do
111107
# not get notified while the new premerge pipeline is in an
112108
# experimental state.
113-
# TODO(boomanaiden154): Remove this once the pipeline is stable and we
114-
# are ready for people to start recieving notifications.
115-
continue-on-error: true
116109
if: ${{ steps.vars.outputs.windows-projects != '' }}
117110
shell: cmd
118111
run: |

bolt/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ if(BOLT_BUILT_STANDALONE)
4646
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
4747
set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
4848

49+
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
50+
add_definitions(${LLVM_DEFINITIONS_LIST})
51+
list(APPEND CMAKE_REQUIRED_DEFINITIONS ${LLVM_DEFINITIONS_LIST})
52+
4953
include(AddLLVM)
5054
include(TableGen)
5155
include_directories(${LLVM_INCLUDE_DIRS})

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -562,35 +562,56 @@ class MCPlusBuilder {
562562
return {};
563563
}
564564

565-
virtual ErrorOr<MCPhysReg> getAuthenticatedReg(const MCInst &Inst) const {
566-
llvm_unreachable("not implemented");
567-
return getNoRegister();
568-
}
569-
570-
virtual bool isAuthenticationOfReg(const MCInst &Inst,
571-
MCPhysReg AuthenticatedReg) const {
565+
/// Returns the register where an authenticated pointer is written to by Inst,
566+
/// or std::nullopt if not authenticating any register.
567+
///
568+
/// Sets IsChecked if the instruction always checks authenticated pointer,
569+
/// i.e. it either writes a successfully authenticated pointer or terminates
570+
/// the program abnormally (such as "ldra x0, [x1]!" on AArch64, which crashes
571+
/// on authentication failure even if FEAT_FPAC is not implemented).
572+
virtual std::optional<MCPhysReg>
573+
getWrittenAuthenticatedReg(const MCInst &Inst, bool &IsChecked) const {
572574
llvm_unreachable("not implemented");
573-
return false;
575+
return std::nullopt;
574576
}
575577

576-
virtual MCPhysReg getSignedReg(const MCInst &Inst) const {
578+
/// Returns the register signed by Inst, or std::nullopt if not signing any
579+
/// register.
580+
///
581+
/// The returned register is assumed to be both input and output operand,
582+
/// as it is done on AArch64.
583+
virtual std::optional<MCPhysReg> getSignedReg(const MCInst &Inst) const {
577584
llvm_unreachable("not implemented");
578-
return getNoRegister();
585+
return std::nullopt;
579586
}
580587

581-
virtual ErrorOr<MCPhysReg> getRegUsedAsRetDest(const MCInst &Inst) const {
588+
/// Returns the register used as a return address. Returns std::nullopt if
589+
/// not applicable, such as reading the return address from a system register
590+
/// or from the stack.
591+
///
592+
/// Sets IsAuthenticatedInternally if the instruction accepts a signed
593+
/// pointer as its operand and authenticates it internally.
594+
///
595+
/// Should only be called when isReturn(Inst) is true.
596+
virtual std::optional<MCPhysReg>
597+
getRegUsedAsRetDest(const MCInst &Inst,
598+
bool &IsAuthenticatedInternally) const {
582599
llvm_unreachable("not implemented");
583-
return getNoRegister();
600+
return std::nullopt;
584601
}
585602

586603
/// Returns the register used as the destination of an indirect branch or call
587604
/// instruction. Sets IsAuthenticatedInternally if the instruction accepts
588605
/// a signed pointer as its operand and authenticates it internally.
606+
///
607+
/// Should only be called if isIndirectCall(Inst) or isIndirectBranch(Inst)
608+
/// returns true.
589609
virtual MCPhysReg
590610
getRegUsedAsIndirectBranchDest(const MCInst &Inst,
591611
bool &IsAuthenticatedInternally) const {
592612
llvm_unreachable("not implemented");
593-
return getNoRegister();
613+
return 0; // Unreachable. A valid register should be returned by the
614+
// target implementation.
594615
}
595616

596617
/// Returns the register containing an address safely materialized by `Inst`
@@ -602,14 +623,14 @@ class MCPlusBuilder {
602623
/// controlled, under the Pointer Authentication threat model.
603624
///
604625
/// If the instruction does not write to any register satisfying the above
605-
/// two conditions, NoRegister is returned.
626+
/// two conditions, std::nullopt is returned.
606627
///
607628
/// The Pointer Authentication threat model assumes an attacker is able to
608629
/// modify any writable memory, but not executable code (due to W^X).
609-
virtual MCPhysReg
630+
virtual std::optional<MCPhysReg>
610631
getMaterializedAddressRegForPtrAuth(const MCInst &Inst) const {
611632
llvm_unreachable("not implemented");
612-
return getNoRegister();
633+
return std::nullopt;
613634
}
614635

615636
/// Analyzes if this instruction can safely perform address arithmetics
@@ -622,10 +643,13 @@ class MCPlusBuilder {
622643
/// controlled, provided InReg and executable code are not. Please note that
623644
/// registers other than InReg as well as the contents of memory which is
624645
/// writable by the process should be considered attacker-controlled.
646+
///
647+
/// The instruction should not write any values derived from InReg anywhere,
648+
/// except for OutReg.
625649
virtual std::optional<std::pair<MCPhysReg, MCPhysReg>>
626650
analyzeAddressArithmeticsForPtrAuth(const MCInst &Inst) const {
627651
llvm_unreachable("not implemented");
628-
return std::make_pair(getNoRegister(), getNoRegister());
652+
return std::nullopt;
629653
}
630654

631655
/// Analyzes if a pointer is checked to be authenticated successfully
@@ -670,10 +694,10 @@ class MCPlusBuilder {
670694
///
671695
/// Use this function for simple, single-instruction patterns instead of
672696
/// its getAuthCheckedReg(BB) counterpart.
673-
virtual MCPhysReg getAuthCheckedReg(const MCInst &Inst,
674-
bool MayOverwrite) const {
697+
virtual std::optional<MCPhysReg> getAuthCheckedReg(const MCInst &Inst,
698+
bool MayOverwrite) const {
675699
llvm_unreachable("not implemented");
676-
return getNoRegister();
700+
return std::nullopt;
677701
}
678702

679703
virtual bool isTerminator(const MCInst &Inst) const;

0 commit comments

Comments
 (0)