Skip to content

Commit 098593b

Browse files
authored
Merge branch 'main' into elf/fix_65535err
2 parents cdb9f72 + a98295d commit 098593b

File tree

4,785 files changed

+437365
-60207
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,785 files changed

+437365
-60207
lines changed

.ci/monolithic-windows.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ runtimes_targets="${4}"
2323
start-group "CMake"
2424
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
2525

26-
export CC=cl
27-
export CXX=cl
26+
export CC=C:/clang/clang-msvc/bin/clang-cl.exe
27+
export CXX=C:/clang/clang-msvc/bin/clang-cl.exe
2828
export LD=link
2929

3030
# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
@@ -49,6 +49,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4949
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
5050
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
5151
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
52+
-D CMAKE_CXX_FLAGS="-Wno-c++98-compat -Wno-c++14-compat -Wno-unsafe-buffer-usage -Wno-old-style-cast" \
5253
-D LLVM_ENABLE_RUNTIMES="${runtimes}"
5354

5455
start-group "ninja"

.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/premerge_advisor_upload.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212

1313
import generate_test_report_lib
1414

15-
PREMERGE_ADVISOR_URL = (
16-
"http://premerge-advisor.premerge-advisor.svc.cluster.local:5000/upload"
17-
)
15+
# These are IP addresses of the two premerge advisor instances. They should
16+
# eventually be updated to domain names.
17+
PREMERGE_ADVISOR_URLS = [
18+
"http://34.82.126.63:5000/upload",
19+
"http://136.114.125.23:5000/upload",
20+
]
1821

1922

2023
def main(commit_sha, workflow_run_number, build_log_files):
@@ -41,7 +44,8 @@ def main(commit_sha, workflow_run_number, build_log_files):
4144
ninja_failures = generate_test_report_lib.find_failure_in_ninja_logs(ninja_logs)
4245
for name, failure_message in ninja_failures:
4346
failure_info["failures"].append({"name": name, "message": failure_message})
44-
requests.post(PREMERGE_ADVISOR_URL, json=failure_info)
47+
for premerge_advisor_url in PREMERGE_ADVISOR_URLS:
48+
requests.post(premerge_advisor_url, json=failure_info)
4549

4650

4751
if __name__ == "__main__":

.ci/utils.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,18 @@ function at-exit {
4040
fi
4141

4242
if [[ "$retcode" != "0" ]]; then
43-
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
44-
$(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \
45-
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
43+
if [[ "$GITHUB_ACTIONS" != "" ]]; then
44+
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_explain.py \
45+
$(git rev-parse HEAD~1) "${BUILD_DIR}"/test-results.*.xml \
46+
"${MONOREPO_ROOT}"/ninja*.log
47+
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
48+
$(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \
49+
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
50+
else
51+
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
52+
$(git rev-parse HEAD) $BUILDBOT_BUILDNUMBER \
53+
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
54+
fi
4655
fi
4756
}
4857
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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ RUN apt-get update && \
3737
apt-get clean && \
3838
rm -rf /var/lib/apt/lists/*
3939

40+
# Create a new user with id 1001 as that is the user id that
41+
# Github Actions uses to perform the checkout action.
42+
RUN useradd gha -u 1001 -m -s /bin/bash
43+
RUN adduser gha sudo
44+
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
45+
# Don't set USER gha right away because we still need to install packages
46+
# as root in 'ci-container-code-format' and 'ci-container-code-lint' containers
47+
4048

4149
FROM base AS ci-container-code-format
4250
ARG LLVM_VERSION
@@ -51,6 +59,8 @@ ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
5159
COPY llvm/utils/git/requirements_formatting.txt requirements_formatting.txt
5260
RUN pip install -r requirements_formatting.txt --break-system-packages && \
5361
rm requirements_formatting.txt
62+
USER gha
63+
WORKDIR /home/gha
5464

5565

5666
FROM base AS ci-container-code-lint
@@ -80,3 +90,5 @@ RUN apt-get update && \
8090
COPY llvm/utils/git/requirements_linting.txt requirements_linting.txt
8191
RUN pip install -r requirements_linting.txt --break-system-packages && \
8292
rm requirements_linting.txt
93+
USER gha
94+
WORKDIR /home/gha

.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-format.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ jobs:
2525
with:
2626
fetch-depth: 2
2727

28-
# We need to set the repo checkout as safe, otherwise tj-actions/changed-files
29-
# will fail due to the changed ownership inside the container.
30-
# TODO(boomanaiden154): We should probably fix this by having the default user
31-
# in the container have the same ID as the GHA user on the host.
32-
- name: Set Safe Directory
33-
run: |
34-
chown -R root $(pwd)
35-
3628
- name: Get changed files
3729
id: changed-files
3830
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5

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

Lines changed: 1 addition & 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 }}
@@ -46,22 +46,6 @@ jobs:
4646
run: |
4747
echo "Changed files:"
4848
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
6549
6650
# TODO: create special mapping for 'codegen' targets, for now build predefined set
6751
# TODO: add entrypoint in 'compute_projects.py' that only adds a project and its direct dependencies

0 commit comments

Comments
 (0)