Skip to content

Commit c4ca151

Browse files
authored
Merge branch 'llvm:main' into combiner-select-seq
2 parents 9058df6 + 51b8c66 commit c4ca151

File tree

4,183 files changed

+155380
-156650
lines changed

Some content is hidden

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

4,183 files changed

+155380
-156650
lines changed

Diff for: .ci/compute_projects.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
"clang": {"clang-tools-extra", "compiler-rt", "cross-project-tests"},
5353
"clang-tools-extra": {"libc"},
5454
"mlir": {"flang"},
55+
# Test everything if ci scripts are changed.
56+
# FIXME: Figure out what is missing and add here.
57+
".ci": {"llvm", "clang", "lld", "lldb"},
5558
}
5659

5760
DEPENDENT_RUNTIMES_TO_TEST = {"clang": {"libcxx", "libcxxabi", "libunwind"}}
@@ -130,12 +133,11 @@ def _add_dependencies(projects: Set[str]) -> Set[str]:
130133
def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set[str]:
131134
projects_to_test = set()
132135
for modified_project in modified_projects:
133-
# Skip all projects where we cannot run tests.
134-
if modified_project not in PROJECT_CHECK_TARGETS:
135-
continue
136136
if modified_project in RUNTIMES:
137137
continue
138-
projects_to_test.add(modified_project)
138+
# Skip all projects where we cannot run tests.
139+
if modified_project in PROJECT_CHECK_TARGETS:
140+
projects_to_test.add(modified_project)
139141
if modified_project not in DEPENDENTS_TO_TEST:
140142
continue
141143
for dependent_project in DEPENDENTS_TO_TEST[modified_project]:

Diff for: .ci/compute_projects_test.py

+13
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,19 @@ def test_exclude_gn(self):
188188
self.assertEqual(env_variables["runtimes_to_build"], "")
189189
self.assertEqual(env_variables["runtimes_check_targets"], "")
190190

191+
def test_ci(self):
192+
env_variables = compute_projects.get_env_variables(
193+
[".ci/compute_projects.py"], "Linux"
194+
)
195+
self.assertEqual(env_variables["projects_to_build"],
196+
"clang;lld;llvm;lldb")
197+
self.assertEqual(env_variables["project_check_targets"], "check-clang
198+
check-lld check-llvm check-lldb")
199+
self.assertEqual(env_variables["runtimes_to_build"],
200+
"libcxx;libcxxabi;libunwind")
201+
self.assertEqual(env_variables["runtimes_check_targets"], "check-cxx
202+
check-cxxabi check-unwind")
203+
191204

192205
if __name__ == "__main__":
193206
unittest.main()

Diff for: .ci/generate_test_report_lib.py

+1-1
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}"])

Diff for: .ci/generate_test_report_lib_test.py

+5-2
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>

Diff for: .ci/metrics/metrics.py

+7
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()

Diff for: .ci/monolithic-linux.sh

+33-40
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ set -o pipefail
1818

1919
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
2020
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
21-
INSTALL_DIR="${BUILD_DIR}/install"
2221
rm -rf "${BUILD_DIR}"
2322

2423
ccache --zero-stats
@@ -28,11 +27,16 @@ if [[ -n "${CLEAR_CACHE:-}" ]]; then
2827
ccache --clear
2928
fi
3029

30+
mkdir -p artifacts/reproducers
31+
32+
# Make sure any clang reproducers will end up as artifacts.
33+
export CLANG_CRASH_DIAGNOSTICS_DIR=`realpath artifacts/reproducers`
34+
3135
function at-exit {
3236
retcode=$?
3337

34-
mkdir -p artifacts
3538
ccache --print-stats > artifacts/ccache_stats.txt
39+
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
3640

3741
# If building fails there will be no results files.
3842
shopt -s nullglob
@@ -49,17 +53,28 @@ trap at-exit EXIT
4953

5054
projects="${1}"
5155
targets="${2}"
56+
runtimes="${3}"
5257

5358
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
5459

5560
echo "--- cmake"
61+
5662
export PIP_BREAK_SYSTEM_PACKAGES=1
5763
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
5864
pip install -q -r "${MONOREPO_ROOT}"/lldb/test/requirements.txt
5965
pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt
66+
67+
# Set the system llvm-symbolizer as preferred.
68+
export LLVM_SYMBOLIZER_PATH=`which llvm-symbolizer`
69+
[[ ! -f "${LLVM_SYMBOLIZER_PATH}" ]] && echo "llvm-symbolizer not found!"
70+
71+
# Set up all runtimes either way. libcxx is a dependency of LLDB.
72+
# If it ends up being unused, not much harm.
6073
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6174
-D LLVM_ENABLE_PROJECTS="${projects}" \
75+
-D LLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
6276
-G Ninja \
77+
-D CMAKE_PREFIX_PATH="${HOME}/.local" \
6378
-D CMAKE_BUILD_TYPE=Release \
6479
-D LLVM_ENABLE_ASSERTIONS=ON \
6580
-D LLVM_BUILD_EXAMPLES=ON \
@@ -68,69 +83,47 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6883
-D LLVM_ENABLE_LLD=ON \
6984
-D CMAKE_CXX_FLAGS=-gmlt \
7085
-D LLVM_CCACHE_BUILD=ON \
86+
-D LIBCXX_CXX_ABI=libcxxabi \
7187
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
72-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
88+
-D LLDB_ENABLE_PYTHON=ON \
89+
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON
7390

7491
echo "--- ninja"
92+
7593
# Targets are not escaped as they are passed as separate arguments.
7694
ninja -C "${BUILD_DIR}" -k 0 ${targets}
7795

78-
runtimes="${3}"
7996
runtime_targets="${4}"
8097

81-
# Compiling runtimes with just-built Clang and running their tests
82-
# as an additional testing for Clang.
98+
# Run runtimes tests.
99+
# We don't need to do a clean separate build of runtimes, because runtimes
100+
# will be built against just built clang, and because LIBCXX_TEST_PARAMS
101+
# and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully
102+
# propagates without a clean build. Other that those two variables, builds
103+
# are supposed to be the same.
83104
if [[ "${runtimes}" != "" ]]; then
84105
if [[ "${runtime_targets}" == "" ]]; then
85106
echo "Runtimes to build are specified, but targets are not."
86107
exit 1
87108
fi
88109

89-
echo "--- ninja install-clang"
90-
91-
ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers
92-
93-
RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes"
94-
INSTALL_DIR="${BUILD_DIR}/install"
95-
mkdir -p ${RUNTIMES_BUILD_DIR}
96-
97110
echo "--- cmake runtimes C++26"
98111

99-
rm -rf "${RUNTIMES_BUILD_DIR}"
100-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
101-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
102-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
103-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
104-
-D LIBCXX_CXX_ABI=libcxxabi \
105-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
106-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
112+
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
107113
-D LIBCXX_TEST_PARAMS="std=c++26" \
108-
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
109-
-D LLVM_LIT_ARGS="${lit_args}"
114+
-D LIBCXXABI_TEST_PARAMS="std=c++26"
110115

111116
echo "--- ninja runtimes C++26"
112117

113-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
118+
ninja -vC "${BUILD_DIR}" ${runtime_targets}
114119

115120
echo "--- cmake runtimes clang modules"
116121

117-
# We don't need to do a clean build of runtimes, because LIBCXX_TEST_PARAMS
118-
# and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully
119-
# propagates without a clean build. Other that those two variables, builds
120-
# are supposed to be the same.
121-
122-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
123-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
124-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
125-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
126-
-D LIBCXX_CXX_ABI=libcxxabi \
127-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
128-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
122+
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
129123
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
130-
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
131-
-D LLVM_LIT_ARGS="${lit_args}"
124+
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang"
132125

133126
echo "--- ninja runtimes clang modules"
134127

135-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
128+
ninja -vC "${BUILD_DIR}" ${runtime_targets}
136129
fi

Diff for: .ci/monolithic-windows.sh

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function at-exit {
3232

3333
mkdir -p artifacts
3434
sccache --show-stats >> artifacts/sccache_stats.txt
35+
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
3536

3637
# If building fails there will be no results files.
3738
shopt -s nullglob

Diff for: .github/workflows/ci-post-commit-analyzer.yml

+2-2
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:

Diff for: .github/workflows/containers/github-action-ci/Dockerfile

+1-1
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

Diff for: .github/workflows/libclang-python-tests.yml

+1-1
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 }}

Diff for: .github/workflows/libcxx-build-and-test.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ jobs:
216216
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
217217
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
218218
with:
219-
xcode-version: 'latest'
219+
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
220+
xcode-version: '16.3'
220221
- uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
221222
- name: Build and test
222223
run: |

Diff for: .github/workflows/llvm-project-tests.yml

+2-7
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:

Diff for: .github/workflows/premerge.yaml

+15
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 (Linux)
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 (Windows)
128+
path: artifacts/
129+
retention-days: 5
130+
include-hidden-files: 'true'
116131

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

Diff for: .github/workflows/spirv-tests.yml

+1-1
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"]'

Diff for: .mailmap

+5-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
3030
3131
32-
32+
33+
3334
3435
3536
@@ -48,6 +49,6 @@ Ramkumar Ramachandra <[email protected]> <[email protected]>
4849
Ramkumar Ramachandra <[email protected]> <[email protected]>
4950
Saleem Abdulrasool <[email protected]>
5051
51-
Wang Pengcheng <[email protected]>
52-
53-
52+
Pengcheng Wang <[email protected]>
53+
54+

Diff for: bolt/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ if (LLVM_INCLUDE_TESTS)
136136
endif()
137137

138138
if (BOLT_ENABLE_RUNTIME)
139-
message(STATUS "Building BOLT runtime libraries for X86")
139+
message(STATUS "Building BOLT runtime libraries for ${CMAKE_SYSTEM_PROCESSOR}")
140140
set(extra_args "")
141141
if(CMAKE_SYSROOT)
142142
list(APPEND extra_args -DCMAKE_SYSROOT=${CMAKE_SYSROOT})

Diff for: bolt/include/bolt/Core/BinaryFunction.h

+9
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,11 @@ class BinaryFunction {
11741174
return getSecondaryEntryPointSymbol(BB.getLabel());
11751175
}
11761176

1177+
/// Remove a label from the secondary entry point map.
1178+
void removeSymbolFromSecondaryEntryPointMap(const MCSymbol *Label) {
1179+
SecondaryEntryPoints.erase(Label);
1180+
}
1181+
11771182
/// Return true if the basic block is an entry point into the function
11781183
/// (either primary or secondary).
11791184
bool isEntryPoint(const BinaryBasicBlock &BB) const {
@@ -2126,6 +2131,10 @@ class BinaryFunction {
21262131
return Islands && !Islands->DataOffsets.empty();
21272132
}
21282133

2134+
bool isStartOfConstantIsland(uint64_t Offset) const {
2135+
return hasConstantIsland() && Islands->DataOffsets.count(Offset);
2136+
}
2137+
21292138
/// Return true iff the symbol could be seen inside this function otherwise
21302139
/// it is probably another function.
21312140
bool isSymbolValidInScope(const SymbolRef &Symbol, uint64_t SymbolSize) const;

0 commit comments

Comments
 (0)