Skip to content

Commit 41b935b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into libcxx/ranges/join_with
2 parents 6950e48 + bcbdbd2 commit 41b935b

File tree

6,131 files changed

+501081
-267803
lines changed

Some content is hidden

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

6,131 files changed

+501081
-267803
lines changed

.ci/compute_projects.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ def _get_modified_projects(modified_files: list[str]) -> Set[str]:
200200
# documentation builds.
201201
if len(path_parts) > 2 and path_parts[1] == "docs":
202202
continue
203+
# Exclude files for the gn build. We do not test it within premerge
204+
# and changes occur often enough that they otherwise take up
205+
# capacity.
206+
if len(path_parts) > 3 and path_parts[:3] == ("llvm", "utils", "gn"):
207+
continue
203208
modified_projects.add(pathlib.Path(modified_file).parts[0])
204209
return modified_projects
205210

.ci/compute_projects_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,15 @@ def test_exclude_docs(self):
179179
self.assertEqual(env_variables["runtimes_to_build"], "")
180180
self.assertEqual(env_variables["runtimes_check_targets"], "")
181181

182+
def test_exclude_gn(self):
183+
env_variables = compute_projects.get_env_variables(
184+
["llvm/utils/gn/build/BUILD.gn"], "Linux"
185+
)
186+
self.assertEqual(env_variables["projects_to_build"], "")
187+
self.assertEqual(env_variables["project_check_targets"], "")
188+
self.assertEqual(env_variables["runtimes_to_build"], "")
189+
self.assertEqual(env_variables["runtimes_check_targets"], "")
190+
182191

183192
if __name__ == "__main__":
184193
unittest.main()

.ci/generate_test_report_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def plural(num_tests):
9292
]
9393
)
9494
elif failures:
95-
report.extend(["", "## Failed Tests", "(click to see output)"])
95+
report.extend(["", "## Failed Tests", "(click on a test name to see its output)"])
9696

9797
for testsuite_name, failures in failures.items():
9898
report.extend(["", f"### {testsuite_name}"])

.ci/generate_test_report_lib_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# See https://llvm.org/LICENSE.txt for license information.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5+
# To run these tests:
6+
# python -m unittest generate_test_report_lib_test.py
7+
58
import unittest
69
from io import StringIO
710
from textwrap import dedent
@@ -150,7 +153,7 @@ def test_report_single_file_single_testsuite(self):
150153
* 2 tests failed
151154
152155
## Failed Tests
153-
(click to see output)
156+
(click on a test name to see its output)
154157
155158
### Bar
156159
<details>
@@ -182,7 +185,7 @@ def test_report_single_file_single_testsuite(self):
182185
* 2 tests failed
183186
184187
## Failed Tests
185-
(click to see output)
188+
(click on a test name to see its output)
186189
187190
### ABC
188191
<details>

.ci/metrics/metrics.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,13 @@ def github_get_metrics(
282282
queued_count = collections.Counter()
283283
running_count = collections.Counter()
284284

285+
# Initialize all the counters to 0 so we report 0 when no job is queued
286+
# or running.
287+
for wf_name, wf_metric_name in GITHUB_WORKFLOW_TO_TRACK.items():
288+
for job_name, job_metric_name in GITHUB_JOB_TO_TRACK[wf_metric_name].items():
289+
queued_count[wf_metric_name + "_" + job_metric_name] = 0
290+
running_count[wf_metric_name + "_" + job_metric_name] = 0
291+
285292
# The list of workflows this iteration will process.
286293
# MaxSize = GITHUB_WORKFLOWS_MAX_PROCESS_COUNT
287294
workflow_seen_as_completed = set()

.ci/monolithic-linux.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ targets="${2}"
5353
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
5454

5555
echo "--- cmake"
56+
export PIP_BREAK_SYSTEM_PACKAGES=1
5657
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
5758
pip install -q -r "${MONOREPO_ROOT}"/lldb/test/requirements.txt
5859
pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt

.github/new-prs-labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,12 @@ backend:DirectX:
660660
- '**/*dxil*/**'
661661
- '**/*DXContainer*'
662662
- '**/*DXContainer*/**'
663+
- clang/lib/Sema/SemaDirectX.cpp
664+
- clang/include/clang/Sema/SemaDirectX.h
665+
- clang/include/clang/Basic/BuiltinsDirectX.td
666+
- clang/lib/CodeGen/TargetBuiltins/DirectX.cpp
667+
- clang/test/CodeGenDirectX/**
668+
- clang/test/SemaDirectX/**
663669

664670
backend:SPIR-V:
665671
- clang/lib/Driver/ToolChains/SPIRV.*

.github/workflows/ci-post-commit-analyzer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
if: >-
3535
github.repository_owner == 'llvm' &&
3636
github.event.action != 'closed'
37-
runs-on: ubuntu-22.04
37+
runs-on: ubuntu-24.04
3838
container:
39-
image: 'ghcr.io/llvm/ci-ubuntu-22.04:latest'
39+
image: 'ghcr.io/llvm/ci-ubuntu-24.04:latest'
4040
env:
4141
LLVM_VERSION: 18
4242
steps:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ RUN choco install -y handle
108108
109109
RUN pip3 install pywin32 buildbot-worker==2.8.4
110110
111-
ARG RUNNER_VERSION=2.322.0
111+
ARG RUNNER_VERSION=2.323.0
112112
ENV RUNNER_VERSION=$RUNNER_VERSION
113113
114114
RUN powershell -Command \

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RUN cmake -B ./build -G Ninja ./llvm \
3232
-DLLVM_ENABLE_RUNTIMES="compiler-rt" \
3333
-DCMAKE_INSTALL_PREFIX="$LLVM_SYSROOT" \
3434
-DLLVM_ENABLE_PROJECTS="bolt;clang;lld;clang-tools-extra" \
35-
-DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format;scan-build" \
35+
-DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format;scan-build;llvm-symbolizer" \
3636
-DCLANG_DEFAULT_LINKER="lld"
3737

3838
RUN ninja -C ./build stage2-clang-bolt stage2-install-distribution && ninja -C ./build install-distribution
@@ -95,7 +95,7 @@ WORKDIR /home/gha
9595

9696
FROM ci-container as ci-container-agent
9797

98-
ENV GITHUB_RUNNER_VERSION=2.322.0
98+
ENV GITHUB_RUNNER_VERSION=2.323.0
9999

100100
RUN mkdir actions-runner && \
101101
cd actions-runner && \

.github/workflows/libclang-abi-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
- name: Install abi-compliance-checker
105105
run: |
106106
sudo apt-get update
107-
sudo apt-get install abi-dumper autoconf pkg-config
107+
sudo apt-get install -y abi-dumper autoconf pkg-config
108108
- name: Install universal-ctags
109109
run: |
110110
git clone https://github.com/universal-ctags/ctags.git
@@ -157,7 +157,7 @@ jobs:
157157
- name: Install abi-compliance-checker
158158
run: |
159159
sudo apt-get update
160-
sudo apt-get install abi-compliance-checker
160+
sudo apt-get install -y abi-compliance-checker
161161
- name: Compare ABI
162162
run: |
163163
for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do

.github/workflows/libclang-python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ jobs:
3737
projects: clang
3838
# There is an issue running on "windows-2019".
3939
# See https://github.com/llvm/llvm-project/issues/76601#issuecomment-1873049082.
40-
os_list: '["ubuntu-22.04"]'
40+
os_list: '["ubuntu-24.04"]'
4141
python_version: ${{ matrix.python-version }}

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,20 @@ jobs:
197197
os: macos-15
198198
- config: apple-configuration
199199
os: macos-15
200+
# TODO: These jobs are intended to test back-deployment (building against ToT libc++ but running against an
201+
# older system-provided libc++.dylib). Doing this properly would require building the test suite on a
202+
# recent macOS using a recent Clang (hence recent Xcode), and then running the actual test suite on an
203+
# older mac. We could do that by e.g. sharing artifacts between the two jobs.
204+
#
205+
# However, our Lit configuration currently doesn't provide a good way to do that in a batch, so our only
206+
# alternative is to actually build on the same host that we're going to run on. Sadly, that doesn't work
207+
# since older macOSes don't support newer Xcodes. For now, we run the "backdeployment" jobs on recent
208+
# macOS versions as a way to avoid rotting that configuration, but it doesn't provide a lot of additional
209+
# coverage.
200210
- config: apple-system
201-
os: macos-13
211+
os: macos-15
202212
- config: apple-system-hardened
203-
os: macos-13
213+
os: macos-15
204214
runs-on: ${{ matrix.os }}
205215
steps:
206216
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/llvm-project-tests.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ on:
3939
type: string
4040
# Use windows-2019 due to:
4141
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
42-
# Use ubuntu-22.04 rather than ubuntu-24.04 to match the ubuntu
43-
# version in the CI container. Without this, setup-python tries
44-
# to install a python version linked against a newer version of glibc.
45-
# TODO(boomanaiden154): Bump the Ubuntu version once the version in the
46-
# container is bumped.
47-
default: '["ubuntu-22.04", "windows-2019", "macOS-13"]'
42+
default: '["ubuntu-24.04", "windows-2019", "macOS-13"]'
4843

4944
python_version:
5045
required: false
@@ -64,7 +59,7 @@ jobs:
6459
name: Lit Tests
6560
runs-on: ${{ matrix.os }}
6661
container:
67-
image: ${{(startsWith(matrix.os, 'ubuntu') && 'ghcr.io/llvm/ci-ubuntu-22.04:latest') || null}}
62+
image: ${{(startsWith(matrix.os, 'ubuntu') && 'ghcr.io/llvm/ci-ubuntu-24.04:latest') || null}}
6863
volumes:
6964
- /mnt/:/mnt/
7065
strategy:

.github/workflows/llvm-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Install abi-compliance-checker
9393
run: |
9494
sudo apt-get update
95-
sudo apt-get install abi-dumper autoconf pkg-config
95+
sudo apt-get -y install abi-dumper autoconf pkg-config
9696
- name: Install universal-ctags
9797
run: |
9898
git clone https://github.com/universal-ctags/ctags.git
@@ -166,7 +166,7 @@ jobs:
166166
- name: Install abi-compliance-checker
167167
run: |
168168
sudo apt-get update
169-
sudo apt-get install abi-compliance-checker
169+
sudo apt-get -y install abi-compliance-checker
170170
- name: Compare ABI
171171
run: |
172172
if [ -s symbol-list/llvm.symbols ]; then

.github/workflows/premerge.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ jobs:
6565
export CXX=/opt/llvm/bin/clang++
6666
6767
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}"
68+
- name: "Upload artifact"
69+
- name: Upload Artifacts
70+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
71+
with:
72+
name: Premerge Artifacts
73+
path: artifacts/
74+
retention-days: 5
75+
include-hidden-files: 'true'
6876

6977
premerge-checks-windows:
7078
name: Windows Premerge Checks (Test Only - Please Ignore Results)
@@ -113,6 +121,13 @@ jobs:
113121
set MAX_PARALLEL_LINK_JOBS=64
114122
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
115123
bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}"
124+
- name: Upload Artifacts
125+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
126+
with:
127+
name: Premerge Artifacts
128+
path: artifacts/
129+
retention-days: 5
130+
include-hidden-files: 'true'
116131

117132
premerge-check-macos:
118133
name: MacOS Premerge Checks

.github/workflows/spirv-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
build_target: check-llvm-codegen-spirv
2727
projects:
2828
extra_cmake_args: '-DLLVM_TARGETS_TO_BUILD="SPIRV" -DLLVM_INCLUDE_SPIRV_TOOLS_TESTS=ON'
29-
os_list: '["ubuntu-22.04"]'
29+
os_list: '["ubuntu-24.04"]'

.mailmap

Lines changed: 5 additions & 4 deletions

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,51 @@ class MCPlusBuilder {
577577
return getNoRegister();
578578
}
579579

580+
/// Returns the register used as the destination of an indirect branch or call
581+
/// instruction. Sets IsAuthenticatedInternally if the instruction accepts
582+
/// a signed pointer as its operand and authenticates it internally.
583+
virtual MCPhysReg
584+
getRegUsedAsIndirectBranchDest(const MCInst &Inst,
585+
bool &IsAuthenticatedInternally) const {
586+
llvm_unreachable("not implemented");
587+
return getNoRegister();
588+
}
589+
590+
/// Returns the register containing an address safely materialized by `Inst`
591+
/// under the Pointer Authentication threat model.
592+
///
593+
/// Returns the register `Inst` writes to if:
594+
/// 1. the register is a materialized address, and
595+
/// 2. the register has been materialized safely, i.e. cannot be attacker-
596+
/// controlled, under the Pointer Authentication threat model.
597+
///
598+
/// If the instruction does not write to any register satisfying the above
599+
/// two conditions, NoRegister is returned.
600+
///
601+
/// The Pointer Authentication threat model assumes an attacker is able to
602+
/// modify any writable memory, but not executable code (due to W^X).
603+
virtual MCPhysReg
604+
getMaterializedAddressRegForPtrAuth(const MCInst &Inst) const {
605+
llvm_unreachable("not implemented");
606+
return getNoRegister();
607+
}
608+
609+
/// Analyzes if this instruction can safely perform address arithmetics
610+
/// under Pointer Authentication threat model.
611+
///
612+
/// If an (OutReg, InReg) pair is returned, then after Inst is executed,
613+
/// OutReg is as trusted as InReg is.
614+
///
615+
/// The arithmetic instruction is considered safe if OutReg is not attacker-
616+
/// controlled, provided InReg and executable code are not. Please note that
617+
/// registers other than InReg as well as the contents of memory which is
618+
/// writable by the process should be considered attacker-controlled.
619+
virtual std::optional<std::pair<MCPhysReg, MCPhysReg>>
620+
analyzeAddressArithmeticsForPtrAuth(const MCInst &Inst) const {
621+
llvm_unreachable("not implemented");
622+
return std::make_pair(getNoRegister(), getNoRegister());
623+
}
624+
580625
virtual bool isTerminator(const MCInst &Inst) const;
581626

582627
virtual bool isNoop(const MCInst &Inst) const {
@@ -1266,7 +1311,11 @@ class MCPlusBuilder {
12661311

12671312
/// Return MCSymbol extracted from the expression.
12681313
virtual const MCSymbol *getTargetSymbol(const MCExpr *Expr) const {
1269-
if (auto *SymbolRefExpr = dyn_cast<const MCSymbolRefExpr>(Expr))
1314+
if (auto *BinaryExpr = dyn_cast<const MCBinaryExpr>(Expr))
1315+
return getTargetSymbol(BinaryExpr->getLHS());
1316+
1317+
auto *SymbolRefExpr = dyn_cast<const MCSymbolRefExpr>(Expr);
1318+
if (SymbolRefExpr && SymbolRefExpr->getKind() == MCSymbolRefExpr::VK_None)
12701319
return &SymbolRefExpr->getSymbol();
12711320

12721321
return nullptr;
@@ -1737,6 +1786,15 @@ class MCPlusBuilder {
17371786
return {};
17381787
}
17391788

1789+
/// Create a sequence of instructions to compare contents of a register
1790+
/// \p RegNo to immediate \Imm and jump to \p Target if they are different.
1791+
virtual InstructionListType createCmpJNE(MCPhysReg RegNo, int64_t Imm,
1792+
const MCSymbol *Target,
1793+
MCContext *Ctx) const {
1794+
llvm_unreachable("not implemented");
1795+
return {};
1796+
}
1797+
17401798
/// Creates inline memcpy instruction. If \p ReturnEnd is true, then return
17411799
/// (dest + n) instead of dest.
17421800
virtual InstructionListType createInlineMemcpy(bool ReturnEnd) const {

bolt/include/bolt/Core/Relocation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ class Relocation {
8686
/// Adjust value depending on relocation type (make it PC relative or not).
8787
static uint64_t encodeValue(uint32_t Type, uint64_t Value, uint64_t PC);
8888

89+
/// Return true if there are enough bits to encode the relocation value.
90+
static bool canEncodeValue(uint32_t Type, uint64_t Value, uint64_t PC);
91+
8992
/// Extract current relocated value from binary contents. This is used for
9093
/// RISC architectures where values are encoded in specific bits depending
9194
/// on the relocation value. For X86, we limit to sign extending the value

bolt/include/bolt/Passes/DataflowAnalysis.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,17 @@ class DataflowAnalysis {
292292
/// Relies on a ptr map to fetch the previous instruction and then retrieve
293293
/// state. WARNING: Watch out for invalidated pointers. Do not use this
294294
/// function if you invalidated pointers after the analysis has been completed
295-
ErrorOr<const StateTy &> getStateBefore(const MCInst &Point) {
296-
return getStateAt(PrevPoint[&Point]);
295+
ErrorOr<const StateTy &> getStateBefore(const MCInst &Point) const {
296+
auto It = PrevPoint.find(&Point);
297+
if (It == PrevPoint.end())
298+
return make_error_code(std::errc::result_out_of_range);
299+
return getStateAt(It->getSecond());
297300
}
298301

299-
ErrorOr<const StateTy &> getStateBefore(ProgramPoint Point) {
302+
ErrorOr<const StateTy &> getStateBefore(ProgramPoint Point) const {
300303
if (Point.isBB())
301304
return getStateAt(*Point.getBB());
302-
return getStateAt(PrevPoint[Point.getInst()]);
305+
return getStateBefore(*Point.getInst());
303306
}
304307

305308
/// Remove any state annotations left by this analysis

0 commit comments

Comments
 (0)