Skip to content

Commit 1a46be0

Browse files
authored
Merge branch 'main' into fix-alignment
2 parents 3b9a088 + c962234 commit 1a46be0

File tree

1,336 files changed

+47284
-26857
lines changed

Some content is hidden

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

1,336 files changed

+47284
-26857
lines changed

.ci/compute_projects.py

Lines changed: 1 addition & 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 = {

.ci/compute_projects_test.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,32 @@ def test_clang_windows(self):
126126
)
127127
self.assertEqual(env_variables["enable_cir"], "OFF")
128128

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+
129155
def test_cir(self):
130156
env_variables = compute_projects.get_env_variables(
131157
["clang/lib/CIR/CMakeLists.txt"], "Linux"

.ci/generate_test_report_lib.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,65 @@
1212
"https://github.com/llvm/llvm-project/issues and add the "
1313
"`infrastructure` label."
1414
)
15+
# The maximum number of lines to pull from a ninja failure.
16+
NINJA_LOG_SIZE_THRESHOLD = 500
17+
18+
19+
def _parse_ninja_log(ninja_log: list[str]) -> list[tuple[str, str]]:
20+
"""Parses an individual ninja log."""
21+
failures = []
22+
index = 0
23+
while index < len(ninja_log):
24+
while index < len(ninja_log) and not ninja_log[index].startswith("FAILED:"):
25+
index += 1
26+
if index == len(ninja_log):
27+
# We hit the end of the log without finding a build failure, go to
28+
# the next log.
29+
return failures
30+
# We are trying to parse cases like the following:
31+
#
32+
# [4/5] test/4.stamp
33+
# FAILED: touch test/4.stamp
34+
# touch test/4.stamp
35+
#
36+
# index will point to the line that starts with Failed:. The progress
37+
# indicator is the line before this ([4/5] test/4.stamp) and contains a pretty
38+
# printed version of the target being built (test/4.stamp). We use this line
39+
# and remove the progress information to get a succinct name for the target.
40+
failing_action = ninja_log[index - 1].split("] ")[1]
41+
failure_log = []
42+
while (
43+
index < len(ninja_log)
44+
and not ninja_log[index].startswith("[")
45+
and not ninja_log[index].startswith("ninja: build stopped:")
46+
and len(failure_log) < NINJA_LOG_SIZE_THRESHOLD
47+
):
48+
failure_log.append(ninja_log[index])
49+
index += 1
50+
failures.append((failing_action, "\n".join(failure_log)))
51+
return failures
52+
53+
54+
def find_failure_in_ninja_logs(ninja_logs: list[list[str]]) -> list[tuple[str, str]]:
55+
"""Extracts failure messages from ninja output.
56+
57+
This function takes stdout/stderr from ninja in the form of a list of files
58+
represented as a list of lines. This function then returns tuples containing
59+
the name of the target and the error message.
60+
61+
Args:
62+
ninja_logs: A list of files in the form of a list of lines representing the log
63+
files captured from ninja.
64+
65+
Returns:
66+
A list of tuples. The first string is the name of the target that failed. The
67+
second string is the error message.
68+
"""
69+
failures = []
70+
for ninja_log in ninja_logs:
71+
log_failures = _parse_ninja_log(ninja_log)
72+
failures.extend(log_failures)
73+
return failures
1574

1675

1776
# Set size_limit to limit the byte size of the report. The default is 1MB as this

.ci/generate_test_report_lib_test.py

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,111 @@ def junit_from_xml(xml):
1919

2020

2121
class TestReports(unittest.TestCase):
22+
def test_find_failure_ninja_logs(self):
23+
failures = generate_test_report_lib.find_failure_in_ninja_logs(
24+
[
25+
[
26+
"[1/5] test/1.stamp",
27+
"[2/5] test/2.stamp",
28+
"[3/5] test/3.stamp",
29+
"[4/5] test/4.stamp",
30+
"FAILED: touch test/4.stamp",
31+
"Wow! This system is really broken!",
32+
"[5/5] test/5.stamp",
33+
],
34+
]
35+
)
36+
self.assertEqual(len(failures), 1)
37+
self.assertEqual(
38+
failures[0],
39+
(
40+
"test/4.stamp",
41+
dedent(
42+
"""\
43+
FAILED: touch test/4.stamp
44+
Wow! This system is really broken!"""
45+
),
46+
),
47+
)
48+
49+
def test_no_failure_ninja_log(self):
50+
failures = generate_test_report_lib.find_failure_in_ninja_logs(
51+
[
52+
[
53+
"[1/3] test/1.stamp",
54+
"[2/3] test/2.stamp",
55+
"[3/3] test/3.stamp",
56+
]
57+
]
58+
)
59+
self.assertEqual(failures, [])
60+
61+
def test_ninja_log_end(self):
62+
failures = generate_test_report_lib.find_failure_in_ninja_logs(
63+
[
64+
[
65+
"[1/3] test/1.stamp",
66+
"[2/3] test/2.stamp",
67+
"[3/3] test/3.stamp",
68+
"FAILED: touch test/3.stamp",
69+
"Wow! This system is really broken!",
70+
"ninja: build stopped: subcommand failed.",
71+
]
72+
]
73+
)
74+
self.assertEqual(len(failures), 1)
75+
self.assertEqual(
76+
failures[0],
77+
(
78+
"test/3.stamp",
79+
dedent(
80+
"""\
81+
FAILED: touch test/3.stamp
82+
Wow! This system is really broken!"""
83+
),
84+
),
85+
)
86+
87+
def test_ninja_log_multiple_failures(self):
88+
failures = generate_test_report_lib.find_failure_in_ninja_logs(
89+
[
90+
[
91+
"[1/5] test/1.stamp",
92+
"[2/5] test/2.stamp",
93+
"FAILED: touch test/2.stamp",
94+
"Wow! This system is really broken!",
95+
"[3/5] test/3.stamp",
96+
"[4/5] test/4.stamp",
97+
"FAILED: touch test/4.stamp",
98+
"Wow! This system is maybe broken!",
99+
"[5/5] test/5.stamp",
100+
]
101+
]
102+
)
103+
self.assertEqual(len(failures), 2)
104+
self.assertEqual(
105+
failures[0],
106+
(
107+
"test/2.stamp",
108+
dedent(
109+
"""\
110+
FAILED: touch test/2.stamp
111+
Wow! This system is really broken!"""
112+
),
113+
),
114+
)
115+
self.assertEqual(
116+
failures[1],
117+
(
118+
"test/4.stamp",
119+
dedent(
120+
"""\
121+
FAILED: touch test/4.stamp
122+
Wow! This system is maybe broken!"""
123+
),
124+
),
125+
)
126+
22127
def test_title_only(self):
23128
self.assertEqual(
24129
generate_test_report_lib.generate_report("Foo", 0, []),

.ci/monolithic-linux.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ runtime_targets="${4}"
2929
runtime_targets_needs_reconfig="${5}"
3030
enable_cir="${6}"
3131

32-
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"
3333

3434
start-group "CMake"
3535
export PIP_BREAK_SYSTEM_PACKAGES=1
@@ -65,12 +65,12 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6565
start-group "ninja"
6666

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

7070
if [[ "${runtime_targets}" != "" ]]; then
7171
start-group "ninja Runtimes"
7272

73-
ninja -C "${BUILD_DIR}" ${runtime_targets}
73+
ninja -C "${BUILD_DIR}" ${runtime_targets} |& tee ninja_runtimes.log
7474
fi
7575

7676
# Compiling runtimes with just-built Clang and running their tests
@@ -85,7 +85,8 @@ if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
8585

8686
start-group "ninja Runtimes C++26"
8787

88-
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}
88+
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
89+
|& tee ninja_runtimes_needs_reconfig1.log
8990

9091
start-group "CMake Runtimes Clang Modules"
9192

@@ -96,5 +97,6 @@ if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then
9697

9798
start-group "ninja Runtimes Clang Modules"
9899

99-
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig}
100+
ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
101+
|& tee ninja_runtimes_needs_reconfig2.log
100102
fi

.ci/monolithic-windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
3939
-D LLVM_ENABLE_ASSERTIONS=ON \
4040
-D LLVM_BUILD_EXAMPLES=ON \
4141
-D COMPILER_RT_BUILD_LIBFUZZER=OFF \
42-
-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" \
4343
-D COMPILER_RT_BUILD_ORC=OFF \
4444
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
4545
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
@@ -51,4 +51,4 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
5151
start-group "ninja"
5252

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

.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"]'

.github/workflows/premerge.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ jobs:
3535
with:
3636
fetch-depth: 2
3737
- name: Build and Test
38-
# Mark the job as a success even if the step fails so that people do
39-
# not get notified while the new premerge pipeline is in an
40-
# experimental state.
4138
run: |
4239
git config --global --add safe.directory '*'
4340
@@ -109,9 +106,6 @@ jobs:
109106
echo "windows-projects=${projects_to_build}" >> $GITHUB_OUTPUT
110107
echo "windows-check-targets=${project_check_targets}" >> $GITHUB_OUTPUT
111108
- name: Build and Test
112-
# Mark the job as a success even if the step fails so that people do
113-
# not get notified while the new premerge pipeline is in an
114-
# experimental state.
115109
if: ${{ steps.vars.outputs.windows-projects != '' }}
116110
shell: cmd
117111
run: |

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,6 @@ class DataAggregator : public DataReader {
502502
/// entries).
503503
void imputeFallThroughs();
504504

505-
/// Register profiled functions for lite mode.
506-
void registerProfiledFunctions();
507-
508505
/// Debugging dump methods
509506
void dump() const;
510507
void dump(const PerfBranchSample &Sample) const;

0 commit comments

Comments
 (0)