Skip to content

Commit 82b951e

Browse files
committed
Merge branch 'main' into xegpu-refactor-tests
2 parents f7194b8 + ce52f9c commit 82b951e

File tree

4,847 files changed

+203515
-95521
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,847 files changed

+203515
-95521
lines changed

.ci/compute_projects.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
PROJECT_DEPENDENCIES = {
2020
"llvm": set(),
2121
"clang": {"llvm"},
22+
"CIR": {"clang", "mlir"},
2223
"bolt": {"clang", "lld", "llvm"},
2324
"clang-tools-extra": {"clang", "llvm"},
2425
"compiler-rt": {"clang", "lld"},
@@ -55,6 +56,7 @@
5556
".ci": {
5657
"llvm",
5758
"clang",
59+
"CIR",
5860
"lld",
5961
"lldb",
6062
"bolt",
@@ -128,6 +130,7 @@
128130
"lldb": "check-lldb",
129131
"llvm": "check-llvm",
130132
"clang": "check-clang",
133+
"CIR": "check-clang-cir",
131134
"bolt": "check-bolt",
132135
"lld": "check-lld",
133136
"flang": "check-flang",
@@ -247,6 +250,14 @@ def _get_modified_projects(modified_files: list[str]) -> Set[str]:
247250
# capacity.
248251
if len(path_parts) > 3 and path_parts[:3] == ("llvm", "utils", "gn"):
249252
continue
253+
# If the file is in the clang/lib/CIR directory, add the CIR project.
254+
if len(path_parts) > 3 and (
255+
path_parts[:3] == ("clang", "lib", "CIR")
256+
or path_parts[:3] == ("clang", "test", "CIR")
257+
or path_parts[:4] == ("clang", "include", "clang", "CIR")
258+
):
259+
modified_projects.add("CIR")
260+
# Fall through to add clang.
250261
modified_projects.add(pathlib.Path(modified_file).parts[0])
251262
return modified_projects
252263

@@ -267,6 +278,13 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
267278
runtimes_check_targets_needs_reconfig = _compute_project_check_targets(
268279
runtimes_to_test_needs_reconfig
269280
)
281+
282+
# CIR is used as a pseudo-project in this script. It is built as part of the
283+
# clang build, but it requires an explicit option to enable. We set that
284+
# option here, and remove it from the projects_to_build list.
285+
enable_cir = "ON" if "CIR" in projects_to_build else "OFF"
286+
projects_to_build.discard("CIR")
287+
270288
# We use a semicolon to separate the projects/runtimes as they get passed
271289
# to the CMake invocation and thus we need to use the CMake list separator
272290
# (;). We use spaces to separate the check targets as they end up getting
@@ -279,6 +297,7 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
279297
"runtimes_check_targets_needs_reconfig": " ".join(
280298
sorted(runtimes_check_targets_needs_reconfig)
281299
),
300+
"enable_cir": enable_cir,
282301
}
283302

284303

.ci/compute_projects_test.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ def test_clang(self):
104104
env_variables["runtimes_check_targets_needs_reconfig"],
105105
"check-cxx check-cxxabi check-unwind",
106106
)
107+
self.assertEqual(
108+
env_variables["enable_cir"],
109+
"OFF",
110+
)
107111

108112
def test_clang_windows(self):
109113
env_variables = compute_projects.get_env_variables(
@@ -126,6 +130,32 @@ def test_clang_windows(self):
126130
env_variables["runtimes_check_targets_needs_reconfig"],
127131
"check-cxx check-cxxabi check-unwind",
128132
)
133+
self.assertEqual(env_variables["enable_cir"], "OFF")
134+
135+
def test_cir(self):
136+
env_variables = compute_projects.get_env_variables(
137+
["clang/lib/CIR/CMakeLists.txt"], "Linux"
138+
)
139+
self.assertEqual(
140+
env_variables["projects_to_build"],
141+
"clang;clang-tools-extra;lld;llvm;mlir",
142+
)
143+
self.assertEqual(
144+
env_variables["project_check_targets"],
145+
"check-clang check-clang-cir check-clang-tools",
146+
)
147+
self.assertEqual(
148+
env_variables["runtimes_to_build"], "compiler-rt;libcxx;libcxxabi;libunwind"
149+
)
150+
self.assertEqual(
151+
env_variables["runtimes_check_targets"],
152+
"check-compiler-rt",
153+
)
154+
self.assertEqual(
155+
env_variables["runtimes_check_targets_needs_reconfig"],
156+
"check-cxx check-cxxabi check-unwind",
157+
)
158+
self.assertEqual(env_variables["enable_cir"], "ON")
129159

130160
def test_bolt(self):
131161
env_variables = compute_projects.get_env_variables(
@@ -158,6 +188,7 @@ def test_mlir(self):
158188
self.assertEqual(env_variables["runtimes_to_build"], "")
159189
self.assertEqual(env_variables["runtimes_check_targets"], "")
160190
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
191+
self.assertEqual(env_variables["enable_cir"], "OFF")
161192

162193
def test_flang(self):
163194
env_variables = compute_projects.get_env_variables(
@@ -168,6 +199,7 @@ def test_flang(self):
168199
self.assertEqual(env_variables["runtimes_to_build"], "")
169200
self.assertEqual(env_variables["runtimes_check_targets"], "")
170201
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
202+
self.assertEqual(env_variables["enable_cir"], "OFF")
171203

172204
def test_invalid_subproject(self):
173205
env_variables = compute_projects.get_env_variables(
@@ -237,7 +269,7 @@ def test_ci(self):
237269
)
238270
self.assertEqual(
239271
env_variables["project_check_targets"],
240-
"check-bolt check-clang check-clang-tools check-flang check-lld check-lldb check-llvm check-mlir check-polly",
272+
"check-bolt check-clang check-clang-cir check-clang-tools check-flang check-lld check-lldb check-llvm check-mlir check-polly",
241273
)
242274
self.assertEqual(
243275
env_variables["runtimes_to_build"],

.ci/monolithic-linux.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@ BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
2121
INSTALL_DIR="${BUILD_DIR}/install"
2222
rm -rf "${BUILD_DIR}"
2323

24-
ccache --zero-stats
25-
26-
if [[ -n "${CLEAR_CACHE:-}" ]]; then
27-
echo "clearing cache"
28-
ccache --clear
29-
fi
24+
sccache --zero-stats
3025

3126
mkdir -p artifacts/reproducers
3227

@@ -36,7 +31,7 @@ export CLANG_CRASH_DIAGNOSTICS_DIR=`realpath artifacts/reproducers`
3631
function at-exit {
3732
retcode=$?
3833

39-
ccache --print-stats > artifacts/ccache_stats.txt
34+
sccache --show-stats > artifacts/sccache_stats.txt
4035
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
4136
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
4237

@@ -53,6 +48,7 @@ targets="${2}"
5348
runtimes="${3}"
5449
runtime_targets="${4}"
5550
runtime_targets_needs_reconfig="${5}"
51+
enable_cir="${6}"
5652

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

@@ -72,13 +68,15 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
7268
-G Ninja \
7369
-D CMAKE_PREFIX_PATH="${HOME}/.local" \
7470
-D CMAKE_BUILD_TYPE=Release \
71+
-D CLANG_ENABLE_CIR=${enable_cir} \
7572
-D LLVM_ENABLE_ASSERTIONS=ON \
7673
-D LLVM_BUILD_EXAMPLES=ON \
7774
-D COMPILER_RT_BUILD_LIBFUZZER=OFF \
7875
-D LLVM_LIT_ARGS="${lit_args}" \
7976
-D LLVM_ENABLE_LLD=ON \
8077
-D CMAKE_CXX_FLAGS=-gmlt \
81-
-D LLVM_CCACHE_BUILD=ON \
78+
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
79+
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
8280
-D LIBCXX_CXX_ABI=libcxxabi \
8381
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
8482
-D LLDB_ENABLE_PYTHON=ON \

.ci/monolithic-windows.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
2121

2222
rm -rf "${BUILD_DIR}"
2323

24-
if [[ -n "${CLEAR_CACHE:-}" ]]; then
25-
echo "clearing sccache"
26-
rm -rf "$SCCACHE_DIR"
27-
fi
28-
2924
sccache --zero-stats
3025
function at-exit {
3126
retcode=$?

.github/new-prs-labeler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ flang:frontend:
4848
- flang/Evaluate/**/*
4949
- flang/Semantics/**/*
5050

51+
libclc:
52+
- libclc/**
53+
5154
HLSL:
5255
- clang/*HLSL*/**/*
5356
- clang/**/*HLSL*
@@ -717,6 +720,8 @@ mlgo:
717720
- llvm/lib/Analysis/IR2Vec.cpp
718721
- llvm/lib/Analysis/models/**
719722
- llvm/test/Analysis/IR2Vec/**
723+
- llvm/tools/llvm-ir2vec/**
724+
- llvm/docs/CommandGuide/llvm-ir2vec.rst
720725

721726
tools:llvm-exegesis:
722727
- llvm/tools/llvm-exegesis/**

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ on:
1111
- .github/workflows/build-ci-container-windows.yml
1212
- '.github/workflows/containers/github-action-ci-windows/**'
1313
pull_request:
14-
branches:
15-
- main
1614
paths:
1715
- .github/workflows/build-ci-container-windows.yml
1816
- '.github/workflows/containers/github-action-ci-windows/**'

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ on:
1111
- .github/workflows/build-ci-container.yml
1212
- '.github/workflows/containers/github-action-ci/**'
1313
pull_request:
14-
branches:
15-
- main
1614
paths:
1715
- .github/workflows/build-ci-container.yml
1816
- '.github/workflows/containers/github-action-ci/**'

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,21 @@ RUN apt-get update && \
6363
python3-pip \
6464
ccache \
6565
file \
66-
tzdata \
67-
sccache && \
66+
tzdata && \
6867
apt-get clean && \
6968
rm -rf /var/lib/apt/lists/*
7069

70+
# We need sccache for caching. We cannot use the apt repository version because
71+
# it is too old and has bugs related to features we require (particularly GCS
72+
# caching), so we manually install it here.
73+
# TODO(boomanaiden154): We should return to installing this from the apt
74+
# repository once a version containing the necessary bug fixes is available.
75+
RUN curl -L 'https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz' > /tmp/sccache.tar.gz && \
76+
echo "1fbb35e135660d04a2d5e42b59c7874d39b3deb17de56330b25b713ec59f849b /tmp/sccache.tar.gz" | sha256sum -c && \
77+
tar xzf /tmp/sccache.tar.gz -O --wildcards '*/sccache' > '/usr/local/bin/sccache' && \
78+
rm /tmp/sccache.tar.gz && \
79+
chmod +x /usr/local/bin/sccache
80+
7181
ENV LLVM_SYSROOT=$LLVM_SYSROOT
7282
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
7383

.github/workflows/email-check.yaml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,14 @@ jobs:
2020

2121
- name: Extract author email
2222
id: author
23-
env:
24-
GH_TOKEN: ${{ github.token }}
2523
run: |
26-
# Use Github GraphQL APIs to get the email associated with the PR author because this takes into account the GitHub settings for email privacy.
27-
query='
28-
query($login: String!) {
29-
user(login: $login) {
30-
email
31-
}
32-
}'
33-
34-
PR_AUTHOR=${{ github.event.pull_request.user.login }}
35-
36-
email=$(gh api graphql -f login="$PR_AUTHOR" -f query="$query" --jq '.data.user.email')
37-
echo "EMAIL_AUTHOR_GH_UI=$email" >> "$GITHUB_OUTPUT"
38-
24+
git log -1
25+
echo "EMAIL=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT
3926
# Create empty comment file
4027
echo "[]" > comments
4128
42-
# When EMAIL_AUTHOR_GH_UI is NULL, author's email is hidden in GitHub UI.
43-
# In this case, we warn the user to turn off "Keep my email addresses private"
44-
# setting in their account.
4529
- name: Validate author email
46-
if: ${{ steps.author.outputs.EMAIL_AUTHOR_GH_UI == '' }}
30+
if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') }}
4731
env:
4832
COMMENT: >-
4933
⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>

.github/workflows/premerge.yaml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ jobs:
3434
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3535
with:
3636
fetch-depth: 2
37-
- name: Setup ccache
38-
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
39-
with:
40-
max-size: "2000M"
4137
- name: Build and Test
4238
# Mark the job as a success even if the step fails so that people do
4339
# not get notified while the new premerge pipeline is in an
@@ -61,7 +57,14 @@ jobs:
6157
export CC=/opt/llvm/bin/clang
6258
export CXX=/opt/llvm/bin/clang++
6359
64-
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}" "${runtimes_check_targets_needs_reconfig}"
60+
# This environment variable is passes into the container through the
61+
# runner pod definition. This differs between our two clusters which
62+
# why we do not hardcode it.
63+
export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET
64+
export SCCACHE_GCS_RW_MODE=READ_WRITE
65+
sccache --start-server
66+
67+
./.ci/monolithic-linux.sh "${projects_to_build}" "${project_check_targets}" "${runtimes_to_build}" "${runtimes_check_targets}" "${runtimes_check_targets_needs_reconfig}" "${enable_cir}"
6568
- name: Upload Artifacts
6669
if: '!cancelled()'
6770
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
@@ -85,11 +88,6 @@ jobs:
8588
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8689
with:
8790
fetch-depth: 2
88-
- name: Setup ccache
89-
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
90-
with:
91-
variant: "sccache"
92-
max-size: "2000M"
9391
- name: Compute Projects
9492
id: vars
9593
run: |
@@ -112,7 +110,7 @@ jobs:
112110
shell: cmd
113111
run: |
114112
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
115-
bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}"
113+
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\""
116114
- name: Upload Artifacts
117115
if: '!cancelled()'
118116
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0

0 commit comments

Comments
 (0)