Skip to content

Commit 6ac764c

Browse files
committed
Rebase
Created using spr 1.3.5
2 parents dcd3e6b + 898bba3 commit 6ac764c

File tree

4,679 files changed

+179815
-88636
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,679 files changed

+179815
-88636
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +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
24+
sccache --zero-stats
2525

2626
mkdir -p artifacts/reproducers
2727

@@ -31,7 +31,7 @@ export CLANG_CRASH_DIAGNOSTICS_DIR=`realpath artifacts/reproducers`
3131
function at-exit {
3232
retcode=$?
3333

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

@@ -48,6 +48,7 @@ targets="${2}"
4848
runtimes="${3}"
4949
runtime_targets="${4}"
5050
runtime_targets_needs_reconfig="${5}"
51+
enable_cir="${6}"
5152

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

@@ -67,13 +68,15 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6768
-G Ninja \
6869
-D CMAKE_PREFIX_PATH="${HOME}/.local" \
6970
-D CMAKE_BUILD_TYPE=Release \
71+
-D CLANG_ENABLE_CIR=${enable_cir} \
7072
-D LLVM_ENABLE_ASSERTIONS=ON \
7173
-D LLVM_BUILD_EXAMPLES=ON \
7274
-D COMPILER_RT_BUILD_LIBFUZZER=OFF \
7375
-D LLVM_LIT_ARGS="${lit_args}" \
7476
-D LLVM_ENABLE_LLD=ON \
7577
-D CMAKE_CXX_FLAGS=-gmlt \
76-
-D LLVM_CCACHE_BUILD=ON \
78+
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
79+
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
7780
-D LIBCXX_CXX_ABI=libcxxabi \
7881
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
7982
-D LLDB_ENABLE_PYTHON=ON \

.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/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)