Skip to content

Commit fabcf69

Browse files
committed
Merge remote-tracking branch 'origin/main' into lv-find-min-max-index
2 parents 5b65693 + 4bf5ab4 commit fabcf69

File tree

2,662 files changed

+188838
-49032
lines changed

Some content is hidden

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

2,662 files changed

+188838
-49032
lines changed

.ci/all_requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ ml-dtypes==0.5.1 ; python_version < "3.13" \
194194
--hash=sha256:d13755f8e8445b3870114e5b6240facaa7cb0c3361e54beba3e07fa912a6e12b \
195195
--hash=sha256:fd918d4e6a4e0c110e2e05be7a7814d10dc1b95872accbf6512b80a109b71ae1
196196
# via -r mlir/python/requirements.txt
197+
nanobind==2.9.2 \
198+
--hash=sha256:c37957ffd5eac7eda349cff3622ecd32e5ee1244ecc912c99b5bc8188bafd16e \
199+
--hash=sha256:e7608472de99d375759814cab3e2c94aba3f9ec80e62cfef8ced495ca5c27d6e
200+
# via -r mlir/python/requirements.txt
197201
numpy==2.0.2 \
198202
--hash=sha256:0123ffdaa88fa4ab64835dcbde75dcdf89c453c922f18dced6e27c90d1d0ec5a \
199203
--hash=sha256:11a76c372d1d37437857280aa142086476136a8c0f373b2e648ab2c8f18fb195 \
@@ -295,6 +299,10 @@ pyasn1-modules==0.4.2 \
295299
--hash=sha256:29253a9207ce32b64c3ac6600edc75368f98473906e8fd1043bd6b5b1de2c14a \
296300
--hash=sha256:677091de870a80aae844b1ca6134f54652fa2c8c5a52aa396440ac3106e941e6
297301
# via google-auth
302+
pybind11==2.13.6 \
303+
--hash=sha256:237c41e29157b962835d356b370ededd57594a26d5894a795960f0047cb5caf5 \
304+
--hash=sha256:ba6af10348c12b24e92fa086b39cfba0eff619b61ac77c406167d813b096d39a
305+
# via -r mlir/python/requirements.txt
298306
pyyaml==6.0.1 \
299307
--hash=sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5 \
300308
--hash=sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc \

.ci/cache_lit_timing_files.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import glob
1818

1919
from google.cloud import storage
20+
from google.api_core import exceptions
2021

2122
GCS_PARALLELISM = 100
2223

@@ -50,7 +51,14 @@ def _maybe_download_timing_file(blob):
5051

5152
def download_timing_files(storage_client, bucket_name: str):
5253
bucket = storage_client.bucket(bucket_name)
53-
blobs = bucket.list_blobs(prefix="lit_timing")
54+
try:
55+
blobs = bucket.list_blobs(prefix="lit_timing")
56+
except exceptions.ClientError as client_error:
57+
print(
58+
"::warning file=cache_lit_timing_files.py::Failed to list blobs "
59+
"in bucket."
60+
)
61+
sys.exit(0)
5462
with multiprocessing.pool.ThreadPool(GCS_PARALLELISM) as thread_pool:
5563
futures = []
5664
for timing_file_blob in blobs:
@@ -60,7 +68,13 @@ def download_timing_files(storage_client, bucket_name: str):
6068
)
6169
)
6270
for future in futures:
63-
future.get()
71+
future.wait()
72+
if not future.successful():
73+
print(
74+
"::warning file=cache_lit_timing_files.py::Failed to "
75+
"download lit timing file."
76+
)
77+
continue
6478
print("Done downloading")
6579

6680

.ci/generate_test_report_github.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88

99
import generate_test_report_lib
1010

11-
PLATFORM_TITLES = {
12-
"Windows": ":window: Windows x64 Test Results",
13-
"Linux": ":penguin: Linux x64 Test Results",
14-
}
11+
def compute_platform_title() -> str:
12+
logo = ":window:" if platform.system() == "Windows" else ":penguin:"
13+
# On Linux the machine value is x86_64 on Windows it is AMD64.
14+
if platform.machine() == "x86_64" or platform.machine() == "AMD64":
15+
arch = "x64"
16+
else:
17+
arch = platform.machine()
18+
return f"{logo} {platform.system()} {arch} Test Results"
19+
1520

1621
if __name__ == "__main__":
1722
parser = argparse.ArgumentParser()
@@ -22,7 +27,7 @@
2227
args = parser.parse_args()
2328

2429
report = generate_test_report_lib.generate_report_from_files(
25-
PLATFORM_TITLES[platform.system()], args.return_code, args.build_test_logs
30+
compute_platform_title(), args.return_code, args.build_test_logs
2631
)
2732

2833
print(report)

.ci/utils.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function start-group {
5656
export PIP_BREAK_SYSTEM_PACKAGES=1
5757
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
5858

59-
if [[ "$GITHUB_ACTIONS" != "" ]]; then
59+
# The ARM64 builders run on AWS and don't have access to the GCS cache.
60+
if [[ "$GITHUB_ACTIONS" != "" ]] && [[ "$RUNNER_ARCH" != "ARM64" ]]; then
6061
python .ci/cache_lit_timing_files.py download
6162
fi

.github/new-prs-labeler.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,12 @@ mlgo:
722722
- llvm/include/llvm/Analysis/IR2Vec.h
723723
- llvm/lib/Analysis/IR2Vec.cpp
724724
- llvm/lib/Analysis/models/**
725+
- llvm/include/llvm/CodeGen/MIR2Vec.h
726+
- llvm/lib/CodeGen/MIR2Vec.cpp
725727
- llvm/test/Analysis/IR2Vec/**
728+
- llvm/test/CodeGen/MIR2Vec/**
729+
- llvm/unittests/Analysis/IR2VecTest.cpp
730+
- llvm/unittests/CodeGen/MIR2VecTest.cpp
726731
- llvm/tools/llvm-ir2vec/**
727732
- llvm/docs/CommandGuide/llvm-ir2vec.rst
728733

@@ -1091,8 +1096,8 @@ clang:openmp:
10911096
- llvm/test/Transforms/OpenMP/**
10921097

10931098
clang:temporal-safety:
1094-
- clang/include/clang/Analysis/Analyses/LifetimeSafety*
1095-
- clang/lib/Analysis/LifetimeSafety*
1099+
- clang/include/clang/Analysis/Analyses/LifetimeSafety/**
1100+
- clang/lib/Analysis/LifetimeSafety/**
10961101
- clang/unittests/Analysis/LifetimeSafety*
10971102
- clang/test/Sema/*lifetime-safety*
10981103
- clang/test/Sema/*lifetime-analysis*
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Build CI Tooling Containers
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- .github/workflows/build-ci-container-tooling.yml
12+
- '.github/workflows/containers/github-action-ci-tooling/**'
13+
- llvm/utils/git/requirements_formatting.txt
14+
- llvm/utils/git/requirements_linting.txt
15+
pull_request:
16+
paths:
17+
- .github/workflows/build-ci-container-tooling.yml
18+
- '.github/workflows/containers/github-action-ci-tooling/**'
19+
- llvm/utils/git/requirements_formatting.txt
20+
- llvm/utils/git/requirements_linting.txt
21+
22+
jobs:
23+
build-ci-container-tooling:
24+
if: github.repository_owner == 'llvm'
25+
runs-on: ubuntu-24.04
26+
steps:
27+
- name: Checkout LLVM
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
with:
30+
sparse-checkout: |
31+
.github/workflows/containers/github-action-ci-tooling/
32+
llvm/utils/git/requirements_formatting.txt
33+
llvm/utils/git/requirements_linting.txt
34+
clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
35+
36+
- name: Write Variables
37+
id: vars
38+
run: |
39+
tag=$(git rev-parse --short=12 HEAD)
40+
container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/amd64/ci-ubuntu-24.04"
41+
echo "container-name-format=$container_name-code-format" >> $GITHUB_OUTPUT
42+
echo "container-name-lint=$container_name-code-lint" >> $GITHUB_OUTPUT
43+
echo "container-name-format-tag=$container_name-format:$tag" >> $GITHUB_OUTPUT
44+
echo "container-name-lint-tag=$container_name-lint:$tag" >> $GITHUB_OUTPUT
45+
echo "container-format-filename=$(echo $container_name-format:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
46+
echo "container-lint-filename=$(echo $container_name-lint:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT
47+
48+
- name: Build container
49+
run: |
50+
podman build --target ci-container-code-format \
51+
-f .github/workflows/containers/github-action-ci-tooling/Dockerfile \
52+
-t ${{ steps.vars.outputs.container-name-format-tag }} .
53+
podman build --target ci-container-code-lint \
54+
-f .github/workflows/containers/github-action-ci-tooling/Dockerfile \
55+
-t ${{ steps.vars.outputs.container-name-lint-tag }} .
56+
57+
# Save the container so we have it in case the push fails. This also
58+
# allows us to separate the push step into a different job so we can
59+
# maintain minimal permissions while building the container.
60+
- name: Save container image
61+
run: |
62+
podman save ${{ steps.vars.outputs.container-name-format-tag }} > ${{ steps.vars.outputs.container-format-filename }}
63+
podman save ${{ steps.vars.outputs.container-name-lint-tag }} > ${{ steps.vars.outputs.container-lint-filename }}
64+
65+
- name: Upload container image
66+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
67+
with:
68+
name: container-amd64
69+
path: "*.tar"
70+
retention-days: 14
71+
72+
- name: Test Container
73+
run: |
74+
# Use --pull=never to ensure we are testing the just built image.
75+
podman run --pull=never --rm -it ${{ steps.vars.outputs.container-name-format-tag }} /usr/bin/bash -x -c 'cd $HOME && clang-format --version | grep version && git-clang-format -h | grep usage && black --version | grep black'
76+
podman run --pull=never --rm -it ${{ steps.vars.outputs.container-name-lint-tag }} /usr/bin/bash -x -c 'cd $HOME && clang-tidy --version | grep version && clang-tidy-diff.py -h | grep usage'
77+
78+
push-ci-container:
79+
if: github.event_name == 'push'
80+
needs:
81+
- build-ci-container-tooling
82+
permissions:
83+
packages: write
84+
runs-on: ubuntu-24.04
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
steps:
88+
- name: Download container
89+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
90+
91+
- name: Push Container
92+
run: |
93+
function push_container {
94+
image_name=$1
95+
latest_name=$(echo $image_name | sed 's/:[a-f0-9]\+$/:latest/g')
96+
podman tag $image_name $latest_name
97+
echo "Pushing $image_name ..."
98+
podman push $image_name
99+
echo "Pushing $latest_name ..."
100+
podman push $latest_name
101+
}
102+
103+
podman login -u ${{ github.actor }} -p $GITHUB_TOKEN ghcr.io
104+
for f in $(find . -iname '*.tar'); do
105+
image_name=$(podman load -q -i $f | sed 's/Loaded image: //g')
106+
push_container $image_name
107+
108+
if echo $image_name | grep '/amd64/'; then
109+
# For amd64, create an alias with the arch component removed.
110+
# This matches the convention used on dockerhub.
111+
default_image_name=$(echo $(dirname $(dirname $image_name))/$(basename $image_name))
112+
podman tag $image_name $default_image_name
113+
push_container $default_image_name
114+
fi
115+
done

.github/workflows/build-ci-container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
}
104104
105105
podman login -u ${{ github.actor }} -p $GITHUB_TOKEN ghcr.io
106-
for f in $(find . -iname *.tar); do
106+
for f in $(find . -iname '*.tar'); do
107107
image_name=$(podman load -q -i $f | sed 's/Loaded image: //g')
108108
push_container $image_name
109109
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
ARG LLVM_VERSION=21.1.0
2+
3+
FROM docker.io/library/ubuntu:24.04 AS llvm-downloader
4+
ARG LLVM_VERSION
5+
6+
RUN apt-get update && \
7+
apt-get install -y wget xz-utils && \
8+
wget -O llvm.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/LLVM-${LLVM_VERSION}-Linux-X64.tar.xz && \
9+
mkdir -p /llvm-extract && \
10+
tar -xvJf llvm.tar.xz -C /llvm-extract \
11+
# Only unpack these tools to save space on Github runner.
12+
LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-tidy \
13+
LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-format \
14+
LLVM-${LLVM_VERSION}-Linux-X64/bin/git-clang-format && \
15+
rm llvm.tar.xz
16+
17+
18+
FROM docker.io/library/ubuntu:24.04 AS base
19+
ENV LLVM_SYSROOT=/opt/llvm
20+
21+
# Need nodejs for some of the GitHub actions.
22+
# Need git for git-clang-format.
23+
RUN apt-get update && \
24+
DEBIAN_FRONTEND=noninteractive apt-get install -y \
25+
git \
26+
nodejs \
27+
sudo \
28+
# These are needed by the premerge pipeline.
29+
# Pip is used to install dependent python packages.
30+
python3-pip \
31+
python-is-python3 && \
32+
apt-get clean && \
33+
rm -rf /var/lib/apt/lists/*
34+
35+
36+
FROM base AS ci-container-code-format
37+
ARG LLVM_VERSION
38+
39+
COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-format \
40+
/llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/git-clang-format \
41+
${LLVM_SYSROOT}/bin/
42+
43+
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
44+
45+
# Install dependencies for 'pr-code-format.yml' job
46+
COPY llvm/utils/git/requirements_formatting.txt requirements_formatting.txt
47+
RUN pip install -r requirements_formatting.txt --break-system-packages && \
48+
rm requirements_formatting.txt
49+
50+
51+
FROM base AS ci-container-code-lint
52+
ARG LLVM_VERSION
53+
54+
COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-tidy ${LLVM_SYSROOT}/bin/
55+
COPY clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py ${LLVM_SYSROOT}/bin/clang-tidy-diff.py
56+
57+
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
58+
59+
# Install dependencies for 'pr-code-lint.yml' job
60+
COPY llvm/utils/git/requirements_linting.txt requirements_linting.txt
61+
RUN pip install -r requirements_linting.txt --break-system-packages && \
62+
rm requirements_linting.txt

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ RUN apt-get update && \
6262
# Having a symlink from python to python3 enables code sharing between
6363
# the Linux and Windows pipelines.
6464
python3-pip \
65-
python3-venv \
6665
file \
6766
tzdata \
6867
python-is-python3 && \

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ jobs:
236236
**/crash_diagnostics/*
237237
238238
windows:
239-
runs-on: windows-2022
240239
needs: [ stage2 ]
241240
strategy:
242241
fail-fast: false
@@ -251,6 +250,8 @@ jobs:
251250
- { config: mingw-static, mingw: true }
252251
- { config: mingw-dll-i686, mingw: true }
253252
- { config: mingw-incomplete-sysroot, mingw: true }
253+
- { config: mingw-static, mingw: true, runner: windows-11-arm }
254+
runs-on: ${{ matrix.runner != '' && matrix.runner || 'windows-2022' }}
254255
steps:
255256
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
256257
- name: Install dependencies
@@ -263,7 +264,7 @@ jobs:
263264
- name: Install llvm-mingw
264265
if: ${{ matrix.mingw == true }}
265266
run: |
266-
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250709/llvm-mingw-20250709-ucrt-x86_64.zip
267+
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250709/llvm-mingw-20250709-ucrt-${{ matrix.runner == 'windows-11-arm' && 'aarch64' || 'x86_64' }}.zip
267268
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
268269
del llvm-mingw*.zip
269270
mv llvm-mingw* c:\llvm-mingw

0 commit comments

Comments
 (0)