Skip to content

Commit 002b577

Browse files
feedback+rebase
Created using spr 1.3.6
2 parents 284f886 + b9c3284 commit 002b577

File tree

594 files changed

+38523
-8019
lines changed

Some content is hidden

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

594 files changed

+38523
-8019
lines changed

.ci/compute_projects.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"clang": {"compiler-rt"},
8181
"clang-tools-extra": {"libc"},
8282
"libc": {"libc"},
83+
"compiler-rt": {"compiler-rt"},
8384
".ci": {"compiler-rt", "libc"},
8485
}
8586
DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = {
@@ -100,6 +101,9 @@
100101
"libc", # No Windows Support.
101102
"lldb", # TODO(issues/132800): Needs environment setup.
102103
"bolt", # No Windows Support.
104+
"libcxx",
105+
"libcxxabi",
106+
"libunwind",
103107
}
104108

105109
# These are projects that we should test if the project itself is changed but
@@ -118,6 +122,9 @@
118122
"lldb",
119123
"openmp",
120124
"polly",
125+
"libcxx",
126+
"libcxxabi",
127+
"libunwind",
121128
}
122129

123130
PROJECT_CHECK_TARGETS = {

.ci/compute_projects_test.py

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ def test_llvm_windows(self):
4545
env_variables["project_check_targets"],
4646
"check-clang check-clang-tools check-lld check-llvm check-mlir check-polly",
4747
)
48-
self.assertEqual(
49-
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
50-
)
48+
self.assertEqual(env_variables["runtimes_to_build"], "")
5149
self.assertEqual(
5250
env_variables["runtimes_check_targets"],
5351
"",
5452
)
5553
self.assertEqual(
5654
env_variables["runtimes_check_targets_needs_reconfig"],
57-
"check-cxx check-cxxabi check-unwind",
55+
"",
5856
)
5957

6058
def test_llvm_mac(self):
@@ -69,16 +67,14 @@ def test_llvm_mac(self):
6967
env_variables["project_check_targets"],
7068
"check-clang check-clang-tools check-lld check-llvm check-mlir",
7169
)
72-
self.assertEqual(
73-
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
74-
)
70+
self.assertEqual(env_variables["runtimes_to_build"], "")
7571
self.assertEqual(
7672
env_variables["runtimes_check_targets"],
7773
"",
7874
)
7975
self.assertEqual(
8076
env_variables["runtimes_check_targets_needs_reconfig"],
81-
"check-cxx check-cxxabi check-unwind",
77+
"",
8278
)
8379

8480
def test_clang(self):
@@ -119,19 +115,43 @@ def test_clang_windows(self):
119115
self.assertEqual(
120116
env_variables["project_check_targets"], "check-clang check-clang-tools"
121117
)
122-
self.assertEqual(
123-
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
124-
)
118+
self.assertEqual(env_variables["runtimes_to_build"], "")
125119
self.assertEqual(
126120
env_variables["runtimes_check_targets"],
127121
"",
128122
)
129123
self.assertEqual(
130124
env_variables["runtimes_check_targets_needs_reconfig"],
131-
"check-cxx check-cxxabi check-unwind",
125+
"",
132126
)
133127
self.assertEqual(env_variables["enable_cir"], "OFF")
134128

129+
def test_compiler_rt(self):
130+
env_variables = compute_projects.get_env_variables(
131+
["compiler-rt/lib/asan/asan_allocator.cpp"], "Linux"
132+
)
133+
self.assertEqual(
134+
env_variables["projects_to_build"],
135+
"clang;lld",
136+
)
137+
self.assertEqual(
138+
env_variables["project_check_targets"],
139+
"",
140+
)
141+
self.assertEqual(env_variables["runtimes_to_build"], "compiler-rt")
142+
self.assertEqual(
143+
env_variables["runtimes_check_targets"],
144+
"check-compiler-rt",
145+
)
146+
self.assertEqual(
147+
env_variables["runtimes_check_targets_needs_reconfig"],
148+
"",
149+
)
150+
self.assertEqual(
151+
env_variables["enable_cir"],
152+
"OFF",
153+
)
154+
135155
def test_cir(self):
136156
env_variables = compute_projects.get_env_variables(
137157
["clang/lib/CIR/CMakeLists.txt"], "Linux"
@@ -298,18 +318,15 @@ def test_windows_ci(self):
298318
)
299319
self.assertEqual(
300320
env_variables["runtimes_to_build"],
301-
"libcxx;libcxxabi;libunwind",
321+
"",
302322
)
303323
self.assertEqual(
304324
env_variables["runtimes_check_targets"],
305325
"",
306326
)
307-
# TODO(boomanaiden154): We should not be emitting these on Windows.
308-
# It does not currently impact anything because we do not build the
309-
# runtimes on Windows though.
310327
self.assertEqual(
311328
env_variables["runtimes_check_targets_needs_reconfig"],
312-
"check-cxx check-cxxabi check-unwind",
329+
"",
313330
)
314331

315332
def test_lldb(self):

.ci/monolithic-linux.sh

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,58 +13,23 @@
1313
# run only the relevant tests.
1414
#
1515

16-
set -ex
17-
set -o pipefail
16+
source .ci/utils.sh
1817

19-
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
20-
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
2118
INSTALL_DIR="${BUILD_DIR}/install"
22-
rm -rf "${BUILD_DIR}"
23-
24-
sccache --zero-stats
2519

2620
mkdir -p artifacts/reproducers
2721

28-
# Make sure any clang reproducers will end up as artifacts.
22+
# Make sure any clang reproducers will end up as artifacts
2923
export CLANG_CRASH_DIAGNOSTICS_DIR=`realpath artifacts/reproducers`
3024

31-
function at-exit {
32-
retcode=$?
33-
34-
sccache --show-stats > artifacts/sccache_stats.txt
35-
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
36-
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
37-
38-
# If building fails there will be no results files.
39-
shopt -s nullglob
40-
41-
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
42-
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
43-
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
44-
fi
45-
}
46-
trap at-exit EXIT
47-
48-
function start-group {
49-
groupname=$1
50-
if [[ "$GITHUB_ACTIONS" != "" ]]; then
51-
echo "::endgroup"
52-
echo "::group::$groupname"
53-
elif [[ "$POSTCOMMIT_CI" != "" ]]; then
54-
echo "@@@$STEP@@@"
55-
else
56-
echo "Starting $groupname"
57-
fi
58-
}
59-
6025
projects="${1}"
6126
targets="${2}"
6227
runtimes="${3}"
6328
runtime_targets="${4}"
6429
runtime_targets_needs_reconfig="${5}"
6530
enable_cir="${6}"
6631

67-
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
32+
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests --succinct"
6833

6934
start-group "CMake"
7035
export PIP_BREAK_SYSTEM_PACKAGES=1
@@ -100,12 +65,12 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
10065
start-group "ninja"
10166

10267
# Targets are not escaped as they are passed as separate arguments.
103-
ninja -C "${BUILD_DIR}" -k 0 ${targets} | tee ninja.log
68+
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
10469

10570
if [[ "${runtime_targets}" != "" ]]; then
10671
start-group "ninja Runtimes"
10772

108-
ninja -C "${BUILD_DIR}" ${runtime_targets} | tee ninja_runtimes.log
73+
ninja -C "${BUILD_DIR}" ${runtime_targets} |& tee ninja_runtimes.log
10974
fi
11075

11176
# Compiling runtimes with just-built Clang and running their tests
@@ -121,7 +86,7 @@ if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
12186
start-group "ninja Runtimes C++26"
12287

12388
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
124-
| tee ninja_runtimes_needs_reconfig1.log
89+
|& tee ninja_runtimes_needs_reconfig1.log
12590

12691
start-group "CMake Runtimes Clang Modules"
12792

@@ -133,5 +98,5 @@ if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
13398
start-group "ninja Runtimes Clang Modules"
13499

135100
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
136-
| tee ninja_runtimes_needs_reconfig2.log
101+
|& tee ninja_runtimes_needs_reconfig2.log
137102
fi

.ci/monolithic-windows.sh

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,7 @@
1313
# run only the relevant tests.
1414
#
1515

16-
set -ex
17-
set -o pipefail
18-
19-
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
20-
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
21-
22-
rm -rf "${BUILD_DIR}"
23-
24-
sccache --zero-stats
25-
function at-exit {
26-
retcode=$?
27-
28-
mkdir -p artifacts
29-
sccache --show-stats >> artifacts/sccache_stats.txt
30-
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
31-
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
32-
33-
# If building fails there will be no results files.
34-
shopt -s nullglob
35-
36-
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
37-
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
38-
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
39-
fi
40-
}
41-
trap at-exit EXIT
42-
43-
function start-group {
44-
groupname=$1
45-
if [[ "$GITHUB_ACTIONS" != "" ]]; then
46-
echo "::endgroup"
47-
echo "::group::$groupname"
48-
elif [[ "$POSTCOMMIT_CI" != "" ]]; then
49-
echo "@@@$STEP@@@"
50-
else
51-
echo "Starting $groupname"
52-
fi
53-
}
16+
source .ci/utils.sh
5417

5518
projects="${1}"
5619
targets="${2}"
@@ -76,7 +39,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
7639
-D LLVM_ENABLE_ASSERTIONS=ON \
7740
-D LLVM_BUILD_EXAMPLES=ON \
7841
-D COMPILER_RT_BUILD_LIBFUZZER=OFF \
79-
-D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests" \
42+
-D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests --succinct" \
8043
-D COMPILER_RT_BUILD_ORC=OFF \
8144
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
8245
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
@@ -88,4 +51,4 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
8851
start-group "ninja"
8952

9053
# Targets are not escaped as they are passed as separate arguments.
91-
ninja -C "${BUILD_DIR}" -k 0 ${targets} | tee ninja.log
54+
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log

.ci/utils.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
#===----------------------------------------------------------------------===##
3+
#
4+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+
# See https://llvm.org/LICENSE.txt for license information.
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
#
8+
#===----------------------------------------------------------------------===##
9+
10+
# This script performs some setup and contains some utilities used for in the
11+
# monolithic-linux.sh and monolithic-windows.sh scripts.
12+
13+
set -ex
14+
set -o pipefail
15+
16+
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
17+
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
18+
19+
rm -rf "${BUILD_DIR}"
20+
21+
sccache --zero-stats
22+
23+
function at-exit {
24+
retcode=$?
25+
26+
mkdir -p artifacts
27+
sccache --show-stats >> artifacts/sccache_stats.txt
28+
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
29+
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
30+
31+
# If building fails there will be no results files.
32+
shopt -s nullglob
33+
34+
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
35+
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
36+
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
37+
fi
38+
}
39+
trap at-exit EXIT
40+
41+
function start-group {
42+
groupname=$1
43+
if [[ "$GITHUB_ACTIONS" != "" ]]; then
44+
echo "::endgroup"
45+
echo "::group::$groupname"
46+
elif [[ "$POSTCOMMIT_CI" != "" ]]; then
47+
echo "@@@$STEP@@@"
48+
else
49+
echo "Starting $groupname"
50+
fi
51+
}

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,6 @@ a3a007ad5fa20abc90ead4e1030b481bf109b4cf
143143
b7e332d3f59f567b1999fbcc660d7837cba8e406
144144
6056f942abe83b05406df8b04e95ec37a3d160b5
145145
906295b8a31c8dac5aa845864c0bca9f02f86184
146+
147+
# [mlir][tensor][linalg] Move Pack/UnPack Ops to Linalg
148+
517800e37e8d3a4ee84214bef65e227612c2a98b
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: MLIR SPIR-V Tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
pull_request:
9+
paths:
10+
- 'mlir/include/mlir/Dialect/SPIRV/**'
11+
- 'mlir/lib/Dialect/SPIRV/**'
12+
- 'mlir/include/mlir/Target/SPIRV/**'
13+
- 'mlir/lib/Target/SPIRV/**'
14+
- 'mlir/test/Target/SPIRV/**'
15+
- '.github/workflows/mlir-spirv-tests.yml'
16+
17+
concurrency:
18+
# Skip intermediate builds: always.
19+
# Cancel intermediate builds: only if it is a pull request build.
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
22+
23+
jobs:
24+
check_spirv:
25+
if: github.repository_owner == 'llvm'
26+
name: Test MLIR SPIR-V
27+
uses: ./.github/workflows/llvm-project-tests.yml
28+
with:
29+
build_target: check-mlir
30+
projects: mlir
31+
extra_cmake_args: '-DLLVM_TARGETS_TO_BUILD="host" -DLLVM_INCLUDE_SPIRV_TOOLS_TESTS=ON'
32+
os_list: '["ubuntu-24.04"]'

0 commit comments

Comments
 (0)