[libclc] [llvm] Wyles/update libclctests (PR #228681)
Jared Wyles via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 3 01:43:32 PDT 2026
https://github.com/jaredwy created https://github.com/llvm/llvm-project/pull/228681
Using libclc with different versions of clang emit different output. computeConstantRange now pushes ranges through zext and sext so we now can prove noundef. This test returns AMDGPU workgroup ID which is zero extended, so we can now prove it needs noundef.
At some point we may need to update the CI targets to look at libclc?
>From af2fab04c42bce090264fb95aa3820472865fe19 Mon Sep 17 00:00:00 2001
From: Jared Wyles <jared.wyles at gmail.com>
Date: Thu, 24 Sep 2026 18:48:59 +1000
Subject: [PATCH 1/2] [orc-rt] enabling CI
---
.ci/compute_projects.py | 4 ++++
.ci/compute_projects_test.py | 26 ++++++++++++++++++--------
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 936397b779eb06..0f2aded7532cfe 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -26,6 +26,7 @@
"cross-project-tests": {"clang", "lldb", "lld"},
"libc": {"clang", "lld"},
"openmp": {"clang", "lld"},
+ "orc-rt": {"llvm"},
"flang": {"llvm", "clang"},
"flang-rt": {"flang"},
"lldb": {"llvm", "clang"},
@@ -55,6 +56,7 @@
"libclc": "check-libclc",
"mlir": "check-mlir",
"openmp": "openmp", # Run only build in pre-merge
+ "orc-rt": "check-orc-rt",
"polly": "check-polly",
"lit": "check-lit",
"offload": "offload", # Run only build in pre-merge
@@ -70,6 +72,7 @@
"libclc",
"openmp",
"offload",
+ "orc-rt",
}
# This mapping describes the additional projects that should be tested when a
@@ -125,6 +128,7 @@
"flang": {"flang-rt"},
"flang-rt": {"flang-rt"},
"openmp": {"openmp"},
+ "orc-rt": {"orc-rt"},
"offload": {"offload", "openmp"},
".ci": {
runtime_name
diff --git a/.ci/compute_projects_test.py b/.ci/compute_projects_test.py
index 0dc01964201c61..4f2bd114c708b0 100644
--- a/.ci/compute_projects_test.py
+++ b/.ci/compute_projects_test.py
@@ -204,6 +204,16 @@ def test_compiler_rt(self):
"OFF",
)
+ def test_orc_rt(self):
+ env_variables = compute_projects.get_env_variables(
+ ["orc-rt/CMakeLists.txt"], "Linux"
+ )
+ self.assertEqual(env_variables["projects_to_build"], "llvm")
+ self.assertEqual(env_variables["project_check_targets"], "")
+ self.assertEqual(env_variables["runtimes_to_build"], "orc-rt")
+ self.assertEqual(env_variables["runtimes_check_targets"], "check-orc-rt")
+ self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
+
def test_cir(self):
env_variables = compute_projects.get_env_variables(
["clang/lib/CIR/CMakeLists.txt"], "Linux"
@@ -359,11 +369,11 @@ def test_ci(self):
)
self.assertEqual(
env_variables["runtimes_to_build"],
- "compiler-rt;flang-rt;libc;libcxx;libcxxabi;libunwind;offload;openmp",
+ "compiler-rt;flang-rt;libc;libcxx;libcxxabi;libunwind;offload;openmp;orc-rt",
)
self.assertEqual(
env_variables["runtimes_check_targets"],
- "check-compiler-rt check-flang-rt check-libc check-libclc offload openmp",
+ "check-compiler-rt check-flang-rt check-libc check-libclc check-orc-rt offload openmp",
)
self.assertEqual(
env_variables["runtimes_check_targets_needs_reconfig"],
@@ -384,11 +394,11 @@ def test_windows_ci(self):
)
self.assertEqual(
env_variables["runtimes_to_build"],
- "compiler-rt",
+ "compiler-rt;orc-rt",
)
self.assertEqual(
env_variables["runtimes_check_targets"],
- "check-compiler-rt check-libclc",
+ "check-compiler-rt check-libclc check-orc-rt",
)
self.assertEqual(
env_variables["runtimes_check_targets_needs_reconfig"],
@@ -433,11 +443,11 @@ def test_premerge_workflow(self):
)
self.assertEqual(
env_variables["runtimes_to_build"],
- "compiler-rt;flang-rt;libc;libcxx;libcxxabi;libunwind;offload;openmp",
+ "compiler-rt;flang-rt;libc;libcxx;libcxxabi;libunwind;offload;openmp;orc-rt",
)
self.assertEqual(
env_variables["runtimes_check_targets"],
- "check-compiler-rt check-flang-rt check-libc check-libclc offload openmp",
+ "check-compiler-rt check-flang-rt check-libc check-libclc check-orc-rt offload openmp",
)
self.assertEqual(
env_variables["runtimes_check_targets_needs_reconfig"],
@@ -468,11 +478,11 @@ def test_third_party_benchmark(self):
)
self.assertEqual(
env_variables["runtimes_to_build"],
- "compiler-rt;flang-rt;libc;libcxx;libcxxabi;libunwind;offload;openmp",
+ "compiler-rt;flang-rt;libc;libcxx;libcxxabi;libunwind;offload;openmp;orc-rt",
)
self.assertEqual(
env_variables["runtimes_check_targets"],
- "check-compiler-rt check-flang-rt check-libc check-libclc offload openmp",
+ "check-compiler-rt check-flang-rt check-libc check-libclc check-orc-rt offload openmp",
)
self.assertEqual(
env_variables["runtimes_check_targets_needs_reconfig"],
>From 6172bc31a265cef17547568a758077b9673228c7 Mon Sep 17 00:00:00 2001
From: Jared W <jared.wyles at gmail.com>
Date: Sat, 3 Oct 2026 18:39:06 +1000
Subject: [PATCH 2/2] [libclc] it looks like a previous change to llvm taught
computeConstantRange to zext and sext. Update test to match
---
libclc/test/work-item/get_group_id.cl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libclc/test/work-item/get_group_id.cl b/libclc/test/work-item/get_group_id.cl
index 90ea18124d43e7..1497768744d470 100644
--- a/libclc/test/work-item/get_group_id.cl
+++ b/libclc/test/work-item/get_group_id.cl
@@ -3,7 +3,7 @@
// RUN: %clang --target=%target -mcpu=%cpu %libclc_lib -cl-std=CL3.0 -O2 -fno-discard-value-names -emit-llvm -S -o - %s | FileCheck %s --check-prefix=%check_prefix
-// AMDGCN-LABEL: define hidden range(i64 0, 4294967296) i64 @test(
+// AMDGCN-LABEL: define hidden noundef range(i64 0, 4294967296) i64 @test(
// AMDGCN-SAME: ) local_unnamed_addr #[[ATTR0:[0-9]+]] {
// AMDGCN-NEXT: [[ENTRY:.*:]]
// AMDGCN-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.amdgcn.workgroup.id.x()
More information about the cfe-commits
mailing list