2019-05-27 13:34:55 +00:00
|
|
|
# Copyright (c) 2019 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.
|
|
|
|
|
|
|
|
if(SPIRV_BUILD_FUZZER)
|
2019-09-18 19:47:58 +00:00
|
|
|
|
|
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/protobufs)
|
|
|
|
|
2019-05-27 13:34:55 +00:00
|
|
|
set(PROTOBUF_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/protobufs/spvtoolsfuzz.proto)
|
|
|
|
|
2020-09-10 07:32:48 +00:00
|
|
|
set(
|
|
|
|
SPIRV_FUZZ_PROTOC_COMMAND
|
|
|
|
"protobuf::protoc"
|
|
|
|
CACHE
|
|
|
|
STRING
|
|
|
|
"The command to invoke the protobuf compiler (protoc). By default it is the protobufs::protoc CMake target. It should be overridden when cross-compiling, such as for Android.")
|
|
|
|
|
2019-05-27 13:34:55 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT protobufs/spvtoolsfuzz.pb.cc protobufs/spvtoolsfuzz.pb.h
|
2020-09-10 07:32:48 +00:00
|
|
|
COMMAND "${SPIRV_FUZZ_PROTOC_COMMAND}"
|
2019-05-27 13:34:55 +00:00
|
|
|
-I=${CMAKE_CURRENT_SOURCE_DIR}/protobufs
|
|
|
|
--cpp_out=protobufs
|
|
|
|
${PROTOBUF_SOURCE}
|
|
|
|
DEPENDS ${PROTOBUF_SOURCE}
|
|
|
|
COMMENT "Generate protobuf sources from proto definition file."
|
|
|
|
)
|
|
|
|
|
|
|
|
set(SPIRV_TOOLS_FUZZ_SOURCES
|
2020-10-02 03:53:12 +00:00
|
|
|
added_function_reducer.h
|
2021-03-20 18:51:18 +00:00
|
|
|
available_instructions.h
|
2020-02-10 23:22:34 +00:00
|
|
|
call_graph.h
|
2020-09-15 09:31:01 +00:00
|
|
|
comparator_deep_blocks_first.h
|
2020-08-26 06:49:42 +00:00
|
|
|
counter_overflow_id_source.h
|
2019-08-05 17:00:13 +00:00
|
|
|
data_descriptor.h
|
2019-10-25 11:46:52 +00:00
|
|
|
equivalence_relation.h
|
2020-08-25 17:11:37 +00:00
|
|
|
fact_manager/constant_uniform_facts.h
|
|
|
|
fact_manager/data_synonym_and_id_equation_facts.h
|
|
|
|
fact_manager/dead_block_facts.h
|
|
|
|
fact_manager/fact_manager.h
|
|
|
|
fact_manager/irrelevant_value_facts.h
|
|
|
|
fact_manager/livesafe_function_facts.h
|
2019-10-03 18:10:50 +00:00
|
|
|
force_render_red.h
|
2019-05-27 13:34:55 +00:00
|
|
|
fuzzer.h
|
|
|
|
fuzzer_context.h
|
|
|
|
fuzzer_pass.h
|
2020-02-11 23:10:57 +00:00
|
|
|
fuzzer_pass_add_access_chains.h
|
2020-09-15 22:36:23 +00:00
|
|
|
fuzzer_pass_add_bit_instruction_synonyms.h
|
2020-10-23 13:49:50 +00:00
|
|
|
fuzzer_pass_add_composite_extract.h
|
2020-08-19 12:56:03 +00:00
|
|
|
fuzzer_pass_add_composite_inserts.h
|
2020-02-04 14:00:19 +00:00
|
|
|
fuzzer_pass_add_composite_types.h
|
2020-06-30 20:13:05 +00:00
|
|
|
fuzzer_pass_add_copy_memory.h
|
2020-01-13 22:04:01 +00:00
|
|
|
fuzzer_pass_add_dead_blocks.h
|
2019-06-05 07:02:16 +00:00
|
|
|
fuzzer_pass_add_dead_breaks.h
|
2019-07-25 12:50:33 +00:00
|
|
|
fuzzer_pass_add_dead_continues.h
|
2020-03-04 14:54:08 +00:00
|
|
|
fuzzer_pass_add_equation_instructions.h
|
2020-02-10 23:22:34 +00:00
|
|
|
fuzzer_pass_add_function_calls.h
|
2020-02-05 21:07:44 +00:00
|
|
|
fuzzer_pass_add_global_variables.h
|
2020-07-08 16:07:04 +00:00
|
|
|
fuzzer_pass_add_image_sample_unused_components.h
|
2020-02-06 16:54:34 +00:00
|
|
|
fuzzer_pass_add_loads.h
|
2020-02-05 21:07:44 +00:00
|
|
|
fuzzer_pass_add_local_variables.h
|
2020-08-14 11:44:28 +00:00
|
|
|
fuzzer_pass_add_loop_preheaders.h
|
2020-09-23 13:10:02 +00:00
|
|
|
fuzzer_pass_add_loops_to_create_int_constant_synonyms.h
|
2019-10-11 08:15:47 +00:00
|
|
|
fuzzer_pass_add_no_contraction_decorations.h
|
2020-08-27 14:59:54 +00:00
|
|
|
fuzzer_pass_add_opphi_synonyms.h
|
2020-06-23 16:40:44 +00:00
|
|
|
fuzzer_pass_add_parameters.h
|
2020-07-20 12:13:07 +00:00
|
|
|
fuzzer_pass_add_relaxed_decorations.h
|
2020-02-06 16:54:34 +00:00
|
|
|
fuzzer_pass_add_stores.h
|
2020-09-23 13:10:02 +00:00
|
|
|
fuzzer_pass_add_synonyms.h
|
2020-06-16 10:21:31 +00:00
|
|
|
fuzzer_pass_add_vector_shuffle_instructions.h
|
2020-05-14 10:38:34 +00:00
|
|
|
fuzzer_pass_adjust_branch_weights.h
|
2019-10-11 06:10:47 +00:00
|
|
|
fuzzer_pass_adjust_function_controls.h
|
2019-10-10 12:34:38 +00:00
|
|
|
fuzzer_pass_adjust_loop_controls.h
|
2019-10-22 17:05:35 +00:00
|
|
|
fuzzer_pass_adjust_memory_operands_masks.h
|
2019-10-08 10:25:34 +00:00
|
|
|
fuzzer_pass_adjust_selection_controls.h
|
2019-09-18 19:47:08 +00:00
|
|
|
fuzzer_pass_apply_id_synonyms.h
|
2019-10-08 13:04:10 +00:00
|
|
|
fuzzer_pass_construct_composites.h
|
2019-09-11 22:45:20 +00:00
|
|
|
fuzzer_pass_copy_objects.h
|
2020-01-07 08:39:55 +00:00
|
|
|
fuzzer_pass_donate_modules.h
|
2020-09-11 10:48:19 +00:00
|
|
|
fuzzer_pass_duplicate_regions_with_selections.h
|
2020-10-23 13:59:08 +00:00
|
|
|
fuzzer_pass_expand_vector_reductions.h
|
2020-09-15 09:31:01 +00:00
|
|
|
fuzzer_pass_flatten_conditional_branches.h
|
2020-08-25 16:28:23 +00:00
|
|
|
fuzzer_pass_inline_functions.h
|
2020-07-03 16:37:32 +00:00
|
|
|
fuzzer_pass_invert_comparison_operators.h
|
2020-07-30 18:48:29 +00:00
|
|
|
fuzzer_pass_interchange_signedness_of_integer_operands.h
|
2020-07-15 11:58:29 +00:00
|
|
|
fuzzer_pass_interchange_zero_like_constants.h
|
2020-08-06 14:50:18 +00:00
|
|
|
fuzzer_pass_make_vector_operations_dynamic.h
|
2019-12-12 15:27:40 +00:00
|
|
|
fuzzer_pass_merge_blocks.h
|
2020-10-02 03:45:44 +00:00
|
|
|
fuzzer_pass_merge_function_returns.h
|
2020-09-01 11:45:13 +00:00
|
|
|
fuzzer_pass_mutate_pointers.h
|
2019-06-18 17:41:08 +00:00
|
|
|
fuzzer_pass_obfuscate_constants.h
|
2019-12-10 14:47:42 +00:00
|
|
|
fuzzer_pass_outline_functions.h
|
2019-05-31 08:59:06 +00:00
|
|
|
fuzzer_pass_permute_blocks.h
|
2020-03-08 14:27:05 +00:00
|
|
|
fuzzer_pass_permute_function_parameters.h
|
2021-04-26 15:53:55 +00:00
|
|
|
fuzzer_pass_permute_function_variables.h
|
2020-08-03 15:45:24 +00:00
|
|
|
fuzzer_pass_permute_instructions.h
|
2020-06-23 14:00:28 +00:00
|
|
|
fuzzer_pass_permute_phi_operands.h
|
2020-10-06 12:38:19 +00:00
|
|
|
fuzzer_pass_propagate_instructions_down.h
|
2020-08-11 09:24:32 +00:00
|
|
|
fuzzer_pass_propagate_instructions_up.h
|
2020-05-29 15:43:38 +00:00
|
|
|
fuzzer_pass_push_ids_through_variables.h
|
2020-08-06 16:30:34 +00:00
|
|
|
fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.h
|
2020-10-06 14:59:05 +00:00
|
|
|
fuzzer_pass_replace_branches_from_dead_blocks_with_exits.h
|
2020-07-23 14:14:20 +00:00
|
|
|
fuzzer_pass_replace_copy_memories_with_loads_stores.h
|
2020-07-23 07:17:45 +00:00
|
|
|
fuzzer_pass_replace_copy_objects_with_stores_loads.h
|
2020-09-01 15:28:04 +00:00
|
|
|
fuzzer_pass_replace_irrelevant_ids.h
|
2020-06-16 10:20:51 +00:00
|
|
|
fuzzer_pass_replace_linear_algebra_instructions.h
|
2020-07-27 14:17:04 +00:00
|
|
|
fuzzer_pass_replace_loads_stores_with_copy_memories.h
|
2020-09-02 00:06:38 +00:00
|
|
|
fuzzer_pass_replace_opphi_ids_from_dead_predecessors.h
|
2020-09-03 09:19:02 +00:00
|
|
|
fuzzer_pass_replace_opselects_with_conditional_branches.h
|
2020-07-09 10:03:49 +00:00
|
|
|
fuzzer_pass_replace_parameter_with_global.h
|
2020-07-21 20:02:32 +00:00
|
|
|
fuzzer_pass_replace_params_with_struct.h
|
2019-05-29 15:42:46 +00:00
|
|
|
fuzzer_pass_split_blocks.h
|
2020-03-05 08:18:39 +00:00
|
|
|
fuzzer_pass_swap_commutable_operands.h
|
2020-06-19 15:38:52 +00:00
|
|
|
fuzzer_pass_swap_conditional_branch_operands.h
|
2021-04-27 11:33:08 +00:00
|
|
|
fuzzer_pass_swap_functions.h
|
2020-03-08 22:33:24 +00:00
|
|
|
fuzzer_pass_toggle_access_chain_instruction.h
|
2020-10-01 08:54:10 +00:00
|
|
|
fuzzer_pass_wrap_regions_in_selections.h
|
2021-07-20 10:01:20 +00:00
|
|
|
fuzzer_pass_wrap_vector_synonym.h
|
2019-05-29 15:42:46 +00:00
|
|
|
fuzzer_util.h
|
2019-06-06 21:22:35 +00:00
|
|
|
id_use_descriptor.h
|
2019-10-11 09:13:06 +00:00
|
|
|
instruction_descriptor.h
|
2019-12-19 21:15:09 +00:00
|
|
|
instruction_message.h
|
2020-08-26 06:49:42 +00:00
|
|
|
overflow_id_source.h
|
2020-09-18 14:51:35 +00:00
|
|
|
pass_management/repeated_pass_instances.h
|
|
|
|
pass_management/repeated_pass_manager.h
|
|
|
|
pass_management/repeated_pass_manager_looped_with_recommendations.h
|
|
|
|
pass_management/repeated_pass_manager_random_with_recommendations.h
|
|
|
|
pass_management/repeated_pass_manager_simple.h
|
|
|
|
pass_management/repeated_pass_recommender.h
|
|
|
|
pass_management/repeated_pass_recommender_standard.h
|
2019-05-27 13:34:55 +00:00
|
|
|
protobufs/spirvfuzz_protobufs.h
|
|
|
|
pseudo_random_generator.h
|
|
|
|
random_generator.h
|
2019-06-13 13:08:33 +00:00
|
|
|
replayer.h
|
2019-07-07 07:55:30 +00:00
|
|
|
shrinker.h
|
2019-06-25 19:49:46 +00:00
|
|
|
transformation.h
|
2020-02-11 23:10:57 +00:00
|
|
|
transformation_access_chain.h
|
2020-09-15 22:36:23 +00:00
|
|
|
transformation_add_bit_instruction_synonym.h
|
2019-06-04 13:55:00 +00:00
|
|
|
transformation_add_constant_boolean.h
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_constant_composite.h
|
2020-04-02 18:25:30 +00:00
|
|
|
transformation_add_constant_null.h
|
2019-06-04 13:55:00 +00:00
|
|
|
transformation_add_constant_scalar.h
|
2020-06-30 20:13:05 +00:00
|
|
|
transformation_add_copy_memory.h
|
2020-01-13 22:04:01 +00:00
|
|
|
transformation_add_dead_block.h
|
2019-06-05 07:02:16 +00:00
|
|
|
transformation_add_dead_break.h
|
2019-07-25 12:50:33 +00:00
|
|
|
transformation_add_dead_continue.h
|
2020-10-06 11:07:56 +00:00
|
|
|
transformation_add_early_terminator_wrapper.h
|
2019-12-19 21:15:09 +00:00
|
|
|
transformation_add_function.h
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_global_undef.h
|
|
|
|
transformation_add_global_variable.h
|
2020-07-08 16:07:04 +00:00
|
|
|
transformation_add_image_sample_unused_components.h
|
2020-02-05 21:07:44 +00:00
|
|
|
transformation_add_local_variable.h
|
2020-07-30 19:18:19 +00:00
|
|
|
transformation_add_loop_preheader.h
|
2020-09-23 13:10:02 +00:00
|
|
|
transformation_add_loop_to_create_int_constant_synonym.h
|
2019-10-11 08:15:47 +00:00
|
|
|
transformation_add_no_contraction_decoration.h
|
2020-08-27 14:59:54 +00:00
|
|
|
transformation_add_opphi_synonym.h
|
2020-06-30 14:20:27 +00:00
|
|
|
transformation_add_parameter.h
|
2020-07-20 12:13:07 +00:00
|
|
|
transformation_add_relaxed_decoration.h
|
2020-06-10 00:01:15 +00:00
|
|
|
transformation_add_spec_constant_op.h
|
2020-07-12 08:59:08 +00:00
|
|
|
transformation_add_synonym.h
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_type_array.h
|
2019-06-04 13:55:00 +00:00
|
|
|
transformation_add_type_boolean.h
|
|
|
|
transformation_add_type_float.h
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_type_function.h
|
2019-06-04 13:55:00 +00:00
|
|
|
transformation_add_type_int.h
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_type_matrix.h
|
2019-06-18 17:41:08 +00:00
|
|
|
transformation_add_type_pointer.h
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_type_struct.h
|
|
|
|
transformation_add_type_vector.h
|
2020-05-14 10:38:34 +00:00
|
|
|
transformation_adjust_branch_weights.h
|
2019-10-27 18:11:07 +00:00
|
|
|
transformation_composite_construct.h
|
2019-10-28 09:33:08 +00:00
|
|
|
transformation_composite_extract.h
|
2020-08-19 12:56:03 +00:00
|
|
|
transformation_composite_insert.h
|
2020-04-20 18:02:49 +00:00
|
|
|
transformation_compute_data_synonym_fact_closure.h
|
2020-04-02 14:54:46 +00:00
|
|
|
transformation_context.h
|
2020-09-11 10:48:19 +00:00
|
|
|
transformation_duplicate_region_with_selection.h
|
2020-03-04 14:54:08 +00:00
|
|
|
transformation_equation_instruction.h
|
2020-10-23 13:59:08 +00:00
|
|
|
transformation_expand_vector_reduction.h
|
2020-09-15 09:31:01 +00:00
|
|
|
transformation_flatten_conditional_branch.h
|
2020-02-10 23:22:34 +00:00
|
|
|
transformation_function_call.h
|
2020-08-25 16:28:23 +00:00
|
|
|
transformation_inline_function.h
|
2020-07-03 16:37:32 +00:00
|
|
|
transformation_invert_comparison_operator.h
|
2020-02-06 16:54:34 +00:00
|
|
|
transformation_load.h
|
2020-08-06 14:50:18 +00:00
|
|
|
transformation_make_vector_operation_dynamic.h
|
2019-12-12 15:27:40 +00:00
|
|
|
transformation_merge_blocks.h
|
2020-10-02 03:45:44 +00:00
|
|
|
transformation_merge_function_returns.h
|
2019-05-31 08:59:06 +00:00
|
|
|
transformation_move_block_down.h
|
2020-08-03 15:45:24 +00:00
|
|
|
transformation_move_instruction_down.h
|
2020-09-01 11:45:13 +00:00
|
|
|
transformation_mutate_pointer.h
|
2019-12-10 14:47:42 +00:00
|
|
|
transformation_outline_function.h
|
2020-03-08 14:27:05 +00:00
|
|
|
transformation_permute_function_parameters.h
|
2020-06-23 14:00:28 +00:00
|
|
|
transformation_permute_phi_operands.h
|
2020-10-06 12:38:19 +00:00
|
|
|
transformation_propagate_instruction_down.h
|
2020-08-11 09:24:32 +00:00
|
|
|
transformation_propagate_instruction_up.h
|
2020-05-29 15:43:38 +00:00
|
|
|
transformation_push_id_through_variable.h
|
2020-07-10 13:02:14 +00:00
|
|
|
transformation_record_synonymous_constants.h
|
2020-08-06 16:30:34 +00:00
|
|
|
transformation_replace_add_sub_mul_with_carrying_extended.h
|
2019-06-06 21:22:35 +00:00
|
|
|
transformation_replace_boolean_constant_with_constant_binary.h
|
2020-10-06 14:59:05 +00:00
|
|
|
transformation_replace_branch_from_dead_block_with_exit.h
|
2019-06-18 17:41:08 +00:00
|
|
|
transformation_replace_constant_with_uniform.h
|
2020-07-23 14:14:20 +00:00
|
|
|
transformation_replace_copy_memory_with_load_store.h
|
2020-07-23 07:17:45 +00:00
|
|
|
transformation_replace_copy_object_with_store_load.h
|
2019-10-03 18:10:50 +00:00
|
|
|
transformation_replace_id_with_synonym.h
|
2020-09-01 15:28:04 +00:00
|
|
|
transformation_replace_irrelevant_id.h
|
2020-06-16 10:20:51 +00:00
|
|
|
transformation_replace_linear_algebra_instruction.h
|
2020-07-27 14:17:04 +00:00
|
|
|
transformation_replace_load_store_with_copy_memory.h
|
2020-09-02 00:06:38 +00:00
|
|
|
transformation_replace_opphi_id_from_dead_predecessor.h
|
2020-09-03 09:19:02 +00:00
|
|
|
transformation_replace_opselect_with_conditional_branch.h
|
2020-07-09 10:03:49 +00:00
|
|
|
transformation_replace_parameter_with_global.h
|
2020-07-21 20:02:32 +00:00
|
|
|
transformation_replace_params_with_struct.h
|
2019-10-11 06:10:47 +00:00
|
|
|
transformation_set_function_control.h
|
2019-10-10 12:34:38 +00:00
|
|
|
transformation_set_loop_control.h
|
2019-10-22 17:05:35 +00:00
|
|
|
transformation_set_memory_operands_mask.h
|
2019-10-08 10:25:34 +00:00
|
|
|
transformation_set_selection_control.h
|
2019-05-29 15:42:46 +00:00
|
|
|
transformation_split_block.h
|
2020-02-06 16:54:34 +00:00
|
|
|
transformation_store.h
|
2020-03-05 08:18:39 +00:00
|
|
|
transformation_swap_commutable_operands.h
|
2020-06-19 15:38:52 +00:00
|
|
|
transformation_swap_conditional_branch_operands.h
|
2021-04-26 15:53:55 +00:00
|
|
|
transformation_swap_function_variables.h
|
2021-04-27 11:33:08 +00:00
|
|
|
transformation_swap_two_functions.h
|
2020-03-08 22:33:24 +00:00
|
|
|
transformation_toggle_access_chain_instruction.h
|
2019-11-06 17:11:54 +00:00
|
|
|
transformation_vector_shuffle.h
|
2020-10-08 21:33:14 +00:00
|
|
|
transformation_wrap_early_terminator_in_function.h
|
2020-10-01 08:54:10 +00:00
|
|
|
transformation_wrap_region_in_selection.h
|
2021-07-20 10:01:20 +00:00
|
|
|
transformation_wrap_vector_synonym.h
|
2019-06-11 14:56:08 +00:00
|
|
|
uniform_buffer_element_descriptor.h
|
2019-05-27 13:34:55 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/protobufs/spvtoolsfuzz.pb.h
|
|
|
|
|
2020-10-02 03:53:12 +00:00
|
|
|
added_function_reducer.cpp
|
2021-03-20 18:51:18 +00:00
|
|
|
available_instructions.cpp
|
2020-02-10 23:22:34 +00:00
|
|
|
call_graph.cpp
|
2020-08-26 06:49:42 +00:00
|
|
|
counter_overflow_id_source.cpp
|
2019-08-05 17:00:13 +00:00
|
|
|
data_descriptor.cpp
|
2020-08-25 17:11:37 +00:00
|
|
|
fact_manager/constant_uniform_facts.cpp
|
|
|
|
fact_manager/data_synonym_and_id_equation_facts.cpp
|
|
|
|
fact_manager/dead_block_facts.cpp
|
|
|
|
fact_manager/fact_manager.cpp
|
|
|
|
fact_manager/irrelevant_value_facts.cpp
|
|
|
|
fact_manager/livesafe_function_facts.cpp
|
2019-10-03 18:10:50 +00:00
|
|
|
force_render_red.cpp
|
2019-05-27 13:34:55 +00:00
|
|
|
fuzzer.cpp
|
|
|
|
fuzzer_context.cpp
|
|
|
|
fuzzer_pass.cpp
|
2020-02-11 23:10:57 +00:00
|
|
|
fuzzer_pass_add_access_chains.cpp
|
2020-09-15 22:36:23 +00:00
|
|
|
fuzzer_pass_add_bit_instruction_synonyms.cpp
|
2020-10-23 13:49:50 +00:00
|
|
|
fuzzer_pass_add_composite_extract.cpp
|
2020-08-19 12:56:03 +00:00
|
|
|
fuzzer_pass_add_composite_inserts.cpp
|
2020-02-04 14:00:19 +00:00
|
|
|
fuzzer_pass_add_composite_types.cpp
|
2020-06-30 20:13:05 +00:00
|
|
|
fuzzer_pass_add_copy_memory.cpp
|
2020-01-13 22:04:01 +00:00
|
|
|
fuzzer_pass_add_dead_blocks.cpp
|
2019-06-05 07:02:16 +00:00
|
|
|
fuzzer_pass_add_dead_breaks.cpp
|
2019-07-25 12:50:33 +00:00
|
|
|
fuzzer_pass_add_dead_continues.cpp
|
2020-03-04 14:54:08 +00:00
|
|
|
fuzzer_pass_add_equation_instructions.cpp
|
2020-02-10 23:22:34 +00:00
|
|
|
fuzzer_pass_add_function_calls.cpp
|
2020-02-05 21:07:44 +00:00
|
|
|
fuzzer_pass_add_global_variables.cpp
|
2020-07-08 16:07:04 +00:00
|
|
|
fuzzer_pass_add_image_sample_unused_components.cpp
|
2020-02-06 16:54:34 +00:00
|
|
|
fuzzer_pass_add_loads.cpp
|
2020-02-05 21:07:44 +00:00
|
|
|
fuzzer_pass_add_local_variables.cpp
|
2020-08-14 11:44:28 +00:00
|
|
|
fuzzer_pass_add_loop_preheaders.cpp
|
2020-09-23 13:10:02 +00:00
|
|
|
fuzzer_pass_add_loops_to_create_int_constant_synonyms.cpp
|
2019-10-11 08:15:47 +00:00
|
|
|
fuzzer_pass_add_no_contraction_decorations.cpp
|
2020-08-27 14:59:54 +00:00
|
|
|
fuzzer_pass_add_opphi_synonyms.cpp
|
2020-06-23 16:40:44 +00:00
|
|
|
fuzzer_pass_add_parameters.cpp
|
2020-07-20 12:13:07 +00:00
|
|
|
fuzzer_pass_add_relaxed_decorations.cpp
|
2020-02-06 16:54:34 +00:00
|
|
|
fuzzer_pass_add_stores.cpp
|
2020-09-23 13:10:02 +00:00
|
|
|
fuzzer_pass_add_synonyms.cpp
|
2020-06-16 10:21:31 +00:00
|
|
|
fuzzer_pass_add_vector_shuffle_instructions.cpp
|
2020-05-14 10:38:34 +00:00
|
|
|
fuzzer_pass_adjust_branch_weights.cpp
|
2019-10-11 06:10:47 +00:00
|
|
|
fuzzer_pass_adjust_function_controls.cpp
|
2019-10-10 12:34:38 +00:00
|
|
|
fuzzer_pass_adjust_loop_controls.cpp
|
2019-10-22 17:05:35 +00:00
|
|
|
fuzzer_pass_adjust_memory_operands_masks.cpp
|
2019-10-08 10:25:34 +00:00
|
|
|
fuzzer_pass_adjust_selection_controls.cpp
|
2019-09-18 19:47:08 +00:00
|
|
|
fuzzer_pass_apply_id_synonyms.cpp
|
2019-10-08 13:04:10 +00:00
|
|
|
fuzzer_pass_construct_composites.cpp
|
2019-09-11 22:45:20 +00:00
|
|
|
fuzzer_pass_copy_objects.cpp
|
2020-01-07 08:39:55 +00:00
|
|
|
fuzzer_pass_donate_modules.cpp
|
2020-09-11 10:48:19 +00:00
|
|
|
fuzzer_pass_duplicate_regions_with_selections.cpp
|
2020-10-23 13:59:08 +00:00
|
|
|
fuzzer_pass_expand_vector_reductions.cpp
|
2020-09-15 09:31:01 +00:00
|
|
|
fuzzer_pass_flatten_conditional_branches.cpp
|
2020-08-25 16:28:23 +00:00
|
|
|
fuzzer_pass_inline_functions.cpp
|
2020-07-03 16:37:32 +00:00
|
|
|
fuzzer_pass_invert_comparison_operators.cpp
|
2020-07-30 18:48:29 +00:00
|
|
|
fuzzer_pass_interchange_signedness_of_integer_operands.cpp
|
2020-07-15 11:58:29 +00:00
|
|
|
fuzzer_pass_interchange_zero_like_constants.cpp
|
2020-08-06 14:50:18 +00:00
|
|
|
fuzzer_pass_make_vector_operations_dynamic.cpp
|
2019-12-12 15:27:40 +00:00
|
|
|
fuzzer_pass_merge_blocks.cpp
|
2020-10-02 03:45:44 +00:00
|
|
|
fuzzer_pass_merge_function_returns.cpp
|
2020-09-01 11:45:13 +00:00
|
|
|
fuzzer_pass_mutate_pointers.cpp
|
2019-06-18 17:41:08 +00:00
|
|
|
fuzzer_pass_obfuscate_constants.cpp
|
2019-12-10 14:47:42 +00:00
|
|
|
fuzzer_pass_outline_functions.cpp
|
2019-05-31 08:59:06 +00:00
|
|
|
fuzzer_pass_permute_blocks.cpp
|
2020-03-08 14:27:05 +00:00
|
|
|
fuzzer_pass_permute_function_parameters.cpp
|
2021-04-26 15:53:55 +00:00
|
|
|
fuzzer_pass_permute_function_variables.cpp
|
2020-08-03 15:45:24 +00:00
|
|
|
fuzzer_pass_permute_instructions.cpp
|
2020-06-23 14:00:28 +00:00
|
|
|
fuzzer_pass_permute_phi_operands.cpp
|
2020-10-06 12:38:19 +00:00
|
|
|
fuzzer_pass_propagate_instructions_down.cpp
|
2020-08-11 09:24:32 +00:00
|
|
|
fuzzer_pass_propagate_instructions_up.cpp
|
2020-05-29 15:43:38 +00:00
|
|
|
fuzzer_pass_push_ids_through_variables.cpp
|
2020-08-06 16:30:34 +00:00
|
|
|
fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.cpp
|
2020-10-06 14:59:05 +00:00
|
|
|
fuzzer_pass_replace_branches_from_dead_blocks_with_exits.cpp
|
2020-07-23 14:14:20 +00:00
|
|
|
fuzzer_pass_replace_copy_memories_with_loads_stores.cpp
|
2020-07-23 07:17:45 +00:00
|
|
|
fuzzer_pass_replace_copy_objects_with_stores_loads.cpp
|
2020-09-01 15:28:04 +00:00
|
|
|
fuzzer_pass_replace_irrelevant_ids.cpp
|
2020-06-16 10:20:51 +00:00
|
|
|
fuzzer_pass_replace_linear_algebra_instructions.cpp
|
2020-07-27 14:17:04 +00:00
|
|
|
fuzzer_pass_replace_loads_stores_with_copy_memories.cpp
|
2020-09-02 00:06:38 +00:00
|
|
|
fuzzer_pass_replace_opphi_ids_from_dead_predecessors.cpp
|
2020-09-03 09:19:02 +00:00
|
|
|
fuzzer_pass_replace_opselects_with_conditional_branches.cpp
|
2020-07-09 10:03:49 +00:00
|
|
|
fuzzer_pass_replace_parameter_with_global.cpp
|
2020-07-21 20:02:32 +00:00
|
|
|
fuzzer_pass_replace_params_with_struct.cpp
|
2019-05-29 15:42:46 +00:00
|
|
|
fuzzer_pass_split_blocks.cpp
|
2020-03-05 08:18:39 +00:00
|
|
|
fuzzer_pass_swap_commutable_operands.cpp
|
2020-06-19 15:38:52 +00:00
|
|
|
fuzzer_pass_swap_conditional_branch_operands.cpp
|
2021-04-27 11:33:08 +00:00
|
|
|
fuzzer_pass_swap_functions.cpp
|
2020-03-08 22:33:24 +00:00
|
|
|
fuzzer_pass_toggle_access_chain_instruction.cpp
|
2020-10-01 08:54:10 +00:00
|
|
|
fuzzer_pass_wrap_regions_in_selections.cpp
|
2021-07-20 10:01:20 +00:00
|
|
|
fuzzer_pass_wrap_vector_synonym.cpp
|
2019-05-29 15:42:46 +00:00
|
|
|
fuzzer_util.cpp
|
2019-06-06 21:22:35 +00:00
|
|
|
id_use_descriptor.cpp
|
2019-10-11 09:13:06 +00:00
|
|
|
instruction_descriptor.cpp
|
2019-12-19 21:15:09 +00:00
|
|
|
instruction_message.cpp
|
2020-08-26 06:49:42 +00:00
|
|
|
overflow_id_source.cpp
|
2020-09-18 14:51:35 +00:00
|
|
|
pass_management/repeated_pass_manager.cpp
|
|
|
|
pass_management/repeated_pass_manager_looped_with_recommendations.cpp
|
|
|
|
pass_management/repeated_pass_manager_random_with_recommendations.cpp
|
|
|
|
pass_management/repeated_pass_manager_simple.cpp
|
|
|
|
pass_management/repeated_pass_recommender.cpp
|
|
|
|
pass_management/repeated_pass_recommender_standard.cpp
|
2019-05-27 13:34:55 +00:00
|
|
|
pseudo_random_generator.cpp
|
|
|
|
random_generator.cpp
|
2019-06-13 13:08:33 +00:00
|
|
|
replayer.cpp
|
2019-07-07 07:55:30 +00:00
|
|
|
shrinker.cpp
|
2019-06-25 19:49:46 +00:00
|
|
|
transformation.cpp
|
2020-02-11 23:10:57 +00:00
|
|
|
transformation_access_chain.cpp
|
2020-09-15 22:36:23 +00:00
|
|
|
transformation_add_bit_instruction_synonym.cpp
|
2019-06-04 13:55:00 +00:00
|
|
|
transformation_add_constant_boolean.cpp
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_constant_composite.cpp
|
2020-04-02 18:25:30 +00:00
|
|
|
transformation_add_constant_null.cpp
|
2019-06-04 13:55:00 +00:00
|
|
|
transformation_add_constant_scalar.cpp
|
2020-06-30 20:13:05 +00:00
|
|
|
transformation_add_copy_memory.cpp
|
2020-01-13 22:04:01 +00:00
|
|
|
transformation_add_dead_block.cpp
|
2019-06-05 07:02:16 +00:00
|
|
|
transformation_add_dead_break.cpp
|
2019-07-25 12:50:33 +00:00
|
|
|
transformation_add_dead_continue.cpp
|
2020-10-06 11:07:56 +00:00
|
|
|
transformation_add_early_terminator_wrapper.cpp
|
2019-12-19 21:15:09 +00:00
|
|
|
transformation_add_function.cpp
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_global_undef.cpp
|
|
|
|
transformation_add_global_variable.cpp
|
2020-07-08 16:07:04 +00:00
|
|
|
transformation_add_image_sample_unused_components.cpp
|
2020-02-05 21:07:44 +00:00
|
|
|
transformation_add_local_variable.cpp
|
2020-07-30 19:18:19 +00:00
|
|
|
transformation_add_loop_preheader.cpp
|
2020-09-23 13:10:02 +00:00
|
|
|
transformation_add_loop_to_create_int_constant_synonym.cpp
|
2019-10-11 08:15:47 +00:00
|
|
|
transformation_add_no_contraction_decoration.cpp
|
2020-08-27 14:59:54 +00:00
|
|
|
transformation_add_opphi_synonym.cpp
|
2020-06-30 14:20:27 +00:00
|
|
|
transformation_add_parameter.cpp
|
2020-07-20 12:13:07 +00:00
|
|
|
transformation_add_relaxed_decoration.cpp
|
2020-06-10 00:01:15 +00:00
|
|
|
transformation_add_spec_constant_op.cpp
|
2020-07-12 08:59:08 +00:00
|
|
|
transformation_add_synonym.cpp
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_type_array.cpp
|
2019-06-04 13:55:00 +00:00
|
|
|
transformation_add_type_boolean.cpp
|
|
|
|
transformation_add_type_float.cpp
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_type_function.cpp
|
2019-06-04 13:55:00 +00:00
|
|
|
transformation_add_type_int.cpp
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_type_matrix.cpp
|
2019-06-18 17:41:08 +00:00
|
|
|
transformation_add_type_pointer.cpp
|
2019-12-16 23:54:13 +00:00
|
|
|
transformation_add_type_struct.cpp
|
|
|
|
transformation_add_type_vector.cpp
|
2020-05-14 10:38:34 +00:00
|
|
|
transformation_adjust_branch_weights.cpp
|
2019-10-27 18:11:07 +00:00
|
|
|
transformation_composite_construct.cpp
|
2019-10-28 09:33:08 +00:00
|
|
|
transformation_composite_extract.cpp
|
2020-08-19 12:56:03 +00:00
|
|
|
transformation_composite_insert.cpp
|
2020-04-20 18:02:49 +00:00
|
|
|
transformation_compute_data_synonym_fact_closure.cpp
|
2020-04-02 14:54:46 +00:00
|
|
|
transformation_context.cpp
|
2020-09-11 10:48:19 +00:00
|
|
|
transformation_duplicate_region_with_selection.cpp
|
2020-03-04 14:54:08 +00:00
|
|
|
transformation_equation_instruction.cpp
|
2020-10-23 13:59:08 +00:00
|
|
|
transformation_expand_vector_reduction.cpp
|
2020-09-15 09:31:01 +00:00
|
|
|
transformation_flatten_conditional_branch.cpp
|
2020-02-10 23:22:34 +00:00
|
|
|
transformation_function_call.cpp
|
2020-08-25 16:28:23 +00:00
|
|
|
transformation_inline_function.cpp
|
2020-07-03 16:37:32 +00:00
|
|
|
transformation_invert_comparison_operator.cpp
|
2020-02-06 16:54:34 +00:00
|
|
|
transformation_load.cpp
|
2020-08-06 14:50:18 +00:00
|
|
|
transformation_make_vector_operation_dynamic.cpp
|
2019-12-12 15:27:40 +00:00
|
|
|
transformation_merge_blocks.cpp
|
2020-10-02 03:45:44 +00:00
|
|
|
transformation_merge_function_returns.cpp
|
2019-05-31 08:59:06 +00:00
|
|
|
transformation_move_block_down.cpp
|
2020-08-03 15:45:24 +00:00
|
|
|
transformation_move_instruction_down.cpp
|
2020-09-01 11:45:13 +00:00
|
|
|
transformation_mutate_pointer.cpp
|
2019-12-10 14:47:42 +00:00
|
|
|
transformation_outline_function.cpp
|
2020-03-08 14:27:05 +00:00
|
|
|
transformation_permute_function_parameters.cpp
|
2020-06-23 14:00:28 +00:00
|
|
|
transformation_permute_phi_operands.cpp
|
2020-10-06 12:38:19 +00:00
|
|
|
transformation_propagate_instruction_down.cpp
|
2020-08-11 09:24:32 +00:00
|
|
|
transformation_propagate_instruction_up.cpp
|
2020-05-29 15:43:38 +00:00
|
|
|
transformation_push_id_through_variable.cpp
|
2020-07-10 13:02:14 +00:00
|
|
|
transformation_record_synonymous_constants.cpp
|
2020-08-06 16:30:34 +00:00
|
|
|
transformation_replace_add_sub_mul_with_carrying_extended.cpp
|
2019-06-06 21:22:35 +00:00
|
|
|
transformation_replace_boolean_constant_with_constant_binary.cpp
|
2020-10-06 14:59:05 +00:00
|
|
|
transformation_replace_branch_from_dead_block_with_exit.cpp
|
2019-06-18 17:41:08 +00:00
|
|
|
transformation_replace_constant_with_uniform.cpp
|
2020-07-23 14:14:20 +00:00
|
|
|
transformation_replace_copy_memory_with_load_store.cpp
|
2020-07-23 07:17:45 +00:00
|
|
|
transformation_replace_copy_object_with_store_load.cpp
|
2019-09-18 19:47:08 +00:00
|
|
|
transformation_replace_id_with_synonym.cpp
|
2020-09-01 15:28:04 +00:00
|
|
|
transformation_replace_irrelevant_id.cpp
|
2020-06-16 10:20:51 +00:00
|
|
|
transformation_replace_linear_algebra_instruction.cpp
|
2020-07-27 14:17:04 +00:00
|
|
|
transformation_replace_load_store_with_copy_memory.cpp
|
2020-09-02 00:06:38 +00:00
|
|
|
transformation_replace_opphi_id_from_dead_predecessor.cpp
|
2020-09-11 10:48:19 +00:00
|
|
|
transformation_replace_opselect_with_conditional_branch.cpp
|
2020-07-09 10:03:49 +00:00
|
|
|
transformation_replace_parameter_with_global.cpp
|
2020-07-21 20:02:32 +00:00
|
|
|
transformation_replace_params_with_struct.cpp
|
2019-10-11 06:10:47 +00:00
|
|
|
transformation_set_function_control.cpp
|
2019-10-10 12:34:38 +00:00
|
|
|
transformation_set_loop_control.cpp
|
2019-10-22 17:05:35 +00:00
|
|
|
transformation_set_memory_operands_mask.cpp
|
2019-10-08 10:25:34 +00:00
|
|
|
transformation_set_selection_control.cpp
|
2019-05-29 15:42:46 +00:00
|
|
|
transformation_split_block.cpp
|
2020-02-06 16:54:34 +00:00
|
|
|
transformation_store.cpp
|
2020-03-05 08:18:39 +00:00
|
|
|
transformation_swap_commutable_operands.cpp
|
2020-06-19 15:38:52 +00:00
|
|
|
transformation_swap_conditional_branch_operands.cpp
|
2021-04-26 15:53:55 +00:00
|
|
|
transformation_swap_function_variables.cpp
|
2021-04-27 11:33:08 +00:00
|
|
|
transformation_swap_two_functions.cpp
|
2020-03-08 22:33:24 +00:00
|
|
|
transformation_toggle_access_chain_instruction.cpp
|
2019-11-06 17:11:54 +00:00
|
|
|
transformation_vector_shuffle.cpp
|
2020-10-08 21:33:14 +00:00
|
|
|
transformation_wrap_early_terminator_in_function.cpp
|
2020-10-01 08:54:10 +00:00
|
|
|
transformation_wrap_region_in_selection.cpp
|
2021-07-20 10:01:20 +00:00
|
|
|
transformation_wrap_vector_synonym.cpp
|
2019-06-11 14:56:08 +00:00
|
|
|
uniform_buffer_element_descriptor.cpp
|
2019-05-27 13:34:55 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/protobufs/spvtoolsfuzz.pb.cc
|
|
|
|
)
|
|
|
|
|
2020-08-10 14:59:24 +00:00
|
|
|
if(MSVC AND (NOT ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")))
|
2019-05-27 13:34:55 +00:00
|
|
|
# Enable parallel builds across four cores for this lib
|
|
|
|
add_definitions(/MP4)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
spvtools_pch(SPIRV_TOOLS_FUZZ_SOURCES pch_source_fuzz)
|
|
|
|
|
|
|
|
add_library(SPIRV-Tools-fuzz ${SPIRV_TOOLS_FUZZ_SOURCES})
|
|
|
|
|
|
|
|
spvtools_default_compile_options(SPIRV-Tools-fuzz)
|
|
|
|
|
|
|
|
# Compilation of the auto-generated protobuf source file will yield warnings,
|
|
|
|
# which we have no control over and thus wish to ignore.
|
|
|
|
if(${COMPILER_IS_LIKE_GNU})
|
|
|
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/protobufs/spvtoolsfuzz.pb.cc PROPERTIES COMPILE_FLAGS -w)
|
|
|
|
endif()
|
|
|
|
if(MSVC)
|
|
|
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/protobufs/spvtoolsfuzz.pb.cc PROPERTIES COMPILE_FLAGS /w)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
target_include_directories(SPIRV-Tools-fuzz
|
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}>
|
2019-05-27 13:34:55 +00:00
|
|
|
PRIVATE ${spirv-tools_BINARY_DIR}
|
|
|
|
PRIVATE ${CMAKE_BINARY_DIR})
|
|
|
|
|
|
|
|
# The fuzzer reuses a lot of functionality from the SPIRV-Tools library.
|
|
|
|
target_link_libraries(SPIRV-Tools-fuzz
|
2020-10-29 13:25:26 +00:00
|
|
|
PUBLIC ${SPIRV_TOOLS_FULL_VISIBILITY}
|
2019-05-27 13:34:55 +00:00
|
|
|
PUBLIC SPIRV-Tools-opt
|
2020-10-02 03:53:12 +00:00
|
|
|
PUBLIC SPIRV-Tools-reduce
|
2019-05-27 13:34:55 +00:00
|
|
|
PUBLIC protobuf::libprotobuf)
|
|
|
|
|
|
|
|
set_property(TARGET SPIRV-Tools-fuzz PROPERTY FOLDER "SPIRV-Tools libraries")
|
|
|
|
spvtools_check_symbol_exports(SPIRV-Tools-fuzz)
|
|
|
|
|
|
|
|
if(ENABLE_SPIRV_TOOLS_INSTALL)
|
2019-09-04 16:45:26 +00:00
|
|
|
install(TARGETS SPIRV-Tools-fuzz EXPORT SPIRV-Tools-fuzzTargets
|
2019-05-27 13:34:55 +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-fuzzTargets FILE SPIRV-Tools-fuzzTarget.cmake)
|
|
|
|
|
|
|
|
spvtools_config_package_dir(SPIRV-Tools-fuzz PACKAGE_DIR)
|
|
|
|
install(EXPORT SPIRV-Tools-fuzzTargets FILE SPIRV-Tools-fuzzTarget.cmake
|
|
|
|
DESTINATION ${PACKAGE_DIR})
|
|
|
|
|
|
|
|
spvtools_generate_config_file(SPIRV-Tools-fuzz)
|
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-fuzzConfig.cmake DESTINATION ${PACKAGE_DIR})
|
2019-05-27 13:34:55 +00:00
|
|
|
endif(ENABLE_SPIRV_TOOLS_INSTALL)
|
|
|
|
|
|
|
|
endif(SPIRV_BUILD_FUZZER)
|