Skip to content

Commit a03604f

Browse files
Merge remote-tracking branch 'upstream/main' into vinay-issue-128660-P3372-constexpr-map
2 parents 0bcdb71 + 0fd330d commit a03604f

File tree

3,704 files changed

+261056
-52050
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,704 files changed

+261056
-52050
lines changed

.ci/premerge_advisor_explain.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2+
# See https://llvm.org/LICENSE.txt for license information.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
"""Script for getting explanations from the premerge advisor."""
5+
6+
import argparse
7+
import os
8+
import platform
9+
import sys
10+
11+
import requests
12+
13+
import generate_test_report_lib
14+
15+
PREMERGE_ADVISOR_URL = (
16+
"http://premerge-advisor.premerge-advisor.svc.cluster.local:5000/explain"
17+
)
18+
19+
20+
def main(commit_sha: str, build_log_files: list[str]):
21+
junit_objects, ninja_logs = generate_test_report_lib.load_info_from_files(
22+
build_log_files
23+
)
24+
test_failures = generate_test_report_lib.get_failures(junit_objects)
25+
current_platform = f"{platform.system()}-{platform.machine()}".lower()
26+
explanation_request = {
27+
"base_commit_sha": commit_sha,
28+
"platform": current_platform,
29+
"failures": [],
30+
}
31+
if test_failures:
32+
for _, failures in test_failures.items():
33+
for name, failure_messsage in failures:
34+
explanation_request["failures"].append(
35+
{"name": name, "message": failure_messsage}
36+
)
37+
else:
38+
ninja_failures = generate_test_report_lib.find_failure_in_ninja_logs(ninja_logs)
39+
for name, failure_message in ninja_failures:
40+
explanation_request["failures"].append(
41+
{"name": name, "message": failure_message}
42+
)
43+
advisor_response = requests.get(PREMERGE_ADVISOR_URL, json=explanation_request)
44+
if advisor_response.status_code == 200:
45+
print(advisor_response.json())
46+
else:
47+
print(advisor_response.reason)
48+
49+
50+
if __name__ == "__main__":
51+
parser = argparse.ArgumentParser()
52+
parser.add_argument("commit_sha", help="The base commit SHA for the test.")
53+
parser.add_argument(
54+
"build_log_files", help="Paths to JUnit report files and ninja logs.", nargs="*"
55+
)
56+
args = parser.parse_args()
57+
58+
# Skip looking for results on AArch64 for now because the premerge advisor
59+
# service is not available on AWS currently.
60+
if platform.machine() == "arm64":
61+
sys.exit(0)
62+
63+
main(args.commit_sha, args.build_log_files)

.ci/utils.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ function at-exit {
4343
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
4444
$(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \
4545
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
46+
if [[ "$GITHUB_ACTIONS" != "" ]]; then
47+
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_explain.py \
48+
$(git rev-parse HEAD~1) "${BUILD_DIR}"/test-results.*.xml \
49+
"${MONOREPO_ROOT}"/ninja*.log
50+
fi
4651
fi
4752
}
4853
trap at-exit EXIT

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@
5353
/mlir/include/mlir/Interfaces/DestinationStyleOpInterface.* @matthias-springer
5454
/mlir/lib/Interfaces/DestinationStyleOpInterface.* @matthias-springer
5555

56+
# AMDGPU and ROCDL dialects in MLIR.
57+
/mlir/include/mlir/Dialect/AMDGPU @krzysz00 @kuhar
58+
/mlir/lib/Dialect/AMDGPU @krzysz00 @kuhar
59+
/mlir/lib/Conversion/*AMDGPU* @krzysz00 @kuhar
60+
/mlir/lib/Conversion/*ToROCDL @krzysz00 @kuhar
61+
/mlir/include/mlir/Dialect/LLVMIR/ROCDL* @krzysz00 @kuhar
62+
5663
# Bufferization Dialect in MLIR.
5764
/mlir/include/mlir/Dialect/Bufferization @matthias-springer
5865
/mlir/lib/Dialect/Bufferization @matthias-springer

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
ARG LLVM_VERSION=21.1.0
2+
# FIXME: Use "${LLVM_VERSION%%.*}" instead of "LLVM_VERSION_MAJOR" once we update runners to Ubuntu-26.04 with Buildah >= 1.37
3+
ARG LLVM_VERSION_MAJOR=21
24

35
FROM docker.io/library/ubuntu:24.04 AS llvm-downloader
46
ARG LLVM_VERSION
7+
ARG LLVM_VERSION_MAJOR
58

69
RUN apt-get update && \
710
apt-get install -y wget xz-utils && \
811
wget -O llvm.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/LLVM-${LLVM_VERSION}-Linux-X64.tar.xz && \
912
mkdir -p /llvm-extract && \
1013
tar -xvJf llvm.tar.xz -C /llvm-extract \
1114
# Only unpack these tools to save space on Github runner.
15+
LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-${LLVM_VERSION_MAJOR} \
16+
LLVM-${LLVM_VERSION}-Linux-X64/lib/clang/${LLVM_VERSION_MAJOR}/include \
1217
LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-tidy \
1318
LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-format \
1419
LLVM-${LLVM_VERSION}-Linux-X64/bin/git-clang-format && \
@@ -50,12 +55,27 @@ RUN pip install -r requirements_formatting.txt --break-system-packages && \
5055

5156
FROM base AS ci-container-code-lint
5257
ARG LLVM_VERSION
58+
ARG LLVM_VERSION_MAJOR
5359

54-
COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-tidy ${LLVM_SYSROOT}/bin/
60+
COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-tidy \
61+
/llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-${LLVM_VERSION_MAJOR} \
62+
${LLVM_SYSROOT}/bin/
63+
COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/lib/clang/${LLVM_VERSION_MAJOR}/include \
64+
${LLVM_SYSROOT}/lib/clang/${LLVM_VERSION_MAJOR}/include
5565
COPY clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py ${LLVM_SYSROOT}/bin/clang-tidy-diff.py
5666

67+
RUN ln -s ${LLVM_SYSROOT}/bin/clang-${LLVM_VERSION_MAJOR} ${LLVM_SYSROOT}/bin/clang && \
68+
ln -s ${LLVM_SYSROOT}/bin/clang ${LLVM_SYSROOT}/bin/clang++
69+
5770
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
5871

72+
RUN apt-get update && \
73+
DEBIAN_FRONTEND=noninteractive apt-get install -y \
74+
cmake \
75+
ninja-build && \
76+
apt-get clean && \
77+
rm -rf /var/lib/apt/lists/*
78+
5979
# Install dependencies for 'pr-code-lint.yml' job
6080
COPY llvm/utils/git/requirements_linting.txt requirements_linting.txt
6181
RUN pip install -r requirements_linting.txt --break-system-packages && \

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,45 @@ RUN powershell -Command \
9898
Add-Type -AssemblyName System.IO.Compression.FileSystem ; \
9999
[System.IO.Compression.ZipFile]::ExtractToDirectory('actions-runner-win.zip', $PWD) ;\
100100
rm actions-runner-win.zip
101+
102+
# Set the LLVM_VERSION environment variable
103+
ENV LLVM_VERSION=21.1.2
104+
105+
# Download and extract Clang compiler.
106+
# Create directories, download, extract, and clean up all in one layer
107+
RUN powershell -Command \
108+
# --- Setup directories --- \
109+
Write-Host "Creating directories..."; \
110+
New-Item -Path "C:\temp-download" -ItemType "Directory" -Force ; \
111+
New-Item -Path "C:\xz-utils" -ItemType "Directory" -Force ; \
112+
New-Item -Path "C:\clang" -ItemType "Directory" -Force ; \
113+
# --- 1. Download and extract xz --- \
114+
Set-Location C:\temp-download ; \
115+
Invoke-WebRequest -Uri "http://github.com/tukaani-project/xz/releases/download/v5.8.1/xz-5.8.1-windows.zip" -OutFile "xz.zip"; \
116+
(Get-FileHash -Path "C:\temp-download\xz.zip" -Algorithm MD5).Hash -eq 'c3c69fdce3e825cc0b76123b36b0bcc2' ; \
117+
Add-Type -AssemblyName "System.IO.Compression.FileSystem"; \
118+
[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\temp-download\xz.zip', 'C:\xz-utils'); \
119+
# --- 2. Download and decompress Clang --- \
120+
Invoke-WebRequest -Uri "http://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.2/clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz" -OutFile "clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz" ; \
121+
(Get-FileHash -Path "C:\temp-download\clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz" -Algorithm MD5).Hash -eq '0ae1d3effd9ab9d323f7fa595777f0a2' ; \
122+
C:\xz-utils\bin_x86-64\xz.exe -d -qq clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz ; \
123+
# --- 3. Extract clang --- \
124+
C:\Windows\System32\tar.exe -xf clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar -C C:\clang ; \
125+
# --- 4. Clean up --- \
126+
Set-Location C:\ ; \
127+
Remove-Item C:\temp-download -Recurse -Force; \
128+
Remove-Item C:\xz-utils -Recurse -Force; \
129+
# -- 5. Shorten path to clang files & remove unnecessary files -- \
130+
Set-Location C:\clang ; \
131+
Rename-Item -Path "C:\clang\clang+llvm-21.1.2-x86_64-pc-windows-msvc" -NewName "C:\clang\clang-msvc" ; \
132+
Set-Location C:\clang\clang-msvc ; \
133+
Remove-Item -Path C:\clang\clang-msvc\libexec -Recurse -Force ; \
134+
Remove-Item -Path C:\clang\clang-msvc\share -Recurse -Force ; \
135+
Rename-Item -Path "C:\clang\clang-msvc\bin" -NewName "C:\clang\clang-msvc\bin-full" ; \
136+
New-Item -Path "C:\clang\clang-msvc\bin" -ItemType Directory -Force ; \
137+
Set-Location C:\clang\clang-msvc\bin ; \
138+
Copy-Item -Path C:\clang\clang-msvc\bin-full\*.dll -Destination C:\clang\clang-msvc\bin\. ; \
139+
Copy-Item -Path C:\clang\clang-msvc\bin-full\clang-cl.exe -Destination C:\clang\clang-msvc\bin\. ; \
140+
Copy-Item -Path C:\clang\clang-msvc\bin-full\lld-link.exe -Destination C:\clang\clang-msvc\bin\. ; \
141+
Set-Location C:\clang\clang-msvc ; \
142+
Remove-Item -Path C:\clang\clang-msvc\bin-full -Recurse -Force ;

.github/workflows/libcxx-run-benchmarks.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,21 @@ jobs:
6464
path: repo # Avoid nuking the workspace, where we have the Python virtualenv
6565

6666
- name: Run baseline
67+
env:
68+
BENCHMARKS: ${{ steps.vars.outputs.benchmarks }}
6769
run: |
6870
source .venv/bin/activate && cd repo
6971
python -m pip install -r libcxx/utils/requirements.txt
7072
baseline_commit=$(git merge-base ${{ steps.vars.outputs.pr_base }} ${{ steps.vars.outputs.pr_head }})
71-
./libcxx/utils/test-at-commit --commit ${baseline_commit} -B build/baseline -- -sv -j1 --param optimization=speed ${{ steps.vars.outputs.benchmarks }}
73+
./libcxx/utils/test-at-commit --commit ${baseline_commit} -B build/baseline -- -sv -j1 --param optimization=speed "$BENCHMARKS"
7274
./libcxx/utils/consolidate-benchmarks build/baseline | tee baseline.lnt
7375
7476
- name: Run candidate
77+
env:
78+
BENCHMARKS: ${{ steps.vars.outputs.benchmarks }}
7579
run: |
7680
source .venv/bin/activate && cd repo
77-
./libcxx/utils/test-at-commit --commit ${{ steps.vars.outputs.pr_head }} -B build/candidate -- -sv -j1 --param optimization=speed ${{ steps.vars.outputs.benchmarks }}
81+
./libcxx/utils/test-at-commit --commit ${{ steps.vars.outputs.pr_head }} -B build/candidate -- -sv -j1 --param optimization=speed "$BENCHMARKS"
7882
./libcxx/utils/consolidate-benchmarks build/candidate | tee candidate.lnt
7983
8084
- name: Compare baseline and candidate runs

.github/workflows/pr-code-lint.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
run:
2121
shell: bash
2222
container:
23-
image: 'ghcr.io/llvm/ci-ubuntu-24.04:latest'
23+
image: 'ghcr.io/llvm/ci-ubuntu-24.04-lint'
2424
timeout-minutes: 60
2525
concurrency:
2626
group: ${{ github.workflow }}-${{ github.ref }}
@@ -31,6 +31,11 @@ jobs:
3131
with:
3232
fetch-depth: 2
3333

34+
# FIXME: same as in ".github/workflows/pr-code-format.yml"
35+
- name: Set Safe Directory
36+
run: |
37+
chown -R root $(pwd)
38+
3439
- name: Get changed files
3540
id: changed-files
3641
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
@@ -46,22 +51,6 @@ jobs:
4651
run: |
4752
echo "Changed files:"
4853
echo "$CHANGED_FILES"
49-
50-
# The clang tidy version should always be upgraded to the first version
51-
# of a release cycle (x.1.0) or the last version of a release cycle, or
52-
# if there have been relevant clang-format backports.
53-
- name: Install clang-tidy
54-
uses: aminya/setup-cpp@a276e6e3d1db9160db5edc458e99a30d3b109949 # v1.7.1
55-
with:
56-
clang-tidy: 21.1.0
57-
58-
- name: Setup Python env
59-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
60-
with:
61-
python-version: '3.13'
62-
63-
- name: Install Python dependencies
64-
run: python3 -m pip install -r llvm/utils/git/requirements_linting.txt
6554
6655
# TODO: create special mapping for 'codegen' targets, for now build predefined set
6756
# TODO: add entrypoint in 'compute_projects.py' that only adds a project and its direct dependencies

.github/workflows/premerge.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
with:
6363
fetch-depth: 2
6464
- name: Build and Test
65+
timeout-minutes: 120
6566
continue-on-error: ${{ runner.arch == 'ARM64' }}
6667
run: |
6768
git config --global --add safe.directory '*'
@@ -149,6 +150,7 @@ jobs:
149150
echo "windows-runtimes=${runtimes_to_build}" >> $GITHUB_OUTPUT
150151
echo "windows-runtimes-check-targets=${runtimes_check_targets}" >> $GITHUB_OUTPUT
151152
- name: Build and Test
153+
timeout-minutes: 180
152154
if: ${{ steps.vars.outputs.windows-projects != '' }}
153155
shell: cmd
154156
run: |
@@ -191,7 +193,7 @@ jobs:
191193
uses: llvm/actions/install-ninja@main
192194
- name: Build and Test
193195
run: |
194-
source <(git diff --name-only HEAD~2..HEAD | python3 .ci/compute_projects.py)
196+
source <(git diff --name-only HEAD~1...HEAD | python3 .ci/compute_projects.py)
195197
196198
if [[ "${projects_to_build}" == "" ]]; then
197199
echo "No projects to build"

.github/workflows/release-binaries.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ jobs:
5858
ref: ${{ steps.vars.outputs.ref }}
5959
upload: ${{ steps.vars.outputs.upload }}
6060
target-cmake-flags: ${{ steps.vars.outputs.target-cmake-flags }}
61-
ccache: ${{ steps.vars.outputs.ccache }}
6261
build-flang: ${{ steps.vars.outputs.build-flang }}
6362
release-binary-basename: ${{ steps.vars.outputs.release-binary-basename }}
6463
release-binary-filename: ${{ steps.vars.outputs.release-binary-filename }}
@@ -123,13 +122,6 @@ jobs:
123122
echo "release-binary-filename=$release_binary_basename.tar.xz" >> $GITHUB_OUTPUT
124123
125124
target="$RUNNER_OS-$RUNNER_ARCH"
126-
# The hendrikmuhs/ccache-action action does not support installing sccache
127-
# on arm64 Linux.
128-
if [ "$target" = "Linux-ARM64" ]; then
129-
echo ccache=ccache >> $GITHUB_OUTPUT
130-
else
131-
echo ccache=sccache >> $GITHUB_OUTPUT
132-
fi
133125
134126
# The macOS builds try to cross compile some libraries so we need to
135127
# add extra CMake args to disable them.
@@ -149,15 +141,12 @@ jobs:
149141
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_ARCHS=$arches -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_BUILTIN_ARCHS=$arches"
150142
fi
151143
152-
build_flang="true"
153-
154144
if [ "$RUNNER_OS" = "Windows" ]; then
155145
# The build times out on Windows, so we need to disable LTO.
156146
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF"
157147
fi
158148
159149
echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT
160-
echo "build-flang=$build_flang" >> $GITHUB_OUTPUT
161150
case "${{ inputs.runs-on }}" in
162151
ubuntu-22.04*)
163152
build_runs_on="depot-${{ inputs.runs-on }}-16"
@@ -222,15 +211,12 @@ jobs:
222211
- name: Configure
223212
id: build
224213
shell: bash
225-
env:
226-
CCACHE_BIN: ${{ needs.prepare.outputs.ccache }}
227214
run: |
228215
# There were some issues on the ARM64 MacOS runners with trying to build x86 object,
229216
# so we need to set some extra cmake flags to disable this.
230217
cmake -G Ninja -S llvm -B ${{ steps.setup-stage.outputs.build-prefix }}/build \
231218
${{ needs.prepare.outputs.target-cmake-flags }} \
232219
-C clang/cmake/caches/Release.cmake \
233-
-DBOOTSTRAP_LLVM_PARALLEL_LINK_JOBS=1 \
234220
-DBOOTSTRAP_BOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}"
235221
236222
- name: Build

.github/workflows/release-documentation.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ on:
2525
description: 'Upload documentation'
2626
required: false
2727
type: boolean
28+
secrets:
29+
WWW_RELEASES_TOKEN:
30+
description: "Secret used to create a PR with the documentation changes."
31+
required: false
2832

2933
jobs:
3034
release-documentation:

0 commit comments

Comments
 (0)