[Openmp-commits] [llvm] [openmp] [CI] Enable OpenMP and Offload runtime in premerge (PR #174955)

Jan Patrick Lehr via Openmp-commits openmp-commits at lists.llvm.org
Wed Mar 11 04:56:14 PDT 2026


https://github.com/jplehr updated https://github.com/llvm/llvm-project/pull/174955

>From d43e6c0d487d249532d38ff77225a67f3126f309 Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Thu, 8 Jan 2026 05:55:56 -0600
Subject: [PATCH 1/7] [CI][Offload][OpenMP] Enable OpenMP and Offload runtime

Offload and OpenMP have been disabled in pre-commit build and test for
quite some time. Recently, some CMake changes were made and the build
command in premerge testing seems to have changed.

This PR enables the build of OpenMP and Offload in premerge CI. It
should not run tests, given community feedback about the reliability of
the test suites.
---
 .ci/compute_projects.py      | 29 ++++++++++++++++++++++-------
 .ci/compute_projects_test.py | 22 +++++++++++++---------
 2 files changed, 35 insertions(+), 16 deletions(-)

diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 541b33f5034b1..4b0b758af2658 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -24,7 +24,6 @@
     "clang-tools-extra": {"clang", "llvm"},
     "compiler-rt": {"clang", "lld"},
     "libc": {"clang", "lld"},
-    "openmp": {"clang", "lld"},
     "flang": {"llvm", "clang"},
     "flang-rt": {"flang"},
     "lldb": {"llvm", "clang"},
@@ -32,6 +31,8 @@
     "lld": {"llvm"},
     "mlir": {"llvm"},
     "polly": {"llvm"},
+    "openmp": {"clang", "lld"},
+    "offload": {"clang", "lld", "flang"},
 }
 
 # This mapping describes the additional projects that should be tested when a
@@ -64,7 +65,6 @@
         "mlir",
         "polly",
         "flang",
-        "openmp",
     },
 }
 
@@ -72,7 +72,11 @@
 # but not necessarily run for testing. The only case of this currently is lldb
 # which needs some runtimes enabled for tests.
 DEPENDENT_RUNTIMES_TO_BUILD = {
-    "lldb": {"libcxx", "libcxxabi", "libunwind", "compiler-rt"}
+    "lldb": {"libcxx", "libcxxabi", "libunwind", "compiler-rt"},
+    "clang": {"openmp", "offload"},
+    "llvm": {"openmp", "offload"},
+    "lld": {"openmp", "offload"},
+    ".ci": {"openmp", "offload"},
 }
 
 # This mapping describes runtimes that should be tested when the key project is
@@ -84,7 +88,9 @@
     "compiler-rt": {"compiler-rt"},
     "flang": {"flang-rt"},
     "flang-rt": {"flang-rt"},
-    ".ci": {"compiler-rt", "libc", "flang-rt", "libclc"},
+    "openmp": {"openmp"},
+    "offload": {"offload"},
+    ".ci": {"compiler-rt", "libc", "flang-rt", "libclc", "openmp", "offload"},
 }
 DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = {
     "llvm": {"libcxx", "libcxxabi", "libunwind"},
@@ -94,7 +100,6 @@
 
 EXCLUDE_LINUX = {
     "cross-project-tests",  # TODO(issues/132796): Tests are failing.
-    "openmp",  # https://github.com/google/llvm-premerge-checks/issues/410
 }
 
 EXCLUDE_WINDOWS = {
@@ -107,6 +112,7 @@
     "libcxxabi",
     "libunwind",
     "flang-rt",
+    "offload",
 }
 
 # These are projects that we should test if the project itself is changed but
@@ -128,6 +134,7 @@
     "libcxx",
     "libcxxabi",
     "libunwind",
+    "offload",
 }
 
 PROJECT_CHECK_TARGETS = {
@@ -149,12 +156,20 @@
     "lld": "check-lld",
     "lldb": "check-lldb",
     "mlir": "check-mlir",
-    "openmp": "check-openmp",
     "polly": "check-polly",
     "lit": "check-lit",
 }
 
-RUNTIMES = {"libcxx", "libcxxabi", "libunwind", "compiler-rt", "libc", "flang-rt"}
+RUNTIMES = {
+    "libcxx",
+    "libcxxabi",
+    "libunwind",
+    "compiler-rt",
+    "libc",
+    "flang-rt",
+    "openmp",
+    "offload",
+}
 
 # Meta projects are projects that need explicit handling but do not reside
 # in their own top level folder. To add a meta project, the start of the path
diff --git a/.ci/compute_projects_test.py b/.ci/compute_projects_test.py
index f0abdd708ca42..8c9db966e926d 100644
--- a/.ci/compute_projects_test.py
+++ b/.ci/compute_projects_test.py
@@ -22,7 +22,8 @@ def test_llvm(self):
             "check-bolt check-clang check-clang-tools check-flang check-lld check-lldb check-llvm check-mlir check-polly",
         )
         self.assertEqual(
-            env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
+            env_variables["runtimes_to_build"],
+            "libcxx;libcxxabi;libunwind;offload;openmp",
         )
         self.assertEqual(
             env_variables["runtimes_check_targets"],
@@ -83,14 +84,15 @@ def test_clang(self):
         )
         self.assertEqual(
             env_variables["projects_to_build"],
-            "clang;clang-tools-extra;lld;lldb;llvm",
+            "clang;clang-tools-extra;flang;lld;lldb;llvm",
         )
         self.assertEqual(
             env_variables["project_check_targets"],
             "check-clang check-clang-tools check-lldb",
         )
         self.assertEqual(
-            env_variables["runtimes_to_build"], "compiler-rt;libcxx;libcxxabi;libunwind"
+            env_variables["runtimes_to_build"],
+            "compiler-rt;libcxx;libcxxabi;libunwind;offload;openmp",
         )
         self.assertEqual(
             env_variables["runtimes_check_targets"],
@@ -158,14 +160,15 @@ def test_cir(self):
         )
         self.assertEqual(
             env_variables["projects_to_build"],
-            "clang;clang-tools-extra;lld;lldb;llvm;mlir",
+            "clang;clang-tools-extra;flang;lld;lldb;llvm;mlir",
         )
         self.assertEqual(
             env_variables["project_check_targets"],
             "check-clang check-clang-cir check-clang-tools check-lldb",
         )
         self.assertEqual(
-            env_variables["runtimes_to_build"], "compiler-rt;libcxx;libcxxabi;libunwind"
+            env_variables["runtimes_to_build"],
+            "compiler-rt;libcxx;libcxxabi;libunwind;offload;openmp",
         )
         self.assertEqual(
             env_variables["runtimes_check_targets"],
@@ -293,7 +296,7 @@ def test_ci(self):
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],
-            "compiler-rt;flang-rt;libc;libclc;libcxx;libcxxabi;libunwind",
+            "compiler-rt;flang-rt;libc;libclc;libcxx;libcxxabi;libunwind;offload;openmp",
         )
         self.assertEqual(
             env_variables["runtimes_check_targets"],
@@ -367,7 +370,7 @@ def test_premerge_workflow(self):
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],
-            "compiler-rt;flang-rt;libc;libclc;libcxx;libcxxabi;libunwind",
+            "compiler-rt;flang-rt;libc;libclc;libcxx;libcxxabi;libunwind;offload;openmp",
         )
         self.assertEqual(
             env_variables["runtimes_check_targets"],
@@ -402,7 +405,7 @@ def test_third_party_benchmark(self):
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],
-            "compiler-rt;flang-rt;libc;libclc;libcxx;libcxxabi;libunwind",
+            "compiler-rt;flang-rt;libc;libclc;libcxx;libcxxabi;libunwind;offload;openmp",
         )
         self.assertEqual(
             env_variables["runtimes_check_targets"],
@@ -426,7 +429,8 @@ def test_lit(self):
             "check-bolt check-clang check-clang-tools check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
         )
         self.assertEqual(
-            env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
+            env_variables["runtimes_to_build"],
+            "libcxx;libcxxabi;libunwind;offload;openmp",
         )
         self.assertEqual(
             env_variables["runtimes_check_targets"],

>From a19b1d3c8d9b496521f2695a152572c3181516d8 Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Mon, 23 Feb 2026 06:25:22 -0600
Subject: [PATCH 2/7] Reviewer feedback

---
 .ci/compute_projects.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 4b0b758af2658..6320a7e377676 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -24,6 +24,7 @@
     "clang-tools-extra": {"clang", "llvm"},
     "compiler-rt": {"clang", "lld"},
     "libc": {"clang", "lld"},
+    "openmp": {"clang", "lld"},
     "flang": {"llvm", "clang"},
     "flang-rt": {"flang"},
     "lldb": {"llvm", "clang"},
@@ -31,7 +32,6 @@
     "lld": {"llvm"},
     "mlir": {"llvm"},
     "polly": {"llvm"},
-    "openmp": {"clang", "lld"},
     "offload": {"clang", "lld", "flang"},
 }
 
@@ -72,11 +72,7 @@
 # but not necessarily run for testing. The only case of this currently is lldb
 # which needs some runtimes enabled for tests.
 DEPENDENT_RUNTIMES_TO_BUILD = {
-    "lldb": {"libcxx", "libcxxabi", "libunwind", "compiler-rt"},
-    "clang": {"openmp", "offload"},
-    "llvm": {"openmp", "offload"},
-    "lld": {"openmp", "offload"},
-    ".ci": {"openmp", "offload"},
+    "lldb": {"libcxx", "libcxxabi", "libunwind", "compiler-rt"}
 }
 
 # This mapping describes runtimes that should be tested when the key project is

>From 2dbf3e9f512f2fb3e23a36fd2983d6659a793667 Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Thu, 5 Mar 2026 06:42:46 -0600
Subject: [PATCH 3/7] Integrate reviewer feedback

re-added OpenMP -> check-openmp mapping
Added Offload -> check-offload mapping
---
 .ci/compute_projects.py      | 2 ++
 .ci/compute_projects_test.py | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 6320a7e377676..461720e403447 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -152,8 +152,10 @@
     "lld": "check-lld",
     "lldb": "check-lldb",
     "mlir": "check-mlir",
+    "openmp": "check-openmp",
     "polly": "check-polly",
     "lit": "check-lit",
+    "offload": "check-offload",
 }
 
 RUNTIMES = {
diff --git a/.ci/compute_projects_test.py b/.ci/compute_projects_test.py
index 8c9db966e926d..8253d656bdda2 100644
--- a/.ci/compute_projects_test.py
+++ b/.ci/compute_projects_test.py
@@ -84,7 +84,7 @@ def test_clang(self):
         )
         self.assertEqual(
             env_variables["projects_to_build"],
-            "clang;clang-tools-extra;flang;lld;lldb;llvm",
+            "clang;clang-tools-extra;lld;lldb;llvm",
         )
         self.assertEqual(
             env_variables["project_check_targets"],

>From 82e2c3cf62b51956419ef57f8e7a1501c48e7f71 Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Wed, 11 Mar 2026 04:41:09 -0500
Subject: [PATCH 4/7] Add an 'offload' target for testing purposes

---
 offload/CMakeLists.txt | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt
index 65733de43d29e..6603bfdef6e20 100644
--- a/offload/CMakeLists.txt
+++ b/offload/CMakeLists.txt
@@ -403,3 +403,17 @@ if(OFFLOAD_INCLUDE_TESTS)
   add_subdirectory(test)
   add_subdirectory(unittests)
 endif()
+
+# Expose a high-level target to build the offloading runtimes.
+# This is used in pre-commit CI to run a build of the libraries without requiring
+# to invoke the check-* targets.
+# TODO: This should be a separate PR but is here for testing purposes for now.
+add_custom_target(offload ALL
+  COMMENT "Building OpenMP offloading runtime library and plugins"
+)
+if(TARGET omptarget)
+  add_dependencies(offload omptarget)
+endif()
+if(TARGET LLVMOffload)
+  add_dependencies(offload LLVMOffload)
+endif()

>From e647cabee9f505c61a5c5d14946275fe068c1660 Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Wed, 11 Mar 2026 04:44:15 -0500
Subject: [PATCH 5/7] Use offload target instead of check-offload

Update to use the new offload target, which should *build* the
offloading libraries only w/o running tests.
---
 .ci/compute_projects.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 461720e403447..5d9021cf5ab4e 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -155,7 +155,7 @@
     "openmp": "check-openmp",
     "polly": "check-polly",
     "lit": "check-lit",
-    "offload": "check-offload",
+    "offload": "offload",
 }
 
 RUNTIMES = {

>From e4f7589fc5e38a29c14861a365d7f51dbcf31193 Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Wed, 11 Mar 2026 06:55:10 -0500
Subject: [PATCH 6/7] Add target to build OpenMP runtime

---
 openmp/CMakeLists.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index 94152f98d30f6..13849444f86d8 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -169,3 +169,11 @@ else()
   # Now that we have seen all testsuites, create the check-openmp target.
   construct_check_openmp_target()
 endif()
+
+# Target to be invoked by the pre-merge CI to build the OpenMP runtime library.
+add_custom_target(openmp ALL
+  COMMENT "OpenMP meta-target. Use 'make openmp' to build all OpenMP targets."
+  )
+if(TARGET omp)
+  add_dependencies(openmp omp)
+endif()

>From f48bf8ddc01ff0d22581eb56cacbcbb7073f5827 Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Wed, 11 Mar 2026 06:55:44 -0500
Subject: [PATCH 7/7] Build OpenMP runtime via openmp target

---
 .ci/compute_projects.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 5d9021cf5ab4e..7586562460733 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -152,7 +152,7 @@
     "lld": "check-lld",
     "lldb": "check-lldb",
     "mlir": "check-mlir",
-    "openmp": "check-openmp",
+    "openmp": "openmp",
     "polly": "check-polly",
     "lit": "check-lit",
     "offload": "offload",



More information about the Openmp-commits mailing list