1 # Copyright 2018 Google Inc. All rights reserved.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 import("//build_overrides/build.gni")
16 import("//build_overrides/spirv_tools.gni")
17 if (build_with_chromium) {
18 import("//testing/test.gni")
19 import("//third_party/protobuf/proto_library.gni")
22 # SPIRV-Tools may be part of multiple projects in the Chromium tree.
23 # Only enable building executables if this is the main copy.
24 abspath = get_path_info(".", "abspath")
25 spvtools_chromium_third_party = (abspath == "//third_party/vulkan-deps/spirv-tools/src/")
26 spvtools_build_executables = build_with_chromium && spvtools_chromium_third_party
27 # Fuchsia also requires building the executables.
28 # TODO(b/158002593): Avoid the use of dependent-specific variables.
29 if (defined(is_fuchsia_tree) && is_fuchsia_tree) {
30 spvtools_build_executables = true
33 spirv_headers = spirv_tools_spirv_headers_dir
34 spirv_is_winuwp = is_win && target_os == "winuwp"
36 template("spvtools_core_tables") {
37 assert(defined(invoker.version), "Need version in $target_name generation.")
39 action("spvtools_core_tables_" + target_name) {
40 script = "utils/generate_grammar_tables.py"
42 version = invoker.version
45 "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json"
46 core_insts_file = "${target_gen_dir}/core.insts-$version.inc"
47 operand_kinds_file = "${target_gen_dir}/operand.kinds-$version.inc"
48 debuginfo_insts_file =
49 "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json"
50 cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
53 cldebuginfo100_insts_file,
62 "--spirv-core-grammar",
63 rebase_path(core_json_file, root_build_dir),
64 "--core-insts-output",
65 rebase_path(core_insts_file, root_build_dir),
66 "--extinst-debuginfo-grammar",
67 rebase_path(debuginfo_insts_file, root_build_dir),
68 "--extinst-cldebuginfo100-grammar",
69 rebase_path(cldebuginfo100_insts_file, root_build_dir),
70 "--operand-kinds-output",
71 rebase_path(operand_kinds_file, root_build_dir),
78 template("spvtools_core_enums") {
79 assert(defined(invoker.version), "Need version in $target_name generation.")
81 action("spvtools_core_enums_" + target_name) {
82 script = "utils/generate_grammar_tables.py"
84 version = invoker.version
87 "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json"
88 debuginfo_insts_file =
89 "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json"
90 cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
92 extension_enum_file = "${target_gen_dir}/extension_enum.inc"
93 extension_map_file = "${target_gen_dir}/enum_string_mapping.inc"
96 "--spirv-core-grammar",
97 rebase_path(core_json_file, root_build_dir),
98 "--extinst-debuginfo-grammar",
99 rebase_path(debuginfo_insts_file, root_build_dir),
100 "--extinst-cldebuginfo100-grammar",
101 rebase_path(cldebuginfo100_insts_file, root_build_dir),
102 "--extension-enum-output",
103 rebase_path(extension_enum_file, root_build_dir),
104 "--enum-string-mapping-output",
105 rebase_path(extension_map_file, root_build_dir),
111 debuginfo_insts_file,
112 cldebuginfo100_insts_file,
121 template("spvtools_glsl_tables") {
122 assert(defined(invoker.version), "Need version in $target_name generation.")
124 action("spvtools_glsl_tables_" + target_name) {
125 script = "utils/generate_grammar_tables.py"
127 version = invoker.version
130 "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json"
131 glsl_json_file = "${spirv_headers}/include/spirv/${version}/extinst.glsl.std.450.grammar.json"
132 debuginfo_insts_file =
133 "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json"
134 cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
136 glsl_insts_file = "${target_gen_dir}/glsl.std.450.insts.inc"
139 "--spirv-core-grammar",
140 rebase_path(core_json_file, root_build_dir),
141 "--extinst-debuginfo-grammar",
142 rebase_path(debuginfo_insts_file, root_build_dir),
143 "--extinst-cldebuginfo100-grammar",
144 rebase_path(cldebuginfo100_insts_file, root_build_dir),
145 "--extinst-glsl-grammar",
146 rebase_path(glsl_json_file, root_build_dir),
147 "--glsl-insts-output",
148 rebase_path(glsl_insts_file, root_build_dir),
155 debuginfo_insts_file,
156 cldebuginfo100_insts_file,
158 outputs = [ glsl_insts_file ]
162 template("spvtools_opencl_tables") {
163 assert(defined(invoker.version), "Need version in $target_name generation.")
165 action("spvtools_opencl_tables_" + target_name) {
166 script = "utils/generate_grammar_tables.py"
168 version = invoker.version
171 "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json"
172 opencl_json_file = "${spirv_headers}/include/spirv/${version}/extinst.opencl.std.100.grammar.json"
173 debuginfo_insts_file =
174 "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json"
175 cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
177 opencl_insts_file = "${target_gen_dir}/opencl.std.insts.inc"
180 "--spirv-core-grammar",
181 rebase_path(core_json_file, root_build_dir),
182 "--extinst-debuginfo-grammar",
183 rebase_path(debuginfo_insts_file, root_build_dir),
184 "--extinst-cldebuginfo100-grammar",
185 rebase_path(cldebuginfo100_insts_file, root_build_dir),
186 "--extinst-opencl-grammar",
187 rebase_path(opencl_json_file, root_build_dir),
188 "--opencl-insts-output",
189 rebase_path(opencl_insts_file, root_build_dir),
194 debuginfo_insts_file,
195 cldebuginfo100_insts_file,
197 outputs = [ opencl_insts_file ]
201 template("spvtools_language_header") {
202 assert(defined(invoker.name), "Need name in $target_name generation.")
204 action("spvtools_language_header_" + target_name) {
205 script = "utils/generate_language_headers.py"
208 extinst_output_path = "${target_gen_dir}/${name}.h"
212 rebase_path(invoker.grammar_file, root_build_dir),
213 "--extinst-output-path",
214 rebase_path(extinst_output_path, root_build_dir),
216 inputs = [ invoker.grammar_file ]
217 outputs = [ "${extinst_output_path}" ]
221 template("spvtools_vendor_table") {
222 assert(defined(invoker.name), "Need name in $target_name generation.")
224 action("spvtools_vendor_tables_" + target_name) {
225 script = "utils/generate_grammar_tables.py"
228 extinst_vendor_grammar =
229 "${spirv_headers}/include/spirv/unified1/extinst.${name}.grammar.json"
230 extinst_file = "${target_gen_dir}/${name}.insts.inc"
233 "--extinst-vendor-grammar",
234 rebase_path(extinst_vendor_grammar, root_build_dir),
235 "--vendor-insts-output",
236 rebase_path(extinst_file, root_build_dir),
237 "--vendor-operand-kind-prefix",
238 invoker.operand_kind_prefix,
240 inputs = [ extinst_vendor_grammar ]
241 outputs = [ extinst_file ]
245 action("spvtools_generators_inc") {
246 script = "utils/generate_registry_tables.py"
248 # TODO(dsinclair): Make work for chrome
249 xml_file = "${spirv_headers}/include/spirv/spir-v.xml"
250 inc_file = "${target_gen_dir}/generators.inc"
252 sources = [ xml_file ]
253 outputs = [ inc_file ]
256 rebase_path(xml_file, root_build_dir),
258 rebase_path(inc_file, root_build_dir),
262 action("spvtools_build_version") {
263 script = "utils/update_build_version.py"
265 changes_file = "CHANGES"
266 inc_file = "${target_gen_dir}/build-version.inc"
268 outputs = [ inc_file ]
270 rebase_path(changes_file, root_build_dir),
271 rebase_path(inc_file, root_build_dir),
275 spvtools_core_tables("unified1") {
278 spvtools_core_enums("unified1") {
281 spvtools_glsl_tables("glsl1-0") {
284 spvtools_opencl_tables("opencl1-0") {
287 spvtools_language_header("debuginfo") {
290 "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json"
292 spvtools_language_header("cldebuginfo100") {
293 name = "OpenCLDebugInfo100"
294 grammar_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
296 spvtools_language_header("vkdebuginfo100") {
297 name = "NonSemanticShaderDebugInfo100"
298 grammar_file = "${spirv_headers}/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json"
301 spvtools_vendor_tables = [
303 "spv-amd-shader-explicit-vertex-parameter",
307 "spv-amd-shader-trinary-minmax",
311 "spv-amd-gcn-shader",
315 "spv-amd-shader-ballot",
323 "opencl.debuginfo.100",
327 "nonsemantic.clspvreflection",
331 "nonsemantic.vkspreflection",
335 "nonsemantic.shader.debuginfo.100",
340 foreach(table_def, spvtools_vendor_tables) {
341 spvtools_vendor_table(table_def[0]) {
343 operand_kind_prefix = table_def[1]
347 config("spvtools_public_config") {
348 include_dirs = [ "include" ]
351 config("spvtools_include_gen_dirs") {
352 include_dirs = [ "$target_gen_dir" ]
355 config("spvtools_internal_config") {
358 "${spirv_headers}/include",
362 ":spvtools_public_config",
363 ":spvtools_include_gen_dirs",
369 "-Wno-implicit-fallthrough",
371 "-Wno-unreachable-code-break",
372 "-Wno-unreachable-code-return",
374 } else if (!is_win) {
375 # Work around a false-positive on a Skia GCC 10 builder.
376 cflags += [ "-Wno-format-truncation" ]
378 # Make MSVC report the correct value for __cplusplus
379 cflags += [ "/Zc:__cplusplus" ]
383 cflags += [ "-std=c++17" ]
385 cflags += [ "/std:c++17" ]
389 source_set("spvtools_headers") {
391 "include/spirv-tools/libspirv.h",
392 "include/spirv-tools/libspirv.hpp",
393 "include/spirv-tools/linker.hpp",
394 "include/spirv-tools/optimizer.hpp",
397 public_configs = [ ":spvtools_public_config" ]
400 group("spvtools_language_headers") {
402 ":spvtools_language_header_cldebuginfo100",
403 ":spvtools_language_header_debuginfo",
404 ":spvtools_language_header_vkdebuginfo100",
408 static_library("spvtools") {
410 ":spvtools_core_tables_unified1",
411 ":spvtools_generators_inc",
412 ":spvtools_glsl_tables_glsl1-0",
413 ":spvtools_language_header_cldebuginfo100",
414 ":spvtools_language_header_debuginfo",
415 ":spvtools_language_header_vkdebuginfo100",
416 ":spvtools_opencl_tables_opencl1-0",
418 foreach(table_def, spvtools_vendor_tables) {
419 target_name = table_def[0]
420 deps += [ ":spvtools_vendor_tables_$target_name" ]
424 "source/assembly_grammar.cpp",
425 "source/assembly_grammar.h",
429 "source/common_debug_info.h",
430 "source/diagnostic.cpp",
431 "source/diagnostic.h",
432 "source/disassemble.cpp",
433 "source/disassemble.h",
435 "source/enum_string_mapping.cpp",
436 "source/enum_string_mapping.h",
437 "source/ext_inst.cpp",
439 "source/extensions.cpp",
440 "source/extensions.h",
441 "source/instruction.h",
442 "source/latest_version_glsl_std_450_header.h",
443 "source/latest_version_opencl_std_header.h",
444 "source/latest_version_spirv_header.h",
445 "source/libspirv.cpp",
447 "source/name_mapper.cpp",
448 "source/name_mapper.h",
451 "source/operand.cpp",
453 "source/parsed_operand.cpp",
454 "source/parsed_operand.h",
457 "source/spirv_constant.h",
458 "source/spirv_definition.h",
459 "source/spirv_endian.cpp",
460 "source/spirv_endian.h",
461 "source/spirv_fuzzer_options.cpp",
462 "source/spirv_fuzzer_options.h",
463 "source/spirv_optimizer_options.cpp",
464 "source/spirv_optimizer_options.h",
465 "source/spirv_reducer_options.cpp",
466 "source/spirv_reducer_options.h",
467 "source/spirv_target_env.cpp",
468 "source/spirv_target_env.h",
469 "source/spirv_validator_options.cpp",
470 "source/spirv_validator_options.h",
475 "source/text_handler.cpp",
476 "source/text_handler.h",
477 "source/to_string.cpp",
478 "source/to_string.h",
479 "source/util/bit_vector.cpp",
480 "source/util/bit_vector.h",
481 "source/util/bitutils.h",
482 "source/util/hash_combine.h",
483 "source/util/hex_float.h",
484 "source/util/ilist.h",
485 "source/util/ilist_node.h",
486 "source/util/make_unique.h",
487 "source/util/parse_number.cpp",
488 "source/util/parse_number.h",
489 "source/util/small_vector.h",
490 "source/util/string_utils.cpp",
491 "source/util/string_utils.h",
492 "source/util/timer.cpp",
493 "source/util/timer.h",
497 ":spvtools_core_enums_unified1",
499 "${spirv_headers}:spv_headers",
502 if (build_with_chromium) {
503 configs -= [ "//build/config/compiler:chromium_code" ]
504 configs += [ "//build/config/compiler:no_chromium_code" ]
506 configs += [ ":spvtools_internal_config" ]
509 static_library("spvtools_val") {
511 "source/val/basic_block.cpp",
512 "source/val/basic_block.h",
513 "source/val/construct.cpp",
514 "source/val/construct.h",
515 "source/val/decoration.h",
516 "source/val/function.cpp",
517 "source/val/function.h",
518 "source/val/instruction.cpp",
519 "source/val/validate.cpp",
520 "source/val/validate.h",
521 "source/val/validate_adjacency.cpp",
522 "source/val/validate_annotation.cpp",
523 "source/val/validate_arithmetics.cpp",
524 "source/val/validate_atomics.cpp",
525 "source/val/validate_barriers.cpp",
526 "source/val/validate_bitwise.cpp",
527 "source/val/validate_builtins.cpp",
528 "source/val/validate_capability.cpp",
529 "source/val/validate_cfg.cpp",
530 "source/val/validate_composites.cpp",
531 "source/val/validate_constants.cpp",
532 "source/val/validate_conversion.cpp",
533 "source/val/validate_debug.cpp",
534 "source/val/validate_decorations.cpp",
535 "source/val/validate_derivatives.cpp",
536 "source/val/validate_execution_limitations.cpp",
537 "source/val/validate_extensions.cpp",
538 "source/val/validate_function.cpp",
539 "source/val/validate_id.cpp",
540 "source/val/validate_image.cpp",
541 "source/val/validate_instruction.cpp",
542 "source/val/validate_interfaces.cpp",
543 "source/val/validate_layout.cpp",
544 "source/val/validate_literals.cpp",
545 "source/val/validate_logicals.cpp",
546 "source/val/validate_memory.cpp",
547 "source/val/validate_memory_semantics.cpp",
548 "source/val/validate_memory_semantics.h",
549 "source/val/validate_mesh_shading.cpp",
550 "source/val/validate_misc.cpp",
551 "source/val/validate_mode_setting.cpp",
552 "source/val/validate_non_uniform.cpp",
553 "source/val/validate_primitives.cpp",
554 "source/val/validate_ray_query.cpp",
555 "source/val/validate_ray_tracing.cpp",
556 "source/val/validate_ray_tracing_reorder.cpp",
557 "source/val/validate_scopes.cpp",
558 "source/val/validate_scopes.h",
559 "source/val/validate_small_type_uses.cpp",
560 "source/val/validate_tensor_layout.cpp",
561 "source/val/validate_type.cpp",
562 "source/val/validation_state.cpp",
563 "source/val/validation_state.h",
568 ":spvtools_language_header_cldebuginfo100",
569 ":spvtools_language_header_debuginfo",
570 ":spvtools_language_header_vkdebuginfo100",
572 public_deps = [ ":spvtools_headers" ]
574 if (build_with_chromium) {
575 configs -= [ "//build/config/compiler:chromium_code" ]
576 configs += [ "//build/config/compiler:no_chromium_code" ]
578 configs += [ ":spvtools_internal_config" ]
581 static_library("spvtools_opt") {
583 "source/opt/aggressive_dead_code_elim_pass.cpp",
584 "source/opt/aggressive_dead_code_elim_pass.h",
585 "source/opt/amd_ext_to_khr.cpp",
586 "source/opt/amd_ext_to_khr.h",
587 "source/opt/analyze_live_input_pass.cpp",
588 "source/opt/analyze_live_input_pass.h",
589 "source/opt/basic_block.cpp",
590 "source/opt/basic_block.h",
591 "source/opt/block_merge_pass.cpp",
592 "source/opt/block_merge_pass.h",
593 "source/opt/block_merge_util.cpp",
594 "source/opt/block_merge_util.h",
595 "source/opt/build_module.cpp",
596 "source/opt/build_module.h",
597 "source/opt/ccp_pass.cpp",
598 "source/opt/ccp_pass.h",
599 "source/opt/cfg.cpp",
601 "source/opt/cfg_cleanup_pass.cpp",
602 "source/opt/cfg_cleanup_pass.h",
603 "source/opt/code_sink.cpp",
604 "source/opt/code_sink.h",
605 "source/opt/combine_access_chains.cpp",
606 "source/opt/combine_access_chains.h",
607 "source/opt/compact_ids_pass.cpp",
608 "source/opt/compact_ids_pass.h",
609 "source/opt/composite.cpp",
610 "source/opt/composite.h",
611 "source/opt/const_folding_rules.cpp",
612 "source/opt/const_folding_rules.h",
613 "source/opt/constants.cpp",
614 "source/opt/constants.h",
615 "source/opt/control_dependence.cpp",
616 "source/opt/control_dependence.h",
617 "source/opt/convert_to_half_pass.cpp",
618 "source/opt/convert_to_half_pass.h",
619 "source/opt/convert_to_sampled_image_pass.cpp",
620 "source/opt/convert_to_sampled_image_pass.h",
621 "source/opt/copy_prop_arrays.cpp",
622 "source/opt/copy_prop_arrays.h",
623 "source/opt/dataflow.cpp",
624 "source/opt/dataflow.h",
625 "source/opt/dead_branch_elim_pass.cpp",
626 "source/opt/dead_branch_elim_pass.h",
627 "source/opt/dead_insert_elim_pass.cpp",
628 "source/opt/dead_insert_elim_pass.h",
629 "source/opt/dead_variable_elimination.cpp",
630 "source/opt/dead_variable_elimination.h",
631 "source/opt/debug_info_manager.cpp",
632 "source/opt/debug_info_manager.h",
633 "source/opt/decoration_manager.cpp",
634 "source/opt/decoration_manager.h",
635 "source/opt/def_use_manager.cpp",
636 "source/opt/def_use_manager.h",
637 "source/opt/desc_sroa.cpp",
638 "source/opt/desc_sroa.h",
639 "source/opt/desc_sroa_util.cpp",
640 "source/opt/desc_sroa_util.h",
641 "source/opt/dominator_analysis.cpp",
642 "source/opt/dominator_analysis.h",
643 "source/opt/dominator_tree.cpp",
644 "source/opt/dominator_tree.h",
645 "source/opt/eliminate_dead_constant_pass.cpp",
646 "source/opt/eliminate_dead_constant_pass.h",
647 "source/opt/eliminate_dead_functions_pass.cpp",
648 "source/opt/eliminate_dead_functions_pass.h",
649 "source/opt/eliminate_dead_functions_util.cpp",
650 "source/opt/eliminate_dead_functions_util.h",
651 "source/opt/eliminate_dead_io_components_pass.cpp",
652 "source/opt/eliminate_dead_io_components_pass.h",
653 "source/opt/eliminate_dead_members_pass.cpp",
654 "source/opt/eliminate_dead_members_pass.h",
655 "source/opt/eliminate_dead_output_stores_pass.cpp",
656 "source/opt/eliminate_dead_output_stores_pass.h",
657 "source/opt/empty_pass.h",
658 "source/opt/feature_manager.cpp",
659 "source/opt/feature_manager.h",
660 "source/opt/fix_func_call_arguments.cpp",
661 "source/opt/fix_func_call_arguments.h",
662 "source/opt/fix_storage_class.cpp",
663 "source/opt/fix_storage_class.h",
664 "source/opt/flatten_decoration_pass.cpp",
665 "source/opt/flatten_decoration_pass.h",
666 "source/opt/fold.cpp",
668 "source/opt/fold_spec_constant_op_and_composite_pass.cpp",
669 "source/opt/fold_spec_constant_op_and_composite_pass.h",
670 "source/opt/folding_rules.cpp",
671 "source/opt/folding_rules.h",
672 "source/opt/freeze_spec_constant_value_pass.cpp",
673 "source/opt/freeze_spec_constant_value_pass.h",
674 "source/opt/function.cpp",
675 "source/opt/function.h",
676 "source/opt/graphics_robust_access_pass.cpp",
677 "source/opt/graphics_robust_access_pass.h",
678 "source/opt/if_conversion.cpp",
679 "source/opt/if_conversion.h",
680 "source/opt/inline_exhaustive_pass.cpp",
681 "source/opt/inline_exhaustive_pass.h",
682 "source/opt/inline_opaque_pass.cpp",
683 "source/opt/inline_opaque_pass.h",
684 "source/opt/inline_pass.cpp",
685 "source/opt/inline_pass.h",
686 "source/opt/instruction.cpp",
687 "source/opt/instruction.h",
688 "source/opt/instruction_list.cpp",
689 "source/opt/instruction_list.h",
690 "source/opt/interface_var_sroa.cpp",
691 "source/opt/interface_var_sroa.h",
692 "source/opt/interp_fixup_pass.cpp",
693 "source/opt/interp_fixup_pass.h",
694 "source/opt/invocation_interlock_placement_pass.cpp",
695 "source/opt/invocation_interlock_placement_pass.h",
696 "source/opt/ir_builder.h",
697 "source/opt/ir_context.cpp",
698 "source/opt/ir_context.h",
699 "source/opt/ir_loader.cpp",
700 "source/opt/ir_loader.h",
701 "source/opt/iterator.h",
702 "source/opt/licm_pass.cpp",
703 "source/opt/licm_pass.h",
704 "source/opt/liveness.cpp",
705 "source/opt/liveness.h",
706 "source/opt/local_access_chain_convert_pass.cpp",
707 "source/opt/local_access_chain_convert_pass.h",
708 "source/opt/local_redundancy_elimination.cpp",
709 "source/opt/local_redundancy_elimination.h",
710 "source/opt/local_single_block_elim_pass.cpp",
711 "source/opt/local_single_block_elim_pass.h",
712 "source/opt/local_single_store_elim_pass.cpp",
713 "source/opt/local_single_store_elim_pass.h",
715 "source/opt/loop_dependence.cpp",
716 "source/opt/loop_dependence.h",
717 "source/opt/loop_dependence_helpers.cpp",
718 "source/opt/loop_descriptor.cpp",
719 "source/opt/loop_descriptor.h",
720 "source/opt/loop_fission.cpp",
721 "source/opt/loop_fission.h",
722 "source/opt/loop_fusion.cpp",
723 "source/opt/loop_fusion.h",
724 "source/opt/loop_fusion_pass.cpp",
725 "source/opt/loop_fusion_pass.h",
726 "source/opt/loop_peeling.cpp",
727 "source/opt/loop_peeling.h",
728 "source/opt/loop_unroller.cpp",
729 "source/opt/loop_unroller.h",
730 "source/opt/loop_unswitch_pass.cpp",
731 "source/opt/loop_unswitch_pass.h",
732 "source/opt/loop_utils.cpp",
733 "source/opt/loop_utils.h",
734 "source/opt/mem_pass.cpp",
735 "source/opt/mem_pass.h",
736 "source/opt/merge_return_pass.cpp",
737 "source/opt/merge_return_pass.h",
738 "source/opt/modify_maximal_reconvergence.cpp",
739 "source/opt/modify_maximal_reconvergence.h",
740 "source/opt/module.cpp",
741 "source/opt/module.h",
742 "source/opt/null_pass.h",
743 "source/opt/opextinst_forward_ref_fixup_pass.cpp",
744 "source/opt/opextinst_forward_ref_fixup_pass.h",
745 "source/opt/optimizer.cpp",
746 "source/opt/pass.cpp",
748 "source/opt/pass_manager.cpp",
749 "source/opt/pass_manager.h",
750 "source/opt/passes.h",
751 "source/opt/private_to_local_pass.cpp",
752 "source/opt/private_to_local_pass.h",
753 "source/opt/propagator.cpp",
754 "source/opt/propagator.h",
755 "source/opt/reduce_load_size.cpp",
756 "source/opt/reduce_load_size.h",
757 "source/opt/redundancy_elimination.cpp",
758 "source/opt/redundancy_elimination.h",
759 "source/opt/reflect.h",
760 "source/opt/register_pressure.cpp",
761 "source/opt/register_pressure.h",
762 "source/opt/relax_float_ops_pass.cpp",
763 "source/opt/relax_float_ops_pass.h",
764 "source/opt/remove_dontinline_pass.cpp",
765 "source/opt/remove_dontinline_pass.h",
766 "source/opt/remove_duplicates_pass.cpp",
767 "source/opt/remove_duplicates_pass.h",
768 "source/opt/remove_unused_interface_variables_pass.cpp",
769 "source/opt/remove_unused_interface_variables_pass.h",
770 "source/opt/replace_desc_array_access_using_var_index.cpp",
771 "source/opt/replace_desc_array_access_using_var_index.h",
772 "source/opt/replace_invalid_opc.cpp",
773 "source/opt/replace_invalid_opc.h",
774 "source/opt/scalar_analysis.cpp",
775 "source/opt/scalar_analysis.h",
776 "source/opt/scalar_analysis_nodes.h",
777 "source/opt/scalar_analysis_simplification.cpp",
778 "source/opt/scalar_replacement_pass.cpp",
779 "source/opt/scalar_replacement_pass.h",
780 "source/opt/set_spec_constant_default_value_pass.cpp",
781 "source/opt/set_spec_constant_default_value_pass.h",
782 "source/opt/simplification_pass.cpp",
783 "source/opt/simplification_pass.h",
784 "source/opt/spread_volatile_semantics.cpp",
785 "source/opt/spread_volatile_semantics.h",
786 "source/opt/ssa_rewrite_pass.cpp",
787 "source/opt/ssa_rewrite_pass.h",
788 "source/opt/strength_reduction_pass.cpp",
789 "source/opt/strength_reduction_pass.h",
790 "source/opt/strip_debug_info_pass.cpp",
791 "source/opt/strip_debug_info_pass.h",
792 "source/opt/strip_nonsemantic_info_pass.cpp",
793 "source/opt/strip_nonsemantic_info_pass.h",
794 "source/opt/struct_packing_pass.cpp",
795 "source/opt/struct_packing_pass.h",
796 "source/opt/struct_cfg_analysis.cpp",
797 "source/opt/struct_cfg_analysis.h",
798 "source/opt/switch_descriptorset_pass.cpp",
799 "source/opt/switch_descriptorset_pass.h",
800 "source/opt/tree_iterator.h",
801 "source/opt/trim_capabilities_pass.cpp",
802 "source/opt/trim_capabilities_pass.h",
803 "source/opt/type_manager.cpp",
804 "source/opt/type_manager.h",
805 "source/opt/types.cpp",
806 "source/opt/types.h",
807 "source/opt/unify_const_pass.cpp",
808 "source/opt/unify_const_pass.h",
809 "source/opt/upgrade_memory_model.cpp",
810 "source/opt/upgrade_memory_model.h",
811 "source/opt/value_number_table.cpp",
812 "source/opt/value_number_table.h",
813 "source/opt/vector_dce.cpp",
814 "source/opt/vector_dce.h",
815 "source/opt/workaround1209.cpp",
816 "source/opt/workaround1209.h",
817 "source/opt/wrap_opkill.cpp",
818 "source/opt/wrap_opkill.h",
823 ":spvtools_language_header_debuginfo",
824 ":spvtools_vendor_tables_spv-amd-shader-ballot",
828 ":spvtools_language_header_cldebuginfo100",
829 ":spvtools_language_header_vkdebuginfo100",
832 if (build_with_chromium) {
833 configs -= [ "//build/config/compiler:chromium_code" ]
834 configs += [ "//build/config/compiler:no_chromium_code" ]
836 configs += [ ":spvtools_internal_config" ]
839 static_library("spvtools_link") {
840 sources = [ "source/link/linker.cpp" ]
846 public_deps = [ ":spvtools_headers" ]
847 if (build_with_chromium) {
848 configs -= [ "//build/config/compiler:chromium_code" ]
849 configs += [ "//build/config/compiler:no_chromium_code" ]
851 configs += [ ":spvtools_internal_config" ]
854 static_library("spvtools_reduce") {
856 "source/reduce/change_operand_reduction_opportunity.cpp",
857 "source/reduce/change_operand_reduction_opportunity.h",
858 "source/reduce/change_operand_to_undef_reduction_opportunity.cpp",
859 "source/reduce/change_operand_to_undef_reduction_opportunity.h",
860 "source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.cpp",
861 "source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.h",
862 "source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.cpp",
863 "source/reduce/conditional_branch_to_simple_conditional_branch_reduction_opportunity.h",
864 "source/reduce/merge_blocks_reduction_opportunity.cpp",
865 "source/reduce/merge_blocks_reduction_opportunity.h",
866 "source/reduce/merge_blocks_reduction_opportunity_finder.cpp",
867 "source/reduce/merge_blocks_reduction_opportunity_finder.h",
868 "source/reduce/operand_to_const_reduction_opportunity_finder.cpp",
869 "source/reduce/operand_to_const_reduction_opportunity_finder.h",
870 "source/reduce/operand_to_dominating_id_reduction_opportunity_finder.cpp",
871 "source/reduce/operand_to_dominating_id_reduction_opportunity_finder.h",
872 "source/reduce/operand_to_undef_reduction_opportunity_finder.cpp",
873 "source/reduce/operand_to_undef_reduction_opportunity_finder.h",
874 "source/reduce/reducer.cpp",
875 "source/reduce/reducer.h",
876 "source/reduce/reduction_opportunity.cpp",
877 "source/reduce/reduction_opportunity.h",
878 "source/reduce/reduction_opportunity_finder.cpp",
879 "source/reduce/reduction_opportunity_finder.h",
880 "source/reduce/reduction_pass.cpp",
881 "source/reduce/reduction_pass.h",
882 "source/reduce/reduction_util.cpp",
883 "source/reduce/reduction_util.h",
884 "source/reduce/remove_block_reduction_opportunity.cpp",
885 "source/reduce/remove_block_reduction_opportunity.h",
886 "source/reduce/remove_block_reduction_opportunity_finder.cpp",
887 "source/reduce/remove_block_reduction_opportunity_finder.h",
888 "source/reduce/remove_function_reduction_opportunity.cpp",
889 "source/reduce/remove_function_reduction_opportunity.h",
890 "source/reduce/remove_function_reduction_opportunity_finder.cpp",
891 "source/reduce/remove_function_reduction_opportunity_finder.h",
892 "source/reduce/remove_instruction_reduction_opportunity.cpp",
893 "source/reduce/remove_instruction_reduction_opportunity.h",
894 "source/reduce/remove_selection_reduction_opportunity.cpp",
895 "source/reduce/remove_selection_reduction_opportunity.h",
896 "source/reduce/remove_selection_reduction_opportunity_finder.cpp",
897 "source/reduce/remove_selection_reduction_opportunity_finder.h",
898 "source/reduce/remove_struct_member_reduction_opportunity.cpp",
899 "source/reduce/remove_struct_member_reduction_opportunity.h",
900 "source/reduce/remove_unused_instruction_reduction_opportunity_finder.cpp",
901 "source/reduce/remove_unused_instruction_reduction_opportunity_finder.h",
902 "source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp",
903 "source/reduce/remove_unused_struct_member_reduction_opportunity_finder.h",
904 "source/reduce/simple_conditional_branch_to_branch_opportunity_finder.cpp",
905 "source/reduce/simple_conditional_branch_to_branch_opportunity_finder.h",
906 "source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.cpp",
907 "source/reduce/simple_conditional_branch_to_branch_reduction_opportunity.h",
908 "source/reduce/structured_construct_to_block_reduction_opportunity.cpp",
909 "source/reduce/structured_construct_to_block_reduction_opportunity.h",
910 "source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp",
911 "source/reduce/structured_construct_to_block_reduction_opportunity_finder.h",
912 "source/reduce/structured_loop_to_selection_reduction_opportunity.cpp",
913 "source/reduce/structured_loop_to_selection_reduction_opportunity.h",
914 "source/reduce/structured_loop_to_selection_reduction_opportunity_finder.cpp",
915 "source/reduce/structured_loop_to_selection_reduction_opportunity_finder.h",
921 public_deps = [ ":spvtools_headers" ]
922 if (build_with_chromium) {
923 configs -= [ "//build/config/compiler:chromium_code" ]
924 configs += [ "//build/config/compiler:no_chromium_code" ]
926 configs += [ ":spvtools_internal_config" ]
929 if (build_with_chromium && spvtools_build_executables) {
930 # The spirv-fuzz library is only built when in a Chromium checkout
931 # due to its dependency on protobuf.
933 proto_library("spvtools_fuzz_proto") {
934 sources = [ "source/fuzz/protobufs/spvtoolsfuzz.proto" ]
935 generate_python = false
936 use_protobuf_full = true
939 static_library("spvtools_fuzz") {
941 "source/fuzz/added_function_reducer.cpp",
942 "source/fuzz/added_function_reducer.h",
943 "source/fuzz/available_instructions.cpp",
944 "source/fuzz/available_instructions.h",
945 "source/fuzz/call_graph.cpp",
946 "source/fuzz/call_graph.h",
947 "source/fuzz/comparator_deep_blocks_first.h",
948 "source/fuzz/counter_overflow_id_source.cpp",
949 "source/fuzz/counter_overflow_id_source.h",
950 "source/fuzz/data_descriptor.cpp",
951 "source/fuzz/data_descriptor.h",
952 "source/fuzz/equivalence_relation.h",
953 "source/fuzz/fact_manager/constant_uniform_facts.cpp",
954 "source/fuzz/fact_manager/constant_uniform_facts.h",
955 "source/fuzz/fact_manager/data_synonym_and_id_equation_facts.cpp",
956 "source/fuzz/fact_manager/data_synonym_and_id_equation_facts.h",
957 "source/fuzz/fact_manager/dead_block_facts.cpp",
958 "source/fuzz/fact_manager/dead_block_facts.h",
959 "source/fuzz/fact_manager/fact_manager.cpp",
960 "source/fuzz/fact_manager/fact_manager.h",
961 "source/fuzz/fact_manager/irrelevant_value_facts.cpp",
962 "source/fuzz/fact_manager/irrelevant_value_facts.h",
963 "source/fuzz/fact_manager/livesafe_function_facts.cpp",
964 "source/fuzz/fact_manager/livesafe_function_facts.h",
965 "source/fuzz/force_render_red.cpp",
966 "source/fuzz/force_render_red.h",
967 "source/fuzz/fuzzer.cpp",
968 "source/fuzz/fuzzer.h",
969 "source/fuzz/fuzzer_context.cpp",
970 "source/fuzz/fuzzer_context.h",
971 "source/fuzz/fuzzer_pass.cpp",
972 "source/fuzz/fuzzer_pass.h",
973 "source/fuzz/fuzzer_pass_add_access_chains.cpp",
974 "source/fuzz/fuzzer_pass_add_access_chains.h",
975 "source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.cpp",
976 "source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.h",
977 "source/fuzz/fuzzer_pass_add_composite_extract.cpp",
978 "source/fuzz/fuzzer_pass_add_composite_extract.h",
979 "source/fuzz/fuzzer_pass_add_composite_inserts.cpp",
980 "source/fuzz/fuzzer_pass_add_composite_inserts.h",
981 "source/fuzz/fuzzer_pass_add_composite_types.cpp",
982 "source/fuzz/fuzzer_pass_add_composite_types.h",
983 "source/fuzz/fuzzer_pass_add_copy_memory.cpp",
984 "source/fuzz/fuzzer_pass_add_copy_memory.h",
985 "source/fuzz/fuzzer_pass_add_dead_blocks.cpp",
986 "source/fuzz/fuzzer_pass_add_dead_blocks.h",
987 "source/fuzz/fuzzer_pass_add_dead_breaks.cpp",
988 "source/fuzz/fuzzer_pass_add_dead_breaks.h",
989 "source/fuzz/fuzzer_pass_add_dead_continues.cpp",
990 "source/fuzz/fuzzer_pass_add_dead_continues.h",
991 "source/fuzz/fuzzer_pass_add_equation_instructions.cpp",
992 "source/fuzz/fuzzer_pass_add_equation_instructions.h",
993 "source/fuzz/fuzzer_pass_add_function_calls.cpp",
994 "source/fuzz/fuzzer_pass_add_function_calls.h",
995 "source/fuzz/fuzzer_pass_add_global_variables.cpp",
996 "source/fuzz/fuzzer_pass_add_global_variables.h",
997 "source/fuzz/fuzzer_pass_add_image_sample_unused_components.cpp",
998 "source/fuzz/fuzzer_pass_add_image_sample_unused_components.h",
999 "source/fuzz/fuzzer_pass_add_loads.cpp",
1000 "source/fuzz/fuzzer_pass_add_loads.h",
1001 "source/fuzz/fuzzer_pass_add_local_variables.cpp",
1002 "source/fuzz/fuzzer_pass_add_local_variables.h",
1003 "source/fuzz/fuzzer_pass_add_loop_preheaders.cpp",
1004 "source/fuzz/fuzzer_pass_add_loop_preheaders.h",
1005 "source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.cpp",
1006 "source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.h",
1007 "source/fuzz/fuzzer_pass_add_no_contraction_decorations.cpp",
1008 "source/fuzz/fuzzer_pass_add_no_contraction_decorations.h",
1009 "source/fuzz/fuzzer_pass_add_opphi_synonyms.cpp",
1010 "source/fuzz/fuzzer_pass_add_opphi_synonyms.h",
1011 "source/fuzz/fuzzer_pass_add_parameters.cpp",
1012 "source/fuzz/fuzzer_pass_add_parameters.h",
1013 "source/fuzz/fuzzer_pass_add_relaxed_decorations.cpp",
1014 "source/fuzz/fuzzer_pass_add_relaxed_decorations.h",
1015 "source/fuzz/fuzzer_pass_add_stores.cpp",
1016 "source/fuzz/fuzzer_pass_add_stores.h",
1017 "source/fuzz/fuzzer_pass_add_synonyms.cpp",
1018 "source/fuzz/fuzzer_pass_add_synonyms.h",
1019 "source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.cpp",
1020 "source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.h",
1021 "source/fuzz/fuzzer_pass_adjust_branch_weights.cpp",
1022 "source/fuzz/fuzzer_pass_adjust_branch_weights.h",
1023 "source/fuzz/fuzzer_pass_adjust_function_controls.cpp",
1024 "source/fuzz/fuzzer_pass_adjust_function_controls.h",
1025 "source/fuzz/fuzzer_pass_adjust_loop_controls.cpp",
1026 "source/fuzz/fuzzer_pass_adjust_loop_controls.h",
1027 "source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp",
1028 "source/fuzz/fuzzer_pass_adjust_memory_operands_masks.h",
1029 "source/fuzz/fuzzer_pass_adjust_selection_controls.cpp",
1030 "source/fuzz/fuzzer_pass_adjust_selection_controls.h",
1031 "source/fuzz/fuzzer_pass_apply_id_synonyms.cpp",
1032 "source/fuzz/fuzzer_pass_apply_id_synonyms.h",
1033 "source/fuzz/fuzzer_pass_construct_composites.cpp",
1034 "source/fuzz/fuzzer_pass_construct_composites.h",
1035 "source/fuzz/fuzzer_pass_copy_objects.cpp",
1036 "source/fuzz/fuzzer_pass_copy_objects.h",
1037 "source/fuzz/fuzzer_pass_donate_modules.cpp",
1038 "source/fuzz/fuzzer_pass_donate_modules.h",
1039 "source/fuzz/fuzzer_pass_duplicate_regions_with_selections.cpp",
1040 "source/fuzz/fuzzer_pass_duplicate_regions_with_selections.h",
1041 "source/fuzz/fuzzer_pass_expand_vector_reductions.cpp",
1042 "source/fuzz/fuzzer_pass_expand_vector_reductions.h",
1043 "source/fuzz/fuzzer_pass_flatten_conditional_branches.cpp",
1044 "source/fuzz/fuzzer_pass_flatten_conditional_branches.h",
1045 "source/fuzz/fuzzer_pass_inline_functions.cpp",
1046 "source/fuzz/fuzzer_pass_inline_functions.h",
1047 "source/fuzz/fuzzer_pass_interchange_signedness_of_integer_operands.cpp",
1048 "source/fuzz/fuzzer_pass_interchange_signedness_of_integer_operands.h",
1049 "source/fuzz/fuzzer_pass_interchange_zero_like_constants.cpp",
1050 "source/fuzz/fuzzer_pass_interchange_zero_like_constants.h",
1051 "source/fuzz/fuzzer_pass_invert_comparison_operators.cpp",
1052 "source/fuzz/fuzzer_pass_invert_comparison_operators.h",
1053 "source/fuzz/fuzzer_pass_make_vector_operations_dynamic.cpp",
1054 "source/fuzz/fuzzer_pass_make_vector_operations_dynamic.h",
1055 "source/fuzz/fuzzer_pass_merge_blocks.cpp",
1056 "source/fuzz/fuzzer_pass_merge_blocks.h",
1057 "source/fuzz/fuzzer_pass_merge_function_returns.cpp",
1058 "source/fuzz/fuzzer_pass_merge_function_returns.h",
1059 "source/fuzz/fuzzer_pass_mutate_pointers.cpp",
1060 "source/fuzz/fuzzer_pass_mutate_pointers.h",
1061 "source/fuzz/fuzzer_pass_obfuscate_constants.cpp",
1062 "source/fuzz/fuzzer_pass_obfuscate_constants.h",
1063 "source/fuzz/fuzzer_pass_outline_functions.cpp",
1064 "source/fuzz/fuzzer_pass_outline_functions.h",
1065 "source/fuzz/fuzzer_pass_permute_blocks.cpp",
1066 "source/fuzz/fuzzer_pass_permute_blocks.h",
1067 "source/fuzz/fuzzer_pass_permute_function_parameters.cpp",
1068 "source/fuzz/fuzzer_pass_permute_function_parameters.h",
1069 "source/fuzz/fuzzer_pass_permute_function_variables.cpp",
1070 "source/fuzz/fuzzer_pass_permute_function_variables.h",
1071 "source/fuzz/fuzzer_pass_permute_instructions.cpp",
1072 "source/fuzz/fuzzer_pass_permute_instructions.h",
1073 "source/fuzz/fuzzer_pass_permute_phi_operands.cpp",
1074 "source/fuzz/fuzzer_pass_permute_phi_operands.h",
1075 "source/fuzz/fuzzer_pass_propagate_instructions_down.cpp",
1076 "source/fuzz/fuzzer_pass_propagate_instructions_down.h",
1077 "source/fuzz/fuzzer_pass_propagate_instructions_up.cpp",
1078 "source/fuzz/fuzzer_pass_propagate_instructions_up.h",
1079 "source/fuzz/fuzzer_pass_push_ids_through_variables.cpp",
1080 "source/fuzz/fuzzer_pass_push_ids_through_variables.h",
1081 "source/fuzz/fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.cpp",
1082 "source/fuzz/fuzzer_pass_replace_adds_subs_muls_with_carrying_extended.h",
1083 "source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.cpp",
1084 "source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.h",
1085 "source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.cpp",
1086 "source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.h",
1087 "source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.cpp",
1088 "source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.h",
1089 "source/fuzz/fuzzer_pass_replace_irrelevant_ids.cpp",
1090 "source/fuzz/fuzzer_pass_replace_irrelevant_ids.h",
1091 "source/fuzz/fuzzer_pass_replace_linear_algebra_instructions.cpp",
1092 "source/fuzz/fuzzer_pass_replace_linear_algebra_instructions.h",
1093 "source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.cpp",
1094 "source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.h",
1095 "source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.cpp",
1096 "source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.h",
1097 "source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.cpp",
1098 "source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.h",
1099 "source/fuzz/fuzzer_pass_replace_parameter_with_global.cpp",
1100 "source/fuzz/fuzzer_pass_replace_parameter_with_global.h",
1101 "source/fuzz/fuzzer_pass_replace_params_with_struct.cpp",
1102 "source/fuzz/fuzzer_pass_replace_params_with_struct.h",
1103 "source/fuzz/fuzzer_pass_split_blocks.cpp",
1104 "source/fuzz/fuzzer_pass_split_blocks.h",
1105 "source/fuzz/fuzzer_pass_swap_commutable_operands.cpp",
1106 "source/fuzz/fuzzer_pass_swap_commutable_operands.h",
1107 "source/fuzz/fuzzer_pass_swap_conditional_branch_operands.cpp",
1108 "source/fuzz/fuzzer_pass_swap_conditional_branch_operands.h",
1109 "source/fuzz/fuzzer_pass_swap_functions.cpp",
1110 "source/fuzz/fuzzer_pass_swap_functions.h",
1111 "source/fuzz/fuzzer_pass_toggle_access_chain_instruction.cpp",
1112 "source/fuzz/fuzzer_pass_toggle_access_chain_instruction.h",
1113 "source/fuzz/fuzzer_pass_wrap_regions_in_selections.cpp",
1114 "source/fuzz/fuzzer_pass_wrap_regions_in_selections.h",
1115 "source/fuzz/fuzzer_pass_wrap_vector_synonym.cpp",
1116 "source/fuzz/fuzzer_pass_wrap_vector_synonym.h",
1117 "source/fuzz/fuzzer_util.cpp",
1118 "source/fuzz/fuzzer_util.h",
1119 "source/fuzz/id_use_descriptor.cpp",
1120 "source/fuzz/id_use_descriptor.h",
1121 "source/fuzz/instruction_descriptor.cpp",
1122 "source/fuzz/instruction_descriptor.h",
1123 "source/fuzz/instruction_message.cpp",
1124 "source/fuzz/instruction_message.h",
1125 "source/fuzz/overflow_id_source.cpp",
1126 "source/fuzz/overflow_id_source.h",
1127 "source/fuzz/pass_management/repeated_pass_instances.h",
1128 "source/fuzz/pass_management/repeated_pass_manager.cpp",
1129 "source/fuzz/pass_management/repeated_pass_manager.h",
1130 "source/fuzz/pass_management/repeated_pass_manager_looped_with_recommendations.cpp",
1131 "source/fuzz/pass_management/repeated_pass_manager_looped_with_recommendations.h",
1132 "source/fuzz/pass_management/repeated_pass_manager_random_with_recommendations.cpp",
1133 "source/fuzz/pass_management/repeated_pass_manager_random_with_recommendations.h",
1134 "source/fuzz/pass_management/repeated_pass_manager_simple.cpp",
1135 "source/fuzz/pass_management/repeated_pass_manager_simple.h",
1136 "source/fuzz/pass_management/repeated_pass_recommender.cpp",
1137 "source/fuzz/pass_management/repeated_pass_recommender.h",
1138 "source/fuzz/pass_management/repeated_pass_recommender_standard.cpp",
1139 "source/fuzz/pass_management/repeated_pass_recommender_standard.h",
1140 "source/fuzz/protobufs/spirvfuzz_protobufs.h",
1141 "source/fuzz/pseudo_random_generator.cpp",
1142 "source/fuzz/pseudo_random_generator.h",
1143 "source/fuzz/random_generator.cpp",
1144 "source/fuzz/random_generator.h",
1145 "source/fuzz/replayer.cpp",
1146 "source/fuzz/replayer.h",
1147 "source/fuzz/shrinker.cpp",
1148 "source/fuzz/shrinker.h",
1149 "source/fuzz/transformation.cpp",
1150 "source/fuzz/transformation.h",
1151 "source/fuzz/transformation_access_chain.cpp",
1152 "source/fuzz/transformation_access_chain.h",
1153 "source/fuzz/transformation_add_bit_instruction_synonym.cpp",
1154 "source/fuzz/transformation_add_bit_instruction_synonym.h",
1155 "source/fuzz/transformation_add_constant_boolean.cpp",
1156 "source/fuzz/transformation_add_constant_boolean.h",
1157 "source/fuzz/transformation_add_constant_composite.cpp",
1158 "source/fuzz/transformation_add_constant_composite.h",
1159 "source/fuzz/transformation_add_constant_null.cpp",
1160 "source/fuzz/transformation_add_constant_null.h",
1161 "source/fuzz/transformation_add_constant_scalar.cpp",
1162 "source/fuzz/transformation_add_constant_scalar.h",
1163 "source/fuzz/transformation_add_copy_memory.cpp",
1164 "source/fuzz/transformation_add_copy_memory.h",
1165 "source/fuzz/transformation_add_dead_block.cpp",
1166 "source/fuzz/transformation_add_dead_block.h",
1167 "source/fuzz/transformation_add_dead_break.cpp",
1168 "source/fuzz/transformation_add_dead_break.h",
1169 "source/fuzz/transformation_add_dead_continue.cpp",
1170 "source/fuzz/transformation_add_dead_continue.h",
1171 "source/fuzz/transformation_add_early_terminator_wrapper.cpp",
1172 "source/fuzz/transformation_add_early_terminator_wrapper.h",
1173 "source/fuzz/transformation_add_function.cpp",
1174 "source/fuzz/transformation_add_function.h",
1175 "source/fuzz/transformation_add_global_undef.cpp",
1176 "source/fuzz/transformation_add_global_undef.h",
1177 "source/fuzz/transformation_add_global_variable.cpp",
1178 "source/fuzz/transformation_add_global_variable.h",
1179 "source/fuzz/transformation_add_image_sample_unused_components.cpp",
1180 "source/fuzz/transformation_add_image_sample_unused_components.h",
1181 "source/fuzz/transformation_add_local_variable.cpp",
1182 "source/fuzz/transformation_add_local_variable.h",
1183 "source/fuzz/transformation_add_loop_preheader.cpp",
1184 "source/fuzz/transformation_add_loop_preheader.h",
1185 "source/fuzz/transformation_add_loop_to_create_int_constant_synonym.cpp",
1186 "source/fuzz/transformation_add_loop_to_create_int_constant_synonym.h",
1187 "source/fuzz/transformation_add_no_contraction_decoration.cpp",
1188 "source/fuzz/transformation_add_no_contraction_decoration.h",
1189 "source/fuzz/transformation_add_opphi_synonym.cpp",
1190 "source/fuzz/transformation_add_opphi_synonym.h",
1191 "source/fuzz/transformation_add_parameter.cpp",
1192 "source/fuzz/transformation_add_parameter.h",
1193 "source/fuzz/transformation_add_relaxed_decoration.cpp",
1194 "source/fuzz/transformation_add_relaxed_decoration.h",
1195 "source/fuzz/transformation_add_spec_constant_op.cpp",
1196 "source/fuzz/transformation_add_spec_constant_op.h",
1197 "source/fuzz/transformation_add_synonym.cpp",
1198 "source/fuzz/transformation_add_synonym.h",
1199 "source/fuzz/transformation_add_type_array.cpp",
1200 "source/fuzz/transformation_add_type_array.h",
1201 "source/fuzz/transformation_add_type_boolean.cpp",
1202 "source/fuzz/transformation_add_type_boolean.h",
1203 "source/fuzz/transformation_add_type_float.cpp",
1204 "source/fuzz/transformation_add_type_float.h",
1205 "source/fuzz/transformation_add_type_function.cpp",
1206 "source/fuzz/transformation_add_type_function.h",
1207 "source/fuzz/transformation_add_type_int.cpp",
1208 "source/fuzz/transformation_add_type_int.h",
1209 "source/fuzz/transformation_add_type_matrix.cpp",
1210 "source/fuzz/transformation_add_type_matrix.h",
1211 "source/fuzz/transformation_add_type_pointer.cpp",
1212 "source/fuzz/transformation_add_type_pointer.h",
1213 "source/fuzz/transformation_add_type_struct.cpp",
1214 "source/fuzz/transformation_add_type_struct.h",
1215 "source/fuzz/transformation_add_type_vector.cpp",
1216 "source/fuzz/transformation_add_type_vector.h",
1217 "source/fuzz/transformation_adjust_branch_weights.cpp",
1218 "source/fuzz/transformation_adjust_branch_weights.h",
1219 "source/fuzz/transformation_composite_construct.cpp",
1220 "source/fuzz/transformation_composite_construct.h",
1221 "source/fuzz/transformation_composite_extract.cpp",
1222 "source/fuzz/transformation_composite_extract.h",
1223 "source/fuzz/transformation_composite_insert.cpp",
1224 "source/fuzz/transformation_composite_insert.h",
1225 "source/fuzz/transformation_compute_data_synonym_fact_closure.cpp",
1226 "source/fuzz/transformation_compute_data_synonym_fact_closure.h",
1227 "source/fuzz/transformation_context.cpp",
1228 "source/fuzz/transformation_context.h",
1229 "source/fuzz/transformation_duplicate_region_with_selection.cpp",
1230 "source/fuzz/transformation_duplicate_region_with_selection.h",
1231 "source/fuzz/transformation_equation_instruction.cpp",
1232 "source/fuzz/transformation_equation_instruction.h",
1233 "source/fuzz/transformation_expand_vector_reduction.cpp",
1234 "source/fuzz/transformation_expand_vector_reduction.h",
1235 "source/fuzz/transformation_flatten_conditional_branch.cpp",
1236 "source/fuzz/transformation_flatten_conditional_branch.h",
1237 "source/fuzz/transformation_function_call.cpp",
1238 "source/fuzz/transformation_function_call.h",
1239 "source/fuzz/transformation_inline_function.cpp",
1240 "source/fuzz/transformation_inline_function.h",
1241 "source/fuzz/transformation_invert_comparison_operator.cpp",
1242 "source/fuzz/transformation_invert_comparison_operator.h",
1243 "source/fuzz/transformation_load.cpp",
1244 "source/fuzz/transformation_load.h",
1245 "source/fuzz/transformation_make_vector_operation_dynamic.cpp",
1246 "source/fuzz/transformation_make_vector_operation_dynamic.h",
1247 "source/fuzz/transformation_merge_blocks.cpp",
1248 "source/fuzz/transformation_merge_blocks.h",
1249 "source/fuzz/transformation_merge_function_returns.cpp",
1250 "source/fuzz/transformation_merge_function_returns.h",
1251 "source/fuzz/transformation_move_block_down.cpp",
1252 "source/fuzz/transformation_move_block_down.h",
1253 "source/fuzz/transformation_move_instruction_down.cpp",
1254 "source/fuzz/transformation_move_instruction_down.h",
1255 "source/fuzz/transformation_mutate_pointer.cpp",
1256 "source/fuzz/transformation_mutate_pointer.h",
1257 "source/fuzz/transformation_outline_function.cpp",
1258 "source/fuzz/transformation_outline_function.h",
1259 "source/fuzz/transformation_permute_function_parameters.cpp",
1260 "source/fuzz/transformation_permute_function_parameters.h",
1261 "source/fuzz/transformation_permute_phi_operands.cpp",
1262 "source/fuzz/transformation_permute_phi_operands.h",
1263 "source/fuzz/transformation_propagate_instruction_down.cpp",
1264 "source/fuzz/transformation_propagate_instruction_down.h",
1265 "source/fuzz/transformation_propagate_instruction_up.cpp",
1266 "source/fuzz/transformation_propagate_instruction_up.h",
1267 "source/fuzz/transformation_push_id_through_variable.cpp",
1268 "source/fuzz/transformation_push_id_through_variable.h",
1269 "source/fuzz/transformation_record_synonymous_constants.cpp",
1270 "source/fuzz/transformation_record_synonymous_constants.h",
1271 "source/fuzz/transformation_replace_add_sub_mul_with_carrying_extended.cpp",
1272 "source/fuzz/transformation_replace_add_sub_mul_with_carrying_extended.h",
1273 "source/fuzz/transformation_replace_boolean_constant_with_constant_binary.cpp",
1274 "source/fuzz/transformation_replace_boolean_constant_with_constant_binary.h",
1275 "source/fuzz/transformation_replace_branch_from_dead_block_with_exit.cpp",
1276 "source/fuzz/transformation_replace_branch_from_dead_block_with_exit.h",
1277 "source/fuzz/transformation_replace_constant_with_uniform.cpp",
1278 "source/fuzz/transformation_replace_constant_with_uniform.h",
1279 "source/fuzz/transformation_replace_copy_memory_with_load_store.cpp",
1280 "source/fuzz/transformation_replace_copy_memory_with_load_store.h",
1281 "source/fuzz/transformation_replace_copy_object_with_store_load.cpp",
1282 "source/fuzz/transformation_replace_copy_object_with_store_load.h",
1283 "source/fuzz/transformation_replace_id_with_synonym.cpp",
1284 "source/fuzz/transformation_replace_id_with_synonym.h",
1285 "source/fuzz/transformation_replace_irrelevant_id.cpp",
1286 "source/fuzz/transformation_replace_irrelevant_id.h",
1287 "source/fuzz/transformation_replace_linear_algebra_instruction.cpp",
1288 "source/fuzz/transformation_replace_linear_algebra_instruction.h",
1289 "source/fuzz/transformation_replace_load_store_with_copy_memory.cpp",
1290 "source/fuzz/transformation_replace_load_store_with_copy_memory.h",
1291 "source/fuzz/transformation_replace_opphi_id_from_dead_predecessor.cpp",
1292 "source/fuzz/transformation_replace_opphi_id_from_dead_predecessor.h",
1293 "source/fuzz/transformation_replace_opselect_with_conditional_branch.cpp",
1294 "source/fuzz/transformation_replace_opselect_with_conditional_branch.h",
1295 "source/fuzz/transformation_replace_parameter_with_global.cpp",
1296 "source/fuzz/transformation_replace_parameter_with_global.h",
1297 "source/fuzz/transformation_replace_params_with_struct.cpp",
1298 "source/fuzz/transformation_replace_params_with_struct.h",
1299 "source/fuzz/transformation_set_function_control.cpp",
1300 "source/fuzz/transformation_set_function_control.h",
1301 "source/fuzz/transformation_set_loop_control.cpp",
1302 "source/fuzz/transformation_set_loop_control.h",
1303 "source/fuzz/transformation_set_memory_operands_mask.cpp",
1304 "source/fuzz/transformation_set_memory_operands_mask.h",
1305 "source/fuzz/transformation_set_selection_control.cpp",
1306 "source/fuzz/transformation_set_selection_control.h",
1307 "source/fuzz/transformation_split_block.cpp",
1308 "source/fuzz/transformation_split_block.h",
1309 "source/fuzz/transformation_store.cpp",
1310 "source/fuzz/transformation_store.h",
1311 "source/fuzz/transformation_swap_commutable_operands.cpp",
1312 "source/fuzz/transformation_swap_commutable_operands.h",
1313 "source/fuzz/transformation_swap_conditional_branch_operands.cpp",
1314 "source/fuzz/transformation_swap_conditional_branch_operands.h",
1315 "source/fuzz/transformation_swap_function_variables.cpp",
1316 "source/fuzz/transformation_swap_function_variables.h",
1317 "source/fuzz/transformation_swap_two_functions.cpp",
1318 "source/fuzz/transformation_swap_two_functions.h",
1319 "source/fuzz/transformation_toggle_access_chain_instruction.cpp",
1320 "source/fuzz/transformation_toggle_access_chain_instruction.h",
1321 "source/fuzz/transformation_vector_shuffle.cpp",
1322 "source/fuzz/transformation_vector_shuffle.h",
1323 "source/fuzz/transformation_wrap_early_terminator_in_function.cpp",
1324 "source/fuzz/transformation_wrap_early_terminator_in_function.h",
1325 "source/fuzz/transformation_wrap_region_in_selection.cpp",
1326 "source/fuzz/transformation_wrap_region_in_selection.h",
1327 "source/fuzz/transformation_wrap_vector_synonym.cpp",
1328 "source/fuzz/transformation_wrap_vector_synonym.h",
1329 "source/fuzz/uniform_buffer_element_descriptor.cpp",
1330 "source/fuzz/uniform_buffer_element_descriptor.h",
1334 ":spvtools_fuzz_proto",
1337 "//third_party/protobuf:protobuf_full",
1339 public_deps = [ ":spvtools_headers" ]
1340 configs -= [ "//build/config/compiler:chromium_code" ]
1341 configs += [ "//build/config/compiler:no_chromium_code" ]
1342 configs += [ ":spvtools_internal_config" ]
1346 group("SPIRV-Tools") {
1356 # The tests are scoped to Chromium to avoid needing to write gtest integration.
1357 # See Chromium's third_party/googletest/BUILD.gn for a complete integration.
1358 if (build_with_chromium && spvtools_build_executables) {
1359 test("spvtools_test") {
1361 "test/assembly_context_test.cpp",
1362 "test/assembly_format_test.cpp",
1363 "test/binary_destroy_test.cpp",
1364 "test/binary_endianness_test.cpp",
1365 "test/binary_header_get_test.cpp",
1366 "test/binary_parse_test.cpp",
1367 "test/binary_strnlen_s_test.cpp",
1368 "test/binary_to_text.literal_test.cpp",
1369 "test/binary_to_text_test.cpp",
1370 "test/comment_test.cpp",
1371 "test/enum_set_test.cpp",
1372 "test/enum_string_mapping_test.cpp",
1373 "test/ext_inst.cldebug100_test.cpp",
1374 "test/ext_inst.debuginfo_test.cpp",
1375 "test/ext_inst.glsl_test.cpp",
1376 "test/ext_inst.opencl_test.cpp",
1377 "test/fix_word_test.cpp",
1378 "test/generator_magic_number_test.cpp",
1379 "test/hex_float_test.cpp",
1380 "test/hex_to_text_test.cpp",
1381 "test/immediate_int_test.cpp",
1382 "test/libspirv_macros_test.cpp",
1383 "test/name_mapper_test.cpp",
1384 "test/named_id_test.cpp",
1385 "test/opcode_make_test.cpp",
1386 "test/opcode_require_capabilities_test.cpp",
1387 "test/opcode_split_test.cpp",
1388 "test/opcode_table_get_test.cpp",
1389 "test/operand_capabilities_test.cpp",
1390 "test/operand_pattern_test.cpp",
1391 "test/operand_test.cpp",
1392 "test/target_env_test.cpp",
1393 "test/test_fixture.h",
1394 "test/text_advance_test.cpp",
1395 "test/text_destroy_test.cpp",
1396 "test/text_literal_test.cpp",
1397 "test/text_start_new_inst_test.cpp",
1398 "test/text_to_binary.annotation_test.cpp",
1399 "test/text_to_binary.barrier_test.cpp",
1400 "test/text_to_binary.constant_test.cpp",
1401 "test/text_to_binary.control_flow_test.cpp",
1402 "test/text_to_binary.debug_test.cpp",
1403 "test/text_to_binary.device_side_enqueue_test.cpp",
1404 "test/text_to_binary.extension_test.cpp",
1405 "test/text_to_binary.function_test.cpp",
1406 "test/text_to_binary.group_test.cpp",
1407 "test/text_to_binary.image_test.cpp",
1408 "test/text_to_binary.literal_test.cpp",
1409 "test/text_to_binary.memory_test.cpp",
1410 "test/text_to_binary.misc_test.cpp",
1411 "test/text_to_binary.mode_setting_test.cpp",
1412 "test/text_to_binary.pipe_storage_test.cpp",
1413 "test/text_to_binary.reserved_sampling_test.cpp",
1414 "test/text_to_binary.subgroup_dispatch_test.cpp",
1415 "test/text_to_binary.type_declaration_test.cpp",
1416 "test/text_to_binary_test.cpp",
1417 "test/text_word_get_test.cpp",
1418 "test/to_string_test.cpp",
1419 "test/unit_spirv.cpp",
1420 "test/unit_spirv.h",
1425 ":spvtools_language_header_cldebuginfo100",
1426 ":spvtools_language_header_debuginfo",
1427 ":spvtools_language_header_vkdebuginfo100",
1428 ":spvtools_tools_io",
1432 "//testing/gtest:gtest_main",
1433 "//third_party/googletest:gmock",
1434 "//third_party/googletest:gtest",
1438 cflags_cc = [ "-Wno-self-assign" ]
1441 configs += [ ":spvtools_internal_config" ]
1445 if (spirv_tools_standalone) {
1448 deps = [ "test/fuzzers" ]
1452 source_set("spvtools_software_version") {
1453 sources = [ "source/software_version.cpp" ]
1455 ":spvtools_build_version",
1456 ":spvtools_headers",
1458 configs += [ ":spvtools_internal_config" ]
1461 source_set("spvtools_tools_util") {
1463 "tools/util/flags.cpp",
1464 "tools/util/cli_consumer.cpp",
1465 "tools/util/cli_consumer.h",
1467 deps = [ ":spvtools_headers" ]
1468 configs += [ ":spvtools_internal_config" ]
1471 source_set("spvtools_tools_io") {
1476 deps = [ ":spvtools_headers" ]
1477 configs += [ ":spvtools_internal_config" ]
1480 if (spvtools_build_executables) {
1481 executable("spirv-as") {
1482 sources = [ "tools/as/as.cpp" ]
1485 ":spvtools_software_version",
1486 ":spvtools_tools_util",
1487 ":spvtools_tools_io",
1489 configs += [ ":spvtools_internal_config" ]
1492 executable("spirv-dis") {
1493 sources = [ "tools/dis/dis.cpp" ]
1496 ":spvtools_software_version",
1497 ":spvtools_tools_util",
1498 ":spvtools_tools_io",
1500 configs += [ ":spvtools_internal_config" ]
1503 executable("spirv-val") {
1504 sources = [ "tools/val/val.cpp" ]
1507 ":spvtools_software_version",
1508 ":spvtools_tools_util",
1509 ":spvtools_tools_io",
1512 configs += [ ":spvtools_internal_config" ]
1515 executable("spirv-cfg") {
1517 "tools/cfg/bin_to_dot.cpp",
1518 "tools/cfg/bin_to_dot.h",
1519 "tools/cfg/cfg.cpp",
1523 ":spvtools_software_version",
1524 ":spvtools_tools_util",
1525 ":spvtools_tools_io",
1527 configs += [ ":spvtools_internal_config" ]
1530 executable("spirv-opt") {
1531 sources = [ "tools/opt/opt.cpp" ]
1535 ":spvtools_software_version",
1536 ":spvtools_tools_util",
1537 ":spvtools_tools_io",
1540 configs += [ ":spvtools_internal_config" ]
1543 executable("spirv-link") {
1544 sources = [ "tools/link/linker.cpp" ]
1549 ":spvtools_software_version",
1550 ":spvtools_tools_util",
1551 ":spvtools_tools_io",
1554 configs += [ ":spvtools_internal_config" ]
1558 if (!is_ios && !spirv_is_winuwp && build_with_chromium && spvtools_build_executables) {
1559 # iOS and UWP do not allow std::system calls which spirv-fuzz
1560 # requires. Additionally, spirv-fuzz is only built when in a
1561 # Chromium checkout due to its dependency on protobuf.
1563 executable("spirv-fuzz") {
1564 sources = [ "tools/fuzz/fuzz.cpp" ]
1570 ":spvtools_software_version",
1571 ":spvtools_tools_util",
1572 ":spvtools_tools_io",
1574 "//third_party/protobuf:protobuf_full",
1576 configs += [ ":spvtools_internal_config" ]
1580 if (!is_ios && !spirv_is_winuwp && spvtools_build_executables) {
1581 # iOS and UWP do not allow std::system calls which spirv-reduce
1584 executable("spirv-reduce") {
1585 sources = [ "tools/reduce/reduce.cpp" ]
1590 ":spvtools_software_version",
1591 ":spvtools_tools_util",
1592 ":spvtools_tools_io",
1595 configs += [ ":spvtools_internal_config" ]
1599 if (spvtools_build_executables){
1600 group("all_spirv_tools") {
1609 if (!is_ios && !spirv_is_winuwp && build_with_chromium) {
1610 deps += [ ":spirv-fuzz" ]
1612 if (!is_ios && !spirv_is_winuwp) {
1613 deps += [ ":spirv-reduce" ]