2018-11-21 19:03:09 +00:00
|
|
|
# Copyright (c) 2018 Google LLC
|
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
set(SPIRV_TOOLS_REDUCE_SOURCES
|
|
|
|
change_operand_reduction_opportunity.h
|
2018-12-19 13:25:56 +00:00
|
|
|
change_operand_to_undef_reduction_opportunity.h
|
2021-06-28 16:53:49 +00:00
|
|
|
conditional_branch_to_simple_conditional_branch_opportunity_finder.h
|
|
|
|
conditional_branch_to_simple_conditional_branch_reduction_opportunity.h
|
2019-02-01 14:56:54 +00:00
|
|
|
merge_blocks_reduction_opportunity.h
|
|
|
|
merge_blocks_reduction_opportunity_finder.h
|
2019-01-23 22:07:58 +00:00
|
|
|
operand_to_const_reduction_opportunity_finder.h
|
|
|
|
operand_to_undef_reduction_opportunity_finder.h
|
|
|
|
operand_to_dominating_id_reduction_opportunity_finder.h
|
2018-11-21 19:03:09 +00:00
|
|
|
reducer.h
|
|
|
|
reduction_opportunity.h
|
2019-01-23 22:07:58 +00:00
|
|
|
reduction_opportunity_finder.h
|
2018-11-21 19:03:09 +00:00
|
|
|
reduction_pass.h
|
2018-12-19 13:25:56 +00:00
|
|
|
reduction_util.h
|
2019-03-21 13:32:21 +00:00
|
|
|
remove_block_reduction_opportunity.h
|
|
|
|
remove_block_reduction_opportunity_finder.h
|
2019-02-08 16:20:29 +00:00
|
|
|
remove_function_reduction_opportunity.h
|
|
|
|
remove_function_reduction_opportunity_finder.h
|
2020-05-13 21:08:40 +00:00
|
|
|
remove_instruction_reduction_opportunity.h
|
2019-04-02 15:50:15 +00:00
|
|
|
remove_selection_reduction_opportunity.h
|
|
|
|
remove_selection_reduction_opportunity_finder.h
|
2020-05-14 14:36:38 +00:00
|
|
|
remove_struct_member_reduction_opportunity.h
|
2020-05-13 21:08:40 +00:00
|
|
|
remove_unused_instruction_reduction_opportunity_finder.h
|
2020-05-14 14:36:38 +00:00
|
|
|
remove_unused_struct_member_reduction_opportunity_finder.h
|
2019-04-15 18:54:36 +00:00
|
|
|
simple_conditional_branch_to_branch_opportunity_finder.h
|
|
|
|
simple_conditional_branch_to_branch_reduction_opportunity.h
|
2021-07-06 06:14:36 +00:00
|
|
|
structured_construct_to_block_reduction_opportunity.h
|
|
|
|
structured_construct_to_block_reduction_opportunity_finder.h
|
2021-06-28 16:53:49 +00:00
|
|
|
structured_loop_to_selection_reduction_opportunity.h
|
|
|
|
structured_loop_to_selection_reduction_opportunity_finder.h
|
2018-11-21 19:03:09 +00:00
|
|
|
|
|
|
|
change_operand_reduction_opportunity.cpp
|
2018-12-19 13:25:56 +00:00
|
|
|
change_operand_to_undef_reduction_opportunity.cpp
|
2021-06-28 16:53:49 +00:00
|
|
|
conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp
|
|
|
|
conditional_branch_to_simple_conditional_branch_reduction_opportunity.cpp
|
2019-02-01 14:56:54 +00:00
|
|
|
merge_blocks_reduction_opportunity.cpp
|
|
|
|
merge_blocks_reduction_opportunity_finder.cpp
|
2019-01-23 22:07:58 +00:00
|
|
|
operand_to_const_reduction_opportunity_finder.cpp
|
|
|
|
operand_to_undef_reduction_opportunity_finder.cpp
|
|
|
|
operand_to_dominating_id_reduction_opportunity_finder.cpp
|
2018-11-21 19:03:09 +00:00
|
|
|
reducer.cpp
|
|
|
|
reduction_opportunity.cpp
|
2020-09-11 05:29:43 +00:00
|
|
|
reduction_opportunity_finder.cpp
|
2018-11-21 19:03:09 +00:00
|
|
|
reduction_pass.cpp
|
2018-12-19 13:25:56 +00:00
|
|
|
reduction_util.cpp
|
2019-03-21 13:32:21 +00:00
|
|
|
remove_block_reduction_opportunity.cpp
|
|
|
|
remove_block_reduction_opportunity_finder.cpp
|
2019-02-08 16:20:29 +00:00
|
|
|
remove_function_reduction_opportunity.cpp
|
|
|
|
remove_function_reduction_opportunity_finder.cpp
|
2018-11-21 19:03:09 +00:00
|
|
|
remove_instruction_reduction_opportunity.cpp
|
2019-04-02 15:50:15 +00:00
|
|
|
remove_selection_reduction_opportunity.cpp
|
|
|
|
remove_selection_reduction_opportunity_finder.cpp
|
2020-05-14 14:36:38 +00:00
|
|
|
remove_struct_member_reduction_opportunity.cpp
|
2020-05-13 21:08:40 +00:00
|
|
|
remove_unused_instruction_reduction_opportunity_finder.cpp
|
2020-05-14 14:36:38 +00:00
|
|
|
remove_unused_struct_member_reduction_opportunity_finder.cpp
|
2019-04-15 18:54:36 +00:00
|
|
|
simple_conditional_branch_to_branch_opportunity_finder.cpp
|
|
|
|
simple_conditional_branch_to_branch_reduction_opportunity.cpp
|
2021-07-06 06:14:36 +00:00
|
|
|
structured_construct_to_block_reduction_opportunity.cpp
|
|
|
|
structured_construct_to_block_reduction_opportunity_finder.cpp
|
2021-06-28 16:53:49 +00:00
|
|
|
structured_loop_to_selection_reduction_opportunity.cpp
|
|
|
|
structured_loop_to_selection_reduction_opportunity_finder.cpp
|
2019-04-15 18:54:36 +00:00
|
|
|
)
|
2018-11-21 19:03:09 +00:00
|
|
|
|
2020-08-10 14:59:24 +00:00
|
|
|
if(MSVC AND (NOT ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")))
|
2018-11-21 19:03:09 +00:00
|
|
|
# Enable parallel builds across four cores for this lib
|
|
|
|
add_definitions(/MP4)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
spvtools_pch(SPIRV_TOOLS_REDUCE_SOURCES pch_source_reduce)
|
|
|
|
|
2020-10-29 13:25:26 +00:00
|
|
|
add_library(SPIRV-Tools-reduce ${SPIRV_TOOLS_LIBRARY_TYPE} ${SPIRV_TOOLS_REDUCE_SOURCES})
|
2018-11-21 19:03:09 +00:00
|
|
|
|
|
|
|
spvtools_default_compile_options(SPIRV-Tools-reduce)
|
|
|
|
target_include_directories(SPIRV-Tools-reduce
|
2019-09-04 16:45:26 +00:00
|
|
|
PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${spirv-tools_SOURCE_DIR}/include>
|
|
|
|
$<BUILD_INTERFACE:${SPIRV_HEADER_INCLUDE_DIR}>
|
|
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
2018-11-21 19:03:09 +00:00
|
|
|
PRIVATE ${spirv-tools_BINARY_DIR}
|
|
|
|
)
|
|
|
|
# The reducer reuses a lot of functionality from the SPIRV-Tools library.
|
|
|
|
target_link_libraries(SPIRV-Tools-reduce
|
2020-10-29 13:25:26 +00:00
|
|
|
PUBLIC ${SPIRV_TOOLS_FULL_VISIBILITY}
|
2018-11-21 19:03:09 +00:00
|
|
|
PUBLIC SPIRV-Tools-opt)
|
|
|
|
|
|
|
|
set_property(TARGET SPIRV-Tools-reduce PROPERTY FOLDER "SPIRV-Tools libraries")
|
|
|
|
spvtools_check_symbol_exports(SPIRV-Tools-reduce)
|
|
|
|
|
|
|
|
if(ENABLE_SPIRV_TOOLS_INSTALL)
|
2019-09-04 16:45:26 +00:00
|
|
|
install(TARGETS SPIRV-Tools-reduce EXPORT SPIRV-Tools-reduceTargets
|
2018-11-21 19:03:09 +00:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
2019-10-17 15:36:55 +00:00
|
|
|
export(EXPORT SPIRV-Tools-reduceTargets FILE SPIRV-Tools-reduceTarget.cmake)
|
|
|
|
|
|
|
|
spvtools_config_package_dir(SPIRV-Tools-reduce PACKAGE_DIR)
|
|
|
|
install(EXPORT SPIRV-Tools-reduceTargets FILE SPIRV-Tools-reduceTarget.cmake
|
|
|
|
DESTINATION ${PACKAGE_DIR})
|
|
|
|
|
|
|
|
spvtools_generate_config_file(SPIRV-Tools-reduce)
|
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-reduceConfig.cmake DESTINATION ${PACKAGE_DIR})
|
2018-11-21 19:03:09 +00:00
|
|
|
endif(ENABLE_SPIRV_TOOLS_INSTALL)
|