From 3efcdb9529fba0eb9036620ed58fa46daa2ec75e Mon Sep 17 00:00:00 2001 From: "Skrobot, Daniel" Date: Tue, 9 Dec 2025 11:01:21 +0100 Subject: [PATCH 1/9] Update buildbot/configure.py --- buildbot/configure.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildbot/configure.py b/buildbot/configure.py index 5bddddec67a06..ccf1887ad35d7 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -21,8 +21,8 @@ def do_configure(args, passthrough_args): if not os.path.isdir(abs_obj_dir): os.makedirs(abs_obj_dir) - llvm_external_projects = "sycl;llvm-spirv;opencl;xpti;xptifw;compiler-rt" - + llvm_external_projects = "sycl;llvm-spirv;opencl;xpti;xptifw" + llvm_enable_runtimes = "compiler-rt" # libdevice build requires a working SYCL toolchain, which is not the case # with macOS target right now. if sys.platform != "darwin": @@ -195,6 +195,7 @@ def do_configure(args, passthrough_args): "-DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR={}".format(libdevice_dir), "-DLLVM_EXTERNAL_SYCL_JIT_SOURCE_DIR={}".format(jit_dir), "-DLLVM_ENABLE_PROJECTS={}".format(llvm_enable_projects), + "-DLLVM_ENABLE_RUNTIMES={}".format(llvm_enable_runtimes), "-DSYCL_BUILD_PI_HIP_PLATFORM={}".format(sycl_build_pi_hip_platform), "-DLLVM_BUILD_TOOLS=ON", "-DLLVM_ENABLE_ZSTD={}".format(llvm_enable_zstd), From a286cb529e9f8f874d97ca3e5e5714d93685b017 Mon Sep 17 00:00:00 2001 From: "Skrobot, Daniel" Date: Thu, 11 Dec 2025 19:29:13 +0100 Subject: [PATCH 2/9] fix --- buildbot/configure.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/buildbot/configure.py b/buildbot/configure.py index ccf1887ad35d7..8bbcb2f38c97e 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -80,7 +80,7 @@ def do_configure(args, passthrough_args): libclc_enabled = args.cuda or args.hip or args.native_cpu if libclc_enabled: - llvm_enable_projects += ";libclc" + llvm_enable_runtimes += ";libclc" # DeviceRTL uses -fuse-ld=lld, so enable lld. if args.offload: @@ -147,12 +147,14 @@ def do_configure(args, passthrough_args): print("#############################################") # For clang-format, clang-tidy and code coverage - llvm_enable_projects += ";clang-tools-extra;compiler-rt" + llvm_enable_projects += ";clang-tools-extra" + if "compiler-rt" not in llvm_enable_runtimes: + llvm_enable_runtimes += ";compiler-rt" if sys.platform != "darwin": # libclc is required for CI validation libclc_enabled = True - if "libclc" not in llvm_enable_projects: - llvm_enable_projects += ";libclc" + if "libclc" not in llvm_enable_runtimes: + llvm_enable_runtimes += ";libclc" # libclc passes `--nvvm-reflect-enable=false`, build NVPTX to enable it if "NVPTX" not in llvm_targets_to_build: llvm_targets_to_build += ";NVPTX" From 9017509dd46e270bc889d751810fc491c70ee001 Mon Sep 17 00:00:00 2001 From: "Skrobot, Daniel" Date: Thu, 11 Dec 2025 19:50:55 +0100 Subject: [PATCH 3/9] test --- sycl/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 3586a8d725ab2..46198ea12fb61 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -526,17 +526,17 @@ if("lld" IN_LIST LLVM_ENABLE_PROJECTS) list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS lld) endif() -if("libclc" IN_LIST LLVM_ENABLE_PROJECTS) +if("libclc" IN_LIST LLVM_ENABLE_RUNTIMES) add_dependencies(sycl-toolchain libspirv-builtins) list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libspirv-builtins) endif() if("cuda" IN_LIST SYCL_ENABLE_BACKENDS) # Ensure that libclc is enabled. - list(FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND) + list(FIND LLVM_ENABLE_RUNTIMES libclc LIBCLC_FOUND) if( LIBCLC_FOUND EQUAL -1 ) message(FATAL_ERROR - "CUDA support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"") + "CUDA support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_RUNTIMES\"") endif() add_dependencies(sycl-toolchain ur_adapter_cuda) @@ -545,10 +545,10 @@ endif() if("hip" IN_LIST SYCL_ENABLE_BACKENDS) # Ensure that libclc is enabled. - list(FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND) + list(FIND LLVM_ENABLE_RUNTIMES libclc LIBCLC_FOUND) if( LIBCLC_FOUND EQUAL -1 ) message(FATAL_ERROR - "HIP support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"") + "HIP support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_RUNTIMES\"") endif() if(NOT TARGET lld AND "${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "AMD") From 156d3329c45e3ecfe4ae81709fc55497293715dc Mon Sep 17 00:00:00 2001 From: "Skrobot, Daniel" Date: Thu, 11 Dec 2025 19:55:35 +0100 Subject: [PATCH 4/9] test --- sycl/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 46198ea12fb61..2bf015e8917ee 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -526,7 +526,7 @@ if("lld" IN_LIST LLVM_ENABLE_PROJECTS) list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS lld) endif() -if("libclc" IN_LIST LLVM_ENABLE_RUNTIMES) +if("libclc" IN_LIST LLVM_ENABLE_PROJECTS) add_dependencies(sycl-toolchain libspirv-builtins) list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libspirv-builtins) endif() From f1b2411389c68ce16a73d695f3d75fefc045577f Mon Sep 17 00:00:00 2001 From: "Skrobot, Daniel" Date: Thu, 11 Dec 2025 20:16:45 +0100 Subject: [PATCH 5/9] fix --- buildbot/configure.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildbot/configure.py b/buildbot/configure.py index 8bbcb2f38c97e..9be3086abc6b4 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -22,7 +22,6 @@ def do_configure(args, passthrough_args): os.makedirs(abs_obj_dir) llvm_external_projects = "sycl;llvm-spirv;opencl;xpti;xptifw" - llvm_enable_runtimes = "compiler-rt" # libdevice build requires a working SYCL toolchain, which is not the case # with macOS target right now. if sys.platform != "darwin": @@ -67,6 +66,8 @@ def do_configure(args, passthrough_args): llvm_enable_zstd = "ON" spirv_enable_dis = "OFF" + llvm_external_projects+=";compiler-rt" + if sys.platform != "darwin": # For more info on the enablement of level_zero_v2 refer to this document: # https://github.com/intel/llvm/blob/sycl/unified-runtime/source/adapters/level_zero/v2/README.md @@ -149,7 +150,7 @@ def do_configure(args, passthrough_args): # For clang-format, clang-tidy and code coverage llvm_enable_projects += ";clang-tools-extra" if "compiler-rt" not in llvm_enable_runtimes: - llvm_enable_runtimes += ";compiler-rt" + llvm_enable_runtimes += ";compiler-rt" if sys.platform != "darwin": # libclc is required for CI validation libclc_enabled = True From 55207f1fbcf0edf70309713e8c64b912e6da5f4e Mon Sep 17 00:00:00 2001 From: "Skrobot, Daniel" Date: Thu, 11 Dec 2025 20:20:43 +0100 Subject: [PATCH 6/9] fix --- buildbot/configure.py | 1 + 1 file changed, 1 insertion(+) diff --git a/buildbot/configure.py b/buildbot/configure.py index 9be3086abc6b4..dbf2d781b1247 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -67,6 +67,7 @@ def do_configure(args, passthrough_args): spirv_enable_dis = "OFF" llvm_external_projects+=";compiler-rt" + llvm_enable_runtimes ="compiler-rt" if sys.platform != "darwin": # For more info on the enablement of level_zero_v2 refer to this document: From 211b6dcb4f3d2854ed6a5eb601fb20ba013e5750 Mon Sep 17 00:00:00 2001 From: "Skrobot, Daniel" Date: Thu, 11 Dec 2025 20:36:51 +0100 Subject: [PATCH 7/9] test --- sycl/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 2bf015e8917ee..3586a8d725ab2 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -533,10 +533,10 @@ endif() if("cuda" IN_LIST SYCL_ENABLE_BACKENDS) # Ensure that libclc is enabled. - list(FIND LLVM_ENABLE_RUNTIMES libclc LIBCLC_FOUND) + list(FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND) if( LIBCLC_FOUND EQUAL -1 ) message(FATAL_ERROR - "CUDA support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_RUNTIMES\"") + "CUDA support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"") endif() add_dependencies(sycl-toolchain ur_adapter_cuda) @@ -545,10 +545,10 @@ endif() if("hip" IN_LIST SYCL_ENABLE_BACKENDS) # Ensure that libclc is enabled. - list(FIND LLVM_ENABLE_RUNTIMES libclc LIBCLC_FOUND) + list(FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND) if( LIBCLC_FOUND EQUAL -1 ) message(FATAL_ERROR - "HIP support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_RUNTIMES\"") + "HIP support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"") endif() if(NOT TARGET lld AND "${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "AMD") From 8a84f495ee9dbd7c3088ab43239a2f5b840fe8ab Mon Sep 17 00:00:00 2001 From: "Skrobot, Daniel" Date: Thu, 11 Dec 2025 21:51:14 +0100 Subject: [PATCH 8/9] test with LLVM_ENABLE_RUNTIMES --- sycl/CMakeLists.txt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 3586a8d725ab2..7b78378005578 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -526,17 +526,12 @@ if("lld" IN_LIST LLVM_ENABLE_PROJECTS) list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS lld) endif() -if("libclc" IN_LIST LLVM_ENABLE_PROJECTS) - add_dependencies(sycl-toolchain libspirv-builtins) - list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libspirv-builtins) -endif() - if("cuda" IN_LIST SYCL_ENABLE_BACKENDS) # Ensure that libclc is enabled. - list(FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND) + list(FIND LLVM_ENABLE_RUNTIMES libclc LIBCLC_FOUND) if( LIBCLC_FOUND EQUAL -1 ) message(FATAL_ERROR - "CUDA support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"") + "CUDA support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_RUNTIMES \"") endif() add_dependencies(sycl-toolchain ur_adapter_cuda) @@ -545,10 +540,10 @@ endif() if("hip" IN_LIST SYCL_ENABLE_BACKENDS) # Ensure that libclc is enabled. - list(FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND) + list(FIND LLVM_ENABLE_RUNTIMES libclc LIBCLC_FOUND) if( LIBCLC_FOUND EQUAL -1 ) message(FATAL_ERROR - "HIP support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"") + "HIP support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_RUNTIMES \"") endif() if(NOT TARGET lld AND "${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "AMD") @@ -612,8 +607,9 @@ add_custom_target(install-sycl-test-utilities install-llvm-size install-llvm-cov install-llvm-profdata - install-compiler-rt # This is required to perform the DeviceConfigFile consistency test, see # sycl/test-e2e/Basic/device_config_file_consistency.cpp. COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --component DeviceConfigFile + COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --component compiler-rt + COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --component libclc ) From d38dad11b7767211cf041c87c30e4b4c900a6471 Mon Sep 17 00:00:00 2001 From: "Skrobot, Daniel" Date: Thu, 11 Dec 2025 22:09:17 +0100 Subject: [PATCH 9/9] fix --- buildbot/configure.py | 6 +++--- sycl/CMakeLists.txt | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/buildbot/configure.py b/buildbot/configure.py index dbf2d781b1247..93af20add89b9 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -82,7 +82,7 @@ def do_configure(args, passthrough_args): libclc_enabled = args.cuda or args.hip or args.native_cpu if libclc_enabled: - llvm_enable_runtimes += ";libclc" + llvm_enable_projects += ";libclc" # DeviceRTL uses -fuse-ld=lld, so enable lld. if args.offload: @@ -155,8 +155,8 @@ def do_configure(args, passthrough_args): if sys.platform != "darwin": # libclc is required for CI validation libclc_enabled = True - if "libclc" not in llvm_enable_runtimes: - llvm_enable_runtimes += ";libclc" + if "libclc" not in llvm_enable_projects: + llvm_enable_projects += ";libclc" # libclc passes `--nvvm-reflect-enable=false`, build NVPTX to enable it if "NVPTX" not in llvm_targets_to_build: llvm_targets_to_build += ";NVPTX" diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 7b78378005578..4abdcfc93cf9b 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -526,12 +526,17 @@ if("lld" IN_LIST LLVM_ENABLE_PROJECTS) list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS lld) endif() +if("libclc" IN_LIST LLVM_ENABLE_PROJECTS) + add_dependencies(sycl-toolchain libspirv-builtins) + list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS libspirv-builtins) +endif() + if("cuda" IN_LIST SYCL_ENABLE_BACKENDS) # Ensure that libclc is enabled. - list(FIND LLVM_ENABLE_RUNTIMES libclc LIBCLC_FOUND) + list(FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND) if( LIBCLC_FOUND EQUAL -1 ) message(FATAL_ERROR - "CUDA support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_RUNTIMES \"") + "CUDA support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"") endif() add_dependencies(sycl-toolchain ur_adapter_cuda) @@ -540,10 +545,10 @@ endif() if("hip" IN_LIST SYCL_ENABLE_BACKENDS) # Ensure that libclc is enabled. - list(FIND LLVM_ENABLE_RUNTIMES libclc LIBCLC_FOUND) + list(FIND LLVM_ENABLE_PROJECTS libclc LIBCLC_FOUND) if( LIBCLC_FOUND EQUAL -1 ) message(FATAL_ERROR - "HIP support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_RUNTIMES \"") + "HIP support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"") endif() if(NOT TARGET lld AND "${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "AMD") @@ -611,5 +616,4 @@ add_custom_target(install-sycl-test-utilities # sycl/test-e2e/Basic/device_config_file_consistency.cpp. COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --component DeviceConfigFile COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --component compiler-rt - COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --component libclc )