SPIRV-Tools/source
Diego Novillo 735d8a579e SSA rewrite pass.
This pass replaces the load/store elimination passes.  It implements the
SSA re-writing algorithm proposed in

     Simple and Efficient Construction of Static Single Assignment Form.
     Braun M., Buchwald S., Hack S., Leißa R., Mallon C., Zwinkau A. (2013)
     In: Jhala R., De Bosschere K. (eds)
     Compiler Construction. CC 2013.
     Lecture Notes in Computer Science, vol 7791.
     Springer, Berlin, Heidelberg

     https://link.springer.com/chapter/10.1007/978-3-642-37051-9_6

In contrast to common eager algorithms based on dominance and dominance
frontier information, this algorithm works backwards from load operations.

When a target variable is loaded, it queries the variable's reaching
definition.  If the reaching definition is unknown at the current location,
it searches backwards in the CFG, inserting Phi instructions at join points
in the CFG along the way until it finds the desired store instruction.

The algorithm avoids repeated lookups using memoization.

For reducible CFGs, which are a superset of the structured CFGs in SPIRV,
this algorithm is proven to produce minimal SSA.  That is, it inserts the
minimal number of Phi instructions required to ensure the SSA property, but
some Phi instructions may be dead
(https://en.wikipedia.org/wiki/Static_single_assignment_form).
2018-03-20 20:56:55 -04:00
..
comp Remove concept of FIRST_CONCRETE_* operand types 2017-12-18 09:48:51 -05:00
link linker: merge debug annotations from category c) 2018-02-27 12:31:50 -05:00
opt SSA rewrite pass. 2018-03-20 20:56:55 -04:00
util Change merge return pass to handle structured cfg. 2018-03-19 13:49:04 -04:00
val AMD_gpu_shader_half_float enables float16 2018-03-07 11:07:58 -05:00
assembly_grammar.cpp Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
assembly_grammar.h Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
binary.cpp Consistently include latest spirv.h header file. 2018-02-27 18:47:29 -05:00
binary.h Support building under CYGWIN 2016-12-21 10:34:23 -05:00
cfa.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
CMakeLists.txt Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
diagnostic.cpp Move SetContextMessageConsumer into libspirv namespace 2017-11-23 13:56:12 -05:00
diagnostic.h DiagnosticStream move ctor moves output duties to new object 2017-10-03 11:23:54 -04:00
disassemble.cpp Adding ostream operators for IR structures 2018-01-12 11:19:58 -05:00
disassemble.h Adding ostream operators for IR structures 2018-01-12 11:19:58 -05:00
enum_set.h Refactor include of latest spir-v header versions 2017-12-14 11:18:20 -05:00
enum_string_mapping.cpp Avoid using static unordered_map (#1304) 2018-02-15 10:19:15 -05:00
enum_string_mapping.h Consistently include latest spirv.h header file. 2018-02-27 18:47:29 -05:00
ext_inst.cpp Support SPIR-V 1.3 and Vulkan 1.1 2018-03-06 15:17:31 -05:00
ext_inst.h Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
extensions.cpp Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
extensions.h Turn all function static non-POD variables into global POD variables 2017-10-25 15:44:19 -04:00
extinst.debuginfo.grammar.json Add asm, dis support for DebugInfo extended instruction set 2017-12-22 09:39:36 -05:00
extinst.spv-amd-gcn-shader.grammar.json Fix spelling in SPV_AMD_gcn_shader support 2017-04-03 14:59:18 -04:00
extinst.spv-amd-shader-ballot.grammar.json Add support for SPV AMD extensions 2017-06-21 15:08:07 -04:00
extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json Add support for SPV AMD extensions 2017-06-21 15:08:07 -04:00
extinst.spv-amd-shader-trinary-minmax.grammar.json Add support for SPV AMD extensions 2017-06-21 15:08:07 -04:00
id_descriptor.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
id_descriptor.h Add new compression algorithm and models 2017-11-21 17:32:58 -05:00
instruction.h Refactor include of latest spir-v header versions 2017-12-14 11:18:20 -05:00
latest_version_glsl_std_450_header.h Use SPIR-V headers from "unified1" directory 2018-01-31 15:36:50 -05:00
latest_version_opencl_std_header.h Use SPIR-V headers from "unified1" directory 2018-01-31 15:36:50 -05:00
latest_version_spirv_header.h Use SPIR-V headers from "unified1" directory 2018-01-31 15:36:50 -05:00
libspirv.cpp Linker code cleanups 2018-01-05 13:28:44 -05:00
macro.h Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
message.cpp spirv-val prints warnings 2017-03-17 12:48:51 -04:00
message.h Clean up header dependency. 2016-09-22 18:15:23 -04:00
name_mapper.cpp Consistently include latest spirv.h header file. 2018-02-27 18:47:29 -05:00
name_mapper.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
opcode.cpp Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
opcode.h Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
operand.cpp Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
operand.h Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
parsed_operand.cpp Extract EmitNumericLiteral from disassembler 2016-11-15 14:05:03 -05:00
parsed_operand.h Extract EmitNumericLiteral from disassembler 2016-11-15 14:05:03 -05:00
print.cpp Support outputting ANSI color escape sequences in library 2017-12-01 09:03:35 -05:00
print.h Support outputting ANSI color escape sequences in library 2017-12-01 09:03:35 -05:00
software_version.cpp Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
spirv_constant.h Refactor include of latest spir-v header versions 2017-12-14 11:18:20 -05:00
spirv_definition.h Refactor include of latest spir-v header versions 2017-12-14 11:18:20 -05:00
spirv_endian.cpp Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
spirv_endian.h Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
spirv_stats.cpp Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
spirv_stats.h Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
spirv_target_env.cpp Support SPIR-V 1.3 and Vulkan 1.1 2018-03-06 15:17:31 -05:00
spirv_target_env.h Added Vulkan-specifc checks to image validation 2018-01-24 14:05:42 -08:00
spirv_validator_options.cpp Allow relaxing validation of pointers in logical addressing mode 2018-01-08 10:36:23 -05:00
spirv_validator_options.h Allow relaxing validation of pointers in logical addressing mode 2018-01-08 10:36:23 -05:00
table.cpp Support SPIR-V 1.3 and Vulkan 1.1 2018-03-06 15:17:31 -05:00
table.h Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
text_handler.cpp Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
text_handler.h Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
text.cpp Add asm, dis support for DebugInfo extended instruction set 2017-12-22 09:39:36 -05:00
text.h Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
validate_adjacency.cpp Add adjacency validation pass 2018-02-01 14:10:55 -05:00
validate_arithmetics.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
validate_atomics.cpp Disable check which fails Vulkan CTS 2018-02-07 13:31:35 -05:00
validate_barriers.cpp Add Vulkan-specific validation rules for atomics 2018-02-07 13:31:35 -05:00
validate_bitwise.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
validate_capability.cpp Improved error message in val capabilities 2018-01-30 16:22:10 -05:00
validate_cfg.cpp Add validation checks for Execution Model 2017-11-23 23:38:03 -05:00
validate_composites.cpp Validator checks out of bounds composite access 2018-01-04 14:02:38 -05:00
validate_conversion.cpp Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
validate_datarules.cpp Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
validate_decorations.cpp Vulkan BuiltIn variables can't have Location/Component decorations 2018-03-01 15:00:08 -05:00
validate_derivatives.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
validate_ext_inst.cpp Added OpenCL ExtInst validation rules 2018-02-01 14:14:13 -05:00
validate_id.cpp Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
validate_image.cpp Add barrier instructions validation pass 2018-02-05 13:14:55 -05:00
validate_instruction.cpp Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
validate_layout.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
validate_literals.cpp validate & test of literal's upper bits 2017-12-19 13:19:56 -05:00
validate_logicals.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
validate_primitives.cpp More validation on primitive instructions 2017-12-19 13:26:07 -05:00
validate_type_unique.cpp Re-format files in source, source/opt, source/util, source/val and tools. 2017-11-08 14:03:08 -05:00
validate.cpp Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00
validate.h Migrate to use unified grammar tables 2018-03-17 15:25:26 -04:00