forked from OSchip/llvm-project
[VENTUS][RISCV][feat] Accelerate libclc building process
Disable builtin cmake script defined in libclc by upstream to accelerate ventus libclc building process
This commit is contained in:
parent
9d56abe113
commit
85cf676b2c
|
@ -311,13 +311,13 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
|
|||
set( obj_suffix ${arch_suffix}.bc )
|
||||
|
||||
# Add opt target
|
||||
add_custom_command( OUTPUT "builtins.opt.${obj_suffix}"
|
||||
COMMAND ${LLVM_OPT} ${opt_flags} -o
|
||||
"builtins.opt.${obj_suffix}"
|
||||
"builtins.link.${obj_suffix}"
|
||||
DEPENDS "builtins.link.${arch_suffix}" )
|
||||
add_custom_target( "opt.${obj_suffix}" ALL
|
||||
DEPENDS "builtins.opt.${obj_suffix}" )
|
||||
# add_custom_command( OUTPUT "builtins.opt.${obj_suffix}"
|
||||
# COMMAND ${LLVM_OPT} ${opt_flags} -o
|
||||
# "builtins.opt.${obj_suffix}"
|
||||
# "builtins.link.${obj_suffix}"
|
||||
# DEPENDS "builtins.link.${arch_suffix}" )
|
||||
# add_custom_target( "opt.${obj_suffix}" ALL
|
||||
# DEPENDS "builtins.opt.${obj_suffix}" )
|
||||
|
||||
if( ${ARCH} STREQUAL "spirv" OR ${ARCH} STREQUAL "spirv64" )
|
||||
set( spv_suffix ${arch_suffix}.spv )
|
||||
|
@ -333,15 +333,15 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
|
|||
else()
|
||||
|
||||
# Add prepare target
|
||||
add_custom_command( OUTPUT "${obj_suffix}"
|
||||
COMMAND prepare_builtins -o
|
||||
"${obj_suffix}"
|
||||
"builtins.opt.${obj_suffix}"
|
||||
DEPENDS "opt.${obj_suffix}"
|
||||
"builtins.opt.${obj_suffix}"
|
||||
prepare_builtins )
|
||||
add_custom_target( "prepare-${obj_suffix}" ALL
|
||||
DEPENDS "${obj_suffix}" )
|
||||
# add_custom_command( OUTPUT "${obj_suffix}"
|
||||
# COMMAND prepare_builtins -o
|
||||
# "${obj_suffix}"
|
||||
# "builtins.opt.${obj_suffix}"
|
||||
# DEPENDS "opt.${obj_suffix}"
|
||||
# "builtins.opt.${obj_suffix}"
|
||||
# prepare_builtins )
|
||||
# add_custom_target( "prepare-${obj_suffix}" ALL
|
||||
# DEPENDS "${obj_suffix}" )
|
||||
|
||||
# nvptx-- targets don't include workitem builtins
|
||||
if( NOT ${t} MATCHES ".*ptx.*--$" )
|
||||
|
@ -350,16 +350,16 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
|
|||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} )
|
||||
endif()
|
||||
|
||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
|
||||
foreach( a ${${d}_aliases} )
|
||||
set( alias_suffix "${a}-${t}.bc" )
|
||||
add_custom_target( ${alias_suffix} ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E
|
||||
create_symlink ${obj_suffix}
|
||||
${alias_suffix}
|
||||
DEPENDS "prepare-${obj_suffix}" )
|
||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
|
||||
endforeach( a )
|
||||
# install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
|
||||
# foreach( a ${${d}_aliases} )
|
||||
# set( alias_suffix "${a}-${t}.bc" )
|
||||
# add_custom_target( ${alias_suffix} ALL
|
||||
# COMMAND ${CMAKE_COMMAND} -E
|
||||
# create_symlink ${obj_suffix}
|
||||
# ${alias_suffix}
|
||||
# DEPENDS "prepare-${obj_suffix}" )
|
||||
# install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
|
||||
# endforeach( a )
|
||||
endif()
|
||||
endforeach( d )
|
||||
endforeach( t )
|
||||
|
|
|
@ -16,6 +16,7 @@ for item in $(ls ${LIBCLC_DIR}/generic/lib | grep ll)
|
|||
do
|
||||
${BINARY_DIR}/bin/clang -target riscv32 -mcpu=ventus-gpgpu \
|
||||
-cl-std=CL2.0 \
|
||||
-Wno-override-module \
|
||||
-ffunction-sections -fdata-sections \
|
||||
-c ${LIBCLC_DIR}/generic/lib/${item} \
|
||||
-o ${LIBCLC_BUILD_DIR}/${item}.o
|
||||
|
|
Loading…
Reference in New Issue