[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 <wenju.he@intel.com>
This commit is contained in:
Joseph Huber 2026-02-19 08:01:36 -06:00 committed by GitHub
parent b0192c31a1
commit 54ab131f4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 5 additions and 91 deletions

View File

@ -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

View File

@ -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

View File

@ -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; }

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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 }

View File

@ -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

View File

@ -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

View File

@ -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; }