Author: Joseph Huber Date: 2026-02-19T08:01:36-06:00 New Revision: 54ab131f4cd656b617dee431bcecb259f649d64a
URL: https://github.com/llvm/llvm-project/commit/54ab131f4cd656b617dee431bcecb259f649d64a DIFF: https://github.com/llvm/llvm-project/commit/54ab131f4cd656b617dee431bcecb259f649d64a.diff LOG: [libclc] Completely remove ENABLE_RUNTIME_SUBNORMAL option (#182125) Summary: This isn't really used and this simplifies the code. I could go deeper to remove this content entirely as they all return `false` but I figured this was an easier change to do first. --------- Co-authored-by: Wenju He <[email protected]> Added: Modified: libclc/CMakeLists.txt libclc/opencl/lib/clspv/SOURCES libclc/opencl/lib/generic/SOURCES libclc/opencl/lib/generic/subnormal_config.cl libclc/opencl/lib/spirv/SOURCES Removed: libclc/opencl/lib/clspv/subnormal_config.cl libclc/opencl/lib/generic/subnormal_disable.ll libclc/opencl/lib/generic/subnormal_helper_func.ll libclc/opencl/lib/generic/subnormal_use_default.ll libclc/opencl/lib/spirv/subnormal_config.cl ################################################################################ diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt index 50fdb0669ea4b..f01c3cc98a739 100644 --- a/libclc/CMakeLists.txt +++ b/libclc/CMakeLists.txt @@ -42,8 +42,6 @@ endif() set( LIBCLC_TARGETS_TO_BUILD ${LIBCLC_DEFAULT_TARGET} CACHE STRING "Semicolon-separated list of libclc targets to build, or 'all'." ) -option( ENABLE_RUNTIME_SUBNORMAL "Enable runtime linking of subnormal support." OFF ) - option( LIBCLC_USE_SPIRV_BACKEND "Build SPIR-V targets with the SPIR-V backend." OFF ) @@ -216,19 +214,6 @@ set( cayman_aliases aruba ) configure_file( libclc.pc.in libclc.pc @ONLY ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig" ) -if( ENABLE_RUNTIME_SUBNORMAL ) - foreach( file IN ITEMS subnormal_use_default subnormal_disable ) - link_bc( - TARGET ${file} - INPUTS ${CMAKE_CURRENT_SOURCE_DIR}/opencl/lib/generic/${file}.ll - ) - install( - FILES $<TARGET_PROPERTY:${file},TARGET_FILE> - DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" - ) - endforeach() -endif() - set_source_files_properties( # CLC builtins ${CMAKE_CURRENT_SOURCE_DIR}/clc/lib/generic/math/clc_native_cos.cl @@ -326,12 +311,6 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) set( opencl_lib_files ) - if( NOT ARCH STREQUAL spirv AND NOT ARCH STREQUAL spirv64 AND - NOT ARCH STREQUAL clspv AND NOT ARCH STREQUAL clspv64 AND - NOT ENABLE_RUNTIME_SUBNORMAL ) - list( APPEND opencl_lib_files opencl/lib/generic/subnormal_use_default.ll ) - endif() - libclc_configure_lib_source( opencl_lib_files LIB_ROOT_DIR opencl diff --git a/libclc/opencl/lib/clspv/SOURCES b/libclc/opencl/lib/clspv/SOURCES index 8537d7c2d6b42..ccfea5bd16ea4 100644 --- a/libclc/opencl/lib/clspv/SOURCES +++ b/libclc/opencl/lib/clspv/SOURCES @@ -4,7 +4,6 @@ conversion/convert_int2float.cl conversion/convert_integer.cl math/fma.cl shared/vstore_half.cl -subnormal_config.cl ../generic/geometric/distance.cl ../generic/geometric/length.cl ../generic/math/acos.cl diff --git a/libclc/opencl/lib/clspv/subnormal_config.cl b/libclc/opencl/lib/clspv/subnormal_config.cl deleted file mode 100644 index 114aabb2e9435..0000000000000 --- a/libclc/opencl/lib/clspv/subnormal_config.cl +++ /dev/null @@ -1,16 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include <clc/math/clc_subnormal_config.h> -#include <clc/opencl/opencl-base.h> - -_CLC_DEF bool __clc_fp16_subnormals_supported() { return false; } - -_CLC_DEF bool __clc_fp32_subnormals_supported() { return false; } - -_CLC_DEF bool __clc_fp64_subnormals_supported() { return false; } diff --git a/libclc/opencl/lib/generic/SOURCES b/libclc/opencl/lib/generic/SOURCES index a2c6af8b9252c..c820c6c3c0c06 100644 --- a/libclc/opencl/lib/generic/SOURCES +++ b/libclc/opencl/lib/generic/SOURCES @@ -1,5 +1,4 @@ subnormal_config.cl -subnormal_helper_func.ll async/async_work_group_copy.cl async/async_work_group_strided_copy.cl async/prefetch.cl diff --git a/libclc/opencl/lib/generic/subnormal_config.cl b/libclc/opencl/lib/generic/subnormal_config.cl index aa2e30935e5f0..799acc063d350 100644 --- a/libclc/opencl/lib/generic/subnormal_config.cl +++ b/libclc/opencl/lib/generic/subnormal_config.cl @@ -14,5 +14,9 @@ _CLC_DEF bool __clc_fp16_subnormals_supported() { return false; } _CLC_DEF bool __clc_fp32_subnormals_supported() { return false; } _CLC_DEF bool __clc_fp64_subnormals_supported() { - return !__clc_subnormals_disabled(); +#if defined(CLC_SPIRV) || defined(CLC_CLSPV) + return false; +#else + return true; +#endif } diff --git a/libclc/opencl/lib/generic/subnormal_disable.ll b/libclc/opencl/lib/generic/subnormal_disable.ll deleted file mode 100644 index 732d09ff09ab4..0000000000000 --- a/libclc/opencl/lib/generic/subnormal_disable.ll +++ /dev/null @@ -1,9 +0,0 @@ -;;===----------------------------------------------------------------------===;; -; -; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -; See https://llvm.org/LICENSE.txt for license information. -; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -; -;;===----------------------------------------------------------------------===;; - -@__CLC_SUBNORMAL_DISABLE = unnamed_addr constant i1 true diff --git a/libclc/opencl/lib/generic/subnormal_helper_func.ll b/libclc/opencl/lib/generic/subnormal_helper_func.ll deleted file mode 100644 index 03beecf979260..0000000000000 --- a/libclc/opencl/lib/generic/subnormal_helper_func.ll +++ /dev/null @@ -1,16 +0,0 @@ -;;===----------------------------------------------------------------------===;; -; -; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -; See https://llvm.org/LICENSE.txt for license information. -; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -; -;;===----------------------------------------------------------------------===;; - -@__CLC_SUBNORMAL_DISABLE = external global i1 - -define i1 @__clc_subnormals_disabled() #0 { - %disable = load i1, i1* @__CLC_SUBNORMAL_DISABLE - ret i1 %disable -} - -attributes #0 = { alwaysinline } diff --git a/libclc/opencl/lib/generic/subnormal_use_default.ll b/libclc/opencl/lib/generic/subnormal_use_default.ll deleted file mode 100644 index c648cc0a8aded..0000000000000 --- a/libclc/opencl/lib/generic/subnormal_use_default.ll +++ /dev/null @@ -1,9 +0,0 @@ -;;===----------------------------------------------------------------------===;; -; -; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -; See https://llvm.org/LICENSE.txt for license information. -; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -; -;;===----------------------------------------------------------------------===;; - -@__CLC_SUBNORMAL_DISABLE = unnamed_addr constant i1 false diff --git a/libclc/opencl/lib/spirv/SOURCES b/libclc/opencl/lib/spirv/SOURCES index 6b7fa8261f6d9..ea5f9dee9f64d 100644 --- a/libclc/opencl/lib/spirv/SOURCES +++ b/libclc/opencl/lib/spirv/SOURCES @@ -1,4 +1,3 @@ -subnormal_config.cl ../generic/async/async_work_group_strided_copy.cl ../generic/async/wait_group_events.cl ../generic/common/degrees.cl diff --git a/libclc/opencl/lib/spirv/subnormal_config.cl b/libclc/opencl/lib/spirv/subnormal_config.cl deleted file mode 100644 index 114aabb2e9435..0000000000000 --- a/libclc/opencl/lib/spirv/subnormal_config.cl +++ /dev/null @@ -1,16 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include <clc/math/clc_subnormal_config.h> -#include <clc/opencl/opencl-base.h> - -_CLC_DEF bool __clc_fp16_subnormals_supported() { return false; } - -_CLC_DEF bool __clc_fp32_subnormals_supported() { return false; } - -_CLC_DEF bool __clc_fp64_subnormals_supported() { return false; } _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
