[llvm] [CI] Enable CIR testing for all MLIR and Clang changes (PR #227834)

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 20:52:21 PDT 2026


https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/227834

>From 27ecdb7c912abb56322015b23be8d8abf4d00c6c Mon Sep 17 00:00:00 2001
From: Andy Kaylor <akaylor at nvidia.com>
Date: Wed, 30 Sep 2026 12:21:37 -0700
Subject: [PATCH 1/3] [CI] Enable CIR testing for all MLIR and Clang changes

We've been having frequent problems lately where CIR is broken by changes
to MLIR or Clang and it wasn't noticed because the CI for those changes
didn't test CIR. This change enables CIR testing for all MLIR and Clang
changes.

Note that this is orthogonal to the question of whether Clang should
build with CIR enabled by default. This is effectively enabled CIR by
default for CI, but not for other builds.
---
 .ci/compute_projects.py      | 15 +++++++++++++--
 .ci/compute_projects_test.py | 23 ++++++++++++-----------
 2 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 936397b779eb0..4257d01d02e85 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -90,8 +90,16 @@
         "cross-project-tests",
     },
     "lld": {"bolt", "cross-project-tests"},
-    "clang": {"clang-tools-extra", "cross-project-tests", "lldb"},
-    "mlir": {"flang"},
+    "clang": {
+        "CIR",
+        "clang-tools-extra",
+        "cross-project-tests",
+        "lldb",
+    },
+    "mlir": {
+        "CIR",
+        "flang"
+    },
     # Test everything if ci scripts are changed.
     ".ci": {
         project_name
@@ -272,6 +280,9 @@ def _compute_project_check_targets(
             continue
         if project_to_test in PROJECT_CHECK_TARGETS:
             check_targets.add(PROJECT_CHECK_TARGETS[project_to_test])
+    # The clang suite includes the CIR tests when CIR is enabled.
+    if "clang" in projects_to_test:
+        check_targets.discard("check-clang-cir")
     return check_targets
 
 
diff --git a/.ci/compute_projects_test.py b/.ci/compute_projects_test.py
index 0dc01964201c6..2758ce976ec9d 100644
--- a/.ci/compute_projects_test.py
+++ b/.ci/compute_projects_test.py
@@ -132,7 +132,7 @@ def test_clang(self):
         )
         self.assertEqual(
             env_variables["projects_to_build"],
-            "clang;clang-tools-extra;cross-project-tests;lld;lldb;llvm",
+            "clang;clang-tools-extra;cross-project-tests;lld;lldb;llvm;mlir",
         )
         self.assertEqual(
             env_variables["project_check_targets"],
@@ -152,7 +152,7 @@ def test_clang(self):
         )
         self.assertEqual(
             env_variables["enable_cir"],
-            "OFF",
+            "ON",
         )
 
     def test_clang_windows(self):
@@ -161,7 +161,7 @@ def test_clang_windows(self):
         )
         self.assertEqual(
             env_variables["projects_to_build"],
-            "clang;clang-tools-extra;lld;llvm",
+            "clang;clang-tools-extra;lld;llvm;mlir",
         )
         self.assertEqual(
             env_variables["project_check_targets"],
@@ -176,7 +176,7 @@ def test_clang_windows(self):
             env_variables["runtimes_check_targets_needs_reconfig"],
             "",
         )
-        self.assertEqual(env_variables["enable_cir"], "OFF")
+        self.assertEqual(env_variables["enable_cir"], "ON")
 
     def test_compiler_rt(self):
         env_variables = compute_projects.get_env_variables(
@@ -214,7 +214,7 @@ def test_cir(self):
         )
         self.assertEqual(
             env_variables["project_check_targets"],
-            "check-clang check-clang-python check-clang-cir check-clang-tools check-cross-project check-lldb",
+            "check-clang check-clang-python check-clang-tools check-cross-project check-lldb",
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],
@@ -256,12 +256,13 @@ def test_mlir(self):
         )
         self.assertEqual(env_variables["projects_to_build"], "clang;flang;llvm;mlir")
         self.assertEqual(
-            env_variables["project_check_targets"], "check-flang check-mlir"
+            env_variables["project_check_targets"],
+            "check-clang-cir check-flang check-mlir",
         )
         self.assertEqual(env_variables["runtimes_to_build"], "")
         self.assertEqual(env_variables["runtimes_check_targets"], "")
         self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
-        self.assertEqual(env_variables["enable_cir"], "OFF")
+        self.assertEqual(env_variables["enable_cir"], "ON")
 
     def test_flang(self):
         env_variables = compute_projects.get_env_variables(
@@ -355,7 +356,7 @@ def test_ci(self):
         )
         self.assertEqual(
             env_variables["project_check_targets"],
-            "check-bolt check-clang check-clang-python check-clang-cir check-clang-tools check-cross-project check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
+            "check-bolt check-clang check-clang-python check-clang-tools check-cross-project check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],
@@ -380,7 +381,7 @@ def test_windows_ci(self):
         )
         self.assertEqual(
             env_variables["project_check_targets"],
-            "check-clang check-clang-python check-clang-cir check-clang-tools check-lit check-lld check-llvm check-mlir check-polly",
+            "check-clang check-clang-python check-clang-tools check-lit check-lld check-llvm check-mlir check-polly",
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],
@@ -429,7 +430,7 @@ def test_premerge_workflow(self):
         )
         self.assertEqual(
             env_variables["project_check_targets"],
-            "check-bolt check-clang check-clang-python check-clang-cir check-clang-tools check-cross-project check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
+            "check-bolt check-clang check-clang-python check-clang-tools check-cross-project check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],
@@ -464,7 +465,7 @@ def test_third_party_benchmark(self):
         )
         self.assertEqual(
             env_variables["project_check_targets"],
-            "check-bolt check-clang check-clang-python check-clang-cir check-clang-tools check-cross-project check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
+            "check-bolt check-clang check-clang-python check-clang-tools check-cross-project check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],

>From 5d23bfde49db537141ef3b5661c9fa67d43111a5 Mon Sep 17 00:00:00 2001
From: Andy Kaylor <akaylor at nvidia.com>
Date: Wed, 30 Sep 2026 12:57:28 -0700
Subject: [PATCH 2/3] Fix formatting

---
 .ci/compute_projects.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 4257d01d02e85..988a822bfcab9 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -96,10 +96,7 @@
         "cross-project-tests",
         "lldb",
     },
-    "mlir": {
-        "CIR",
-        "flang"
-    },
+    "mlir": {"CIR", "flang"},
     # Test everything if ci scripts are changed.
     ".ci": {
         project_name

>From 0f1c05ee05cea998e05305b465b967268b4402cd Mon Sep 17 00:00:00 2001
From: Andy Kaylor <akaylor at nvidia.com>
Date: Wed, 30 Sep 2026 20:51:36 -0700
Subject: [PATCH 3/3] Remove mlir as a dependency of CIR

---
 .ci/compute_projects.py      | 2 +-
 .ci/compute_projects_test.py | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 988a822bfcab9..498c2b4286df2 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -19,7 +19,7 @@
 PROJECT_DEPENDENCIES = {
     "llvm": set(),
     "clang": {"llvm"},
-    "CIR": {"clang", "mlir"},
+    "CIR": {"clang"},
     "bolt": {"clang", "lld", "llvm"},
     "clang-tools-extra": {"clang", "llvm"},
     "compiler-rt": {"clang", "lld"},
diff --git a/.ci/compute_projects_test.py b/.ci/compute_projects_test.py
index 2758ce976ec9d..9555a194a6334 100644
--- a/.ci/compute_projects_test.py
+++ b/.ci/compute_projects_test.py
@@ -132,7 +132,7 @@ def test_clang(self):
         )
         self.assertEqual(
             env_variables["projects_to_build"],
-            "clang;clang-tools-extra;cross-project-tests;lld;lldb;llvm;mlir",
+            "clang;clang-tools-extra;cross-project-tests;lld;lldb;llvm",
         )
         self.assertEqual(
             env_variables["project_check_targets"],
@@ -161,7 +161,7 @@ def test_clang_windows(self):
         )
         self.assertEqual(
             env_variables["projects_to_build"],
-            "clang;clang-tools-extra;lld;llvm;mlir",
+            "clang;clang-tools-extra;lld;llvm",
         )
         self.assertEqual(
             env_variables["project_check_targets"],
@@ -210,7 +210,7 @@ def test_cir(self):
         )
         self.assertEqual(
             env_variables["projects_to_build"],
-            "clang;clang-tools-extra;cross-project-tests;lld;lldb;llvm;mlir",
+            "clang;clang-tools-extra;cross-project-tests;lld;lldb;llvm",
         )
         self.assertEqual(
             env_variables["project_check_targets"],



More information about the llvm-commits mailing list