Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2d50750
remove dummy bin
jinge90 Nov 24, 2025
9c76946
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Nov 26, 2025
fe628a9
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Nov 27, 2025
7a7e62b
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Nov 28, 2025
4de8fa5
merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Dec 1, 2025
e52bb98
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Dec 4, 2025
4b63322
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Dec 10, 2025
544d912
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Dec 12, 2025
2ad6143
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Dec 17, 2025
cf391d9
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Dec 24, 2025
e0f2a15
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Jan 6, 2026
aa7a97c
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Jan 12, 2026
9244680
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Jan 30, 2026
e288294
Remove prepare-builtins dep
jinge90 Feb 3, 2026
e1b546c
Merge remote-tracking branch 'upstream/sycl' into remove_libdevice_li…
jinge90 Feb 3, 2026
b4b5793
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Feb 3, 2026
4ef0546
apply weak for native cpu symbols
jinge90 Feb 3, 2026
246124e
fix clang format issue
jinge90 Feb 3, 2026
50f8f75
Merge remote-tracking branch 'upstream/sycl' into sycl
jinge90 Feb 4, 2026
7b3bb56
resolve conflicts
jinge90 Feb 4, 2026
79a1549
Merge remote-tracking branch 'upstream/sycl' into remove_libdevice_li…
jinge90 Feb 4, 2026
97ee1e1
Merge remote-tracking branch 'upstream/sycl' into remove_libdevice_li…
jinge90 Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 8 additions & 28 deletions libdevice/cmake/modules/SYCLLibdevice.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -236,34 +236,18 @@ endfunction()
function(process_bc out_file)
cmake_parse_arguments(ARG
""
"LIB_TGT;IN_FILE;OUT_DIR"
"IN_FILE;OUT_DIR"
"OPT_FLAGS;DEPENDENCIES"
${ARGN})
add_custom_command( OUTPUT ${ARG_LIB_TGT}.bc
COMMAND ${opt_exe} ${ARG_OPT_FLAGS} -o ${ARG_LIB_TGT}.bc
add_custom_command( OUTPUT ${ARG_OUT_DIR}/${out_file}
COMMAND ${opt_exe} ${ARG_OPT_FLAGS} -o ${ARG_OUT_DIR}/${out_file}
${ARG_IN_FILE}
DEPENDS ${opt_target} ${ARG_IN_FILE} ${ARG_DEPENDENCIES}
)
add_custom_target( ${ARG_LIB_TGT}
ALL DEPENDS ${ARG_LIB_TGT}.bc
)
set_target_properties( ${ARG_LIB_TGT}
PROPERTIES TARGET_FILE ${ARG_LIB_TGT}.bc
)

set( builtins_opt_lib $<TARGET_PROPERTY:${ARG_LIB_TGT},TARGET_FILE> )

# Copy the optimized library to the output directory
# Note: prepare_builtins utility was removed upstream as it's no longer
# necessary - linkage is handled by -mlink-builtin-bitcode and metadata
# deduplication is handled by llvm-link
add_custom_command( OUTPUT ${ARG_OUT_DIR}/${out_file}
COMMAND ${CMAKE_COMMAND} -E copy ${builtins_opt_lib} ${ARG_OUT_DIR}/${out_file}
DEPENDS ${builtins_opt_lib} ${ARG_LIB_TGT} )
add_custom_target( library-${out_file} ALL
add_custom_target( opt-${out_file} ALL
DEPENDS ${ARG_OUT_DIR}/${out_file}
)
set_target_properties( library-${out_file}
set_target_properties( opt-${out_file}
PROPERTIES TARGET_FILE ${ARG_OUT_DIR}/${out_file}
)
endfunction()
Expand Down Expand Up @@ -440,7 +424,6 @@ if("native_cpu" IN_LIST SYCL_ENABLE_BACKENDS)
VERBATIM)
add_custom_target(nativecpu_utils-bc DEPENDS ${bc_binary_dir}/nativecpu_utils.bc)
process_bc(libsycl-nativecpu_utils.bc
LIB_TGT libsycl-nativecpu_utils
IN_FILE ${bc_binary_dir}/nativecpu_utils.bc
OUT_DIR ${bc_binary_dir})
add_custom_target(libsycl-nativecpu_utils-bc DEPENDS ${bc_binary_dir}/libsycl-nativecpu_utils.bc)
Expand Down Expand Up @@ -801,19 +784,16 @@ foreach(arch IN LISTS full_build_archs)
set( builtins_link_lib_${arch}
$<TARGET_PROPERTY:device_lib_device_${arch},TARGET_FILE>)
add_dependencies(libsycldevice-bc device_lib_device_${arch})
set( builtins_opt_lib_tgt_${arch} builtins_${arch}.opt)

# Run the optimizer on the resulting bitcode file and call prepare_builtins
# on it, which strips away debug and arch information.
# Run the optimizer on the resulting bitcode file.
process_bc(devicelib-${arch}.bc
LIB_TGT builtins_${arch}.opt
IN_FILE ${builtins_link_lib_${arch}}
OUT_DIR ${bc_binary_dir}
OPT_FLAGS ${opt_flags_${arch}}
DEPENDENCIES device_lib_device_${arch})
add_dependencies(libsycldevice-bc library-devicelib-${arch}.bc)
add_dependencies(libsycldevice-bc opt-devicelib-${arch}.bc)
set(complete_${arch}_libdev
$<TARGET_PROPERTY:library-devicelib-${arch}.bc,TARGET_FILE>)
$<TARGET_PROPERTY:opt-devicelib-${arch}.bc,TARGET_FILE>)
install( FILES ${complete_${arch}_libdev}
DESTINATION ${install_dest_bc}
COMPONENT libsycldevice)
Expand Down
3 changes: 2 additions & 1 deletion libdevice/nativecpu_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ using __nativecpu_state = native_cpu::state;

#undef DEVICE_EXTERNAL
#undef DEVICE_EXTERN_C
#define DEVICE_EXTERN_C extern "C" SYCL_EXTERNAL __attribute__((libclc_call, weak))
#define DEVICE_EXTERN_C \
extern "C" SYCL_EXTERNAL __attribute__((libclc_call, weak))
#define DEVICE_EXTERNAL_C DEVICE_EXTERN_C __attribute__((always_inline))
#define DEVICE_EXTERNAL \
SYCL_EXTERNAL __attribute__((always_inline, libclc_call))
Expand Down