mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-30 15:00:06 +00:00
86627f7b3f
Add extra iterators for ir::Module's sections Add extra getters to ir::Function Add a const version of BasicBlock::GetLabelInst() Use the max of all inputs' version as version Split debug in debug1 and debug2 - Debug1 instructions have to be placed before debug2 instructions. Error out if different addressing or memory models are found Exit early if no binaries were given Error out if entry points are redeclared Implement copy ctors for Function and BasicBlock - Visual Studio ends up generating copy constructors that call deleted functions while compiling the linker code, while GCC and clang do not. So explicitly write those functions to avoid Visual Studio messing up. Move removing duplicate capabilities to its own pass Add functions running on all IDs present in an instruction Remove duplicate SpvOpExtInstImport Give default options value for link functions Remove linkage capability if not making a library Check types before allowing to link Detect if two types/variables/functions have different decorations Remove decorations of imported variables/functions and their types Add a DecorationManager Add a method for removing all decorations of id Add methods for removing operands from instructions Error out if one of the modules has a non-zero schema Update README.md to talk about the linker Do not freak out if an imported built-in variable has no export
115 lines
3.1 KiB
CMake
115 lines
3.1 KiB
CMake
# Copyright (c) 2016 Google Inc.
|
|
|
|
# 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.
|
|
add_library(SPIRV-Tools-opt
|
|
aggressive_dead_code_elim_pass.h
|
|
basic_block.h
|
|
block_merge_pass.h
|
|
build_module.h
|
|
common_uniform_elim_pass.h
|
|
compact_ids_pass.h
|
|
constants.h
|
|
dead_branch_elim_pass.h
|
|
decoration_manager.h
|
|
def_use_manager.h
|
|
eliminate_dead_constant_pass.h
|
|
flatten_decoration_pass.h
|
|
function.h
|
|
fold_spec_constant_op_and_composite_pass.h
|
|
freeze_spec_constant_value_pass.h
|
|
inline_pass.h
|
|
inline_exhaustive_pass.h
|
|
inline_opaque_pass.h
|
|
insert_extract_elim.h
|
|
instruction.h
|
|
ir_loader.h
|
|
local_access_chain_convert_pass.h
|
|
local_single_block_elim_pass.h
|
|
local_single_store_elim_pass.h
|
|
local_ssa_elim_pass.h
|
|
log.h
|
|
module.h
|
|
null_pass.h
|
|
reflect.h
|
|
mem_pass.h
|
|
pass.h
|
|
passes.h
|
|
pass_manager.h
|
|
eliminate_dead_functions_pass.h
|
|
remove_duplicates_pass.h
|
|
set_spec_constant_default_value_pass.h
|
|
strength_reduction_pass.h
|
|
strip_debug_info_pass.h
|
|
types.h
|
|
type_manager.h
|
|
unify_const_pass.h
|
|
|
|
aggressive_dead_code_elim_pass.cpp
|
|
basic_block.cpp
|
|
block_merge_pass.cpp
|
|
build_module.cpp
|
|
common_uniform_elim_pass.cpp
|
|
compact_ids_pass.cpp
|
|
decoration_manager.cpp
|
|
def_use_manager.cpp
|
|
dead_branch_elim_pass.cpp
|
|
eliminate_dead_constant_pass.cpp
|
|
flatten_decoration_pass.cpp
|
|
function.cpp
|
|
fold_spec_constant_op_and_composite_pass.cpp
|
|
freeze_spec_constant_value_pass.cpp
|
|
inline_pass.cpp
|
|
inline_exhaustive_pass.cpp
|
|
inline_opaque_pass.cpp
|
|
insert_extract_elim.cpp
|
|
instruction.cpp
|
|
ir_loader.cpp
|
|
local_access_chain_convert_pass.cpp
|
|
local_single_block_elim_pass.cpp
|
|
local_single_store_elim_pass.cpp
|
|
local_ssa_elim_pass.cpp
|
|
module.cpp
|
|
eliminate_dead_functions_pass.cpp
|
|
remove_duplicates_pass.cpp
|
|
set_spec_constant_default_value_pass.cpp
|
|
optimizer.cpp
|
|
mem_pass.cpp
|
|
pass.cpp
|
|
pass_manager.cpp
|
|
strength_reduction_pass.cpp
|
|
strip_debug_info_pass.cpp
|
|
types.cpp
|
|
type_manager.cpp
|
|
unify_const_pass.cpp
|
|
)
|
|
|
|
spvtools_default_compile_options(SPIRV-Tools-opt)
|
|
target_include_directories(SPIRV-Tools-opt
|
|
PUBLIC ${spirv-tools_SOURCE_DIR}/include
|
|
PUBLIC ${SPIRV_HEADER_INCLUDE_DIR}
|
|
PRIVATE ${spirv-tools_BINARY_DIR}
|
|
)
|
|
# We need the assembling and disassembling functionalities in the main library.
|
|
target_link_libraries(SPIRV-Tools-opt
|
|
PUBLIC ${SPIRV_TOOLS})
|
|
|
|
set_property(TARGET SPIRV-Tools-opt PROPERTY FOLDER "SPIRV-Tools libraries")
|
|
|
|
if(ENABLE_SPIRV_TOOLS_INSTALL)
|
|
install(TARGETS SPIRV-Tools-opt
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
endif(ENABLE_SPIRV_TOOLS_INSTALL)
|
|
|