Skip to content

Commit 00550f9

Browse files
committed
Merge remote-tracking branch 'upstream/users/kevinsala/omp-dyn-groupprivate-pr' into users/kevinsala/omp-dyn-groupprivate-codegen-pr
2 parents f66e5fa + 84fc963 commit 00550f9

File tree

16,362 files changed

+992585
-415680
lines changed

Some content is hidden

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

16,362 files changed

+992585
-415680
lines changed

.ci/compute_projects.py

Lines changed: 61 additions & 14 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"},
@@ -48,13 +49,13 @@
4849
"flang",
4950
},
5051
"lld": {"bolt", "cross-project-tests"},
51-
# TODO(issues/132795): LLDB should be enabled on clang changes.
52-
"clang": {"clang-tools-extra", "cross-project-tests"},
52+
"clang": {"clang-tools-extra", "cross-project-tests", "lldb"},
5353
"mlir": {"flang"},
5454
# Test everything if ci scripts are changed.
5555
".ci": {
5656
"llvm",
5757
"clang",
58+
"CIR",
5859
"lld",
5960
"lldb",
6061
"bolt",
@@ -78,6 +79,7 @@
7879
"clang": {"compiler-rt"},
7980
"clang-tools-extra": {"libc"},
8081
"libc": {"libc"},
82+
"compiler-rt": {"compiler-rt"},
8183
".ci": {"compiler-rt", "libc"},
8284
}
8385
DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = {
@@ -98,6 +100,9 @@
98100
"libc", # No Windows Support.
99101
"lldb", # TODO(issues/132800): Needs environment setup.
100102
"bolt", # No Windows Support.
103+
"libcxx",
104+
"libcxxabi",
105+
"libunwind",
101106
}
102107

103108
# These are projects that we should test if the project itself is changed but
@@ -116,6 +121,9 @@
116121
"lldb",
117122
"openmp",
118123
"polly",
124+
"libcxx",
125+
"libcxxabi",
126+
"libunwind",
119127
}
120128

121129
PROJECT_CHECK_TARGETS = {
@@ -128,6 +136,7 @@
128136
"lldb": "check-lldb",
129137
"llvm": "check-llvm",
130138
"clang": "check-clang",
139+
"CIR": "check-clang-cir",
131140
"bolt": "check-bolt",
132141
"lld": "check-lld",
133142
"flang": "check-flang",
@@ -141,6 +150,23 @@
141150

142151
RUNTIMES = {"libcxx", "libcxxabi", "libunwind", "compiler-rt", "libc"}
143152

153+
# Meta projects are projects that need explicit handling but do not reside
154+
# in their own top level folder. To add a meta project, the start of the path
155+
# for the metaproject should be mapped to the name of the project below.
156+
# Multiple paths can map to the same metaproject.
157+
META_PROJECTS = {
158+
("clang", "lib", "CIR"): "CIR",
159+
("clang", "test", "CIR"): "CIR",
160+
("clang", "include", "clang", "CIR"): "CIR",
161+
("*", "docs"): "docs",
162+
("llvm", "utils", "gn"): "gn",
163+
(".github", "workflows", "premerge.yaml"): ".ci",
164+
("third-party",): ".ci",
165+
}
166+
167+
# Projects that should not run any tests. These need to be metaprojects.
168+
SKIP_PROJECTS = ["docs", "gn"]
169+
144170

145171
def _add_dependencies(projects: Set[str], runtimes: Set[str]) -> Set[str]:
146172
projects_with_dependents = set(projects)
@@ -233,21 +259,34 @@ def _compute_runtimes_to_build(
233259
return _exclude_projects(runtimes_to_build, platform)
234260

235261

262+
def _path_matches(matcher: tuple[str], file_path: tuple[str]) -> bool:
263+
if len(file_path) < len(matcher):
264+
return False
265+
for match_part, file_part in zip(matcher, file_path):
266+
if match_part == "*" or file_part == "*":
267+
continue
268+
if match_part != file_part:
269+
return False
270+
return True
271+
272+
273+
def _get_modified_projects_for_file(modified_file: str) -> Set[str]:
274+
modified_projects = set()
275+
path_parts = pathlib.Path(modified_file).parts
276+
for meta_project_files in META_PROJECTS.keys():
277+
if _path_matches(meta_project_files, path_parts):
278+
meta_project = META_PROJECTS[meta_project_files]
279+
if meta_project in SKIP_PROJECTS:
280+
return set()
281+
modified_projects.add(meta_project)
282+
modified_projects.add(pathlib.Path(modified_file).parts[0])
283+
return modified_projects
284+
285+
236286
def _get_modified_projects(modified_files: list[str]) -> Set[str]:
237287
modified_projects = set()
238288
for modified_file in modified_files:
239-
path_parts = pathlib.Path(modified_file).parts
240-
# Exclude files in the docs directory. They do not impact an test
241-
# targets and there is a separate workflow used for ensuring the
242-
# documentation builds.
243-
if len(path_parts) > 2 and path_parts[1] == "docs":
244-
continue
245-
# Exclude files for the gn build. We do not test it within premerge
246-
# and changes occur often enough that they otherwise take up
247-
# capacity.
248-
if len(path_parts) > 3 and path_parts[:3] == ("llvm", "utils", "gn"):
249-
continue
250-
modified_projects.add(pathlib.Path(modified_file).parts[0])
289+
modified_projects.update(_get_modified_projects_for_file(modified_file))
251290
return modified_projects
252291

253292

@@ -267,6 +306,13 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
267306
runtimes_check_targets_needs_reconfig = _compute_project_check_targets(
268307
runtimes_to_test_needs_reconfig
269308
)
309+
310+
# CIR is used as a pseudo-project in this script. It is built as part of the
311+
# clang build, but it requires an explicit option to enable. We set that
312+
# option here, and remove it from the projects_to_build list.
313+
enable_cir = "ON" if "CIR" in projects_to_build else "OFF"
314+
projects_to_build.discard("CIR")
315+
270316
# We use a semicolon to separate the projects/runtimes as they get passed
271317
# to the CMake invocation and thus we need to use the CMake list separator
272318
# (;). We use spaces to separate the check targets as they end up getting
@@ -279,6 +325,7 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
279325
"runtimes_check_targets_needs_reconfig": " ".join(
280326
sorted(runtimes_check_targets_needs_reconfig)
281327
),
328+
"enable_cir": enable_cir,
282329
}
283330

284331

0 commit comments

Comments
 (0)