SPIRV-Tools/source
qining eb60e2945a Unify constants pass
De-duplicate constants and unifies the uses of constants for a SPIR-V
module. If two constants are defined exactly the same, only one of them
will be kept and all the uses of the removed constant will be redirected
to the kept one.

This pass handles normal constants (defined with
OpConstant{|True|False|Composite}), some spec constants (those defined
with OpSpecConstant{Op|Composite}) and null constants (defined with
OpConstantNull).

There are several cases not handled by this pass:

  1) If there are decorations for the result id of a constant defining
  instruction, that instruction will not be processed. This means the
  instruction won't be used to replace other instructions and other
  instructions won't be used to replace it either.

  2) This pass does not unify null constants (defined with
  OpConstantNull instruction) with their equivalent zero-valued normal
  constants (defined with OpConstant{|False|Composite} with zero as the
  operand values or component values).
2016-09-01 11:46:05 -04:00
..
opt Unify constants pass 2016-09-01 11:46:05 -04:00
util Fix several warnings exposed in MSVS 2015. 2016-04-29 18:02:01 -04:00
val Refactor CapabilitySet into templated class EnumSet 2016-09-01 09:32:22 -04:00
assembly_grammar.cpp Allow OpINotEqual in OpSpecConstantOp inst 2016-08-02 15:11:27 -04:00
assembly_grammar.h Use SPIR-V headers from the KhronosGroup/SPIRV-Headers repo. 2016-06-10 08:48:37 -04:00
binary.cpp Remove dependency on SPIR-V headers in libspirv.h. 2016-04-04 10:34:28 -04:00
binary.h Remove unnecessary headers 2016-08-07 10:11:49 -04:00
CMakeLists.txt Refactor CapabilitySet into templated class EnumSet 2016-09-01 09:32:22 -04:00
diagnostic.cpp Remove some unused macros and functions. 2016-08-24 09:34:06 -04:00
diagnostic.h Remove some unused macros and functions. 2016-08-24 09:34:06 -04:00
disassemble.cpp Disassembling: map IDs to friendly names. 2016-07-19 16:28:17 -04:00
enum_set.cpp Refactor CapabilitySet into templated class EnumSet 2016-09-01 09:32:22 -04:00
enum_set.h Refactor CapabilitySet into templated class EnumSet 2016-09-01 09:32:22 -04:00
ext_inst.cpp Add target envs for OpenCL, OpenGL 2016-08-05 18:19:30 -04:00
ext_inst.h Rearrange headers 2016-02-17 14:49:44 -05:00
extinst-1.0.opencl.std.grammar.json Fix OpenCL pow and pown arguments 2016-06-14 12:14:38 -04:00
instruction.cpp Fixed internal compiler error in gcc-4.9. 2016-02-17 13:07:33 -05:00
instruction.h Remove unnecessary headers 2016-08-07 10:11:49 -04:00
macro.h Use a single definition of ARRAY_SIZE to simplify code. 2016-04-27 17:05:24 -04:00
name_mapper.cpp Never generate % for a friendly disassembled Id 2016-08-02 11:59:10 -04:00
name_mapper.h Disassembling: map IDs to friendly names. 2016-07-19 16:28:17 -04:00
opcode.cpp Handle capabilities larger than value 63 2016-08-30 15:41:39 -04:00
opcode.h Handle capabilities larger than value 63 2016-08-30 15:41:39 -04:00
operand.cpp Add target envs for OpenCL, OpenGL 2016-08-05 18:19:30 -04:00
operand.h Rearrange headers 2016-02-17 14:49:44 -05:00
print.cpp Update cmake files to support Android as a build target. 2016-04-18 11:43:24 -04:00
print.h Fix issues reported by cppcheck. 2016-02-25 16:16:28 -05:00
software_version.cpp Add CHANGES file with high level software history 2016-04-22 15:19:45 -04:00
spirv_constant.h Use SPIR-V headers from the KhronosGroup/SPIRV-Headers repo. 2016-06-10 08:48:37 -04:00
spirv_definition.h Handle capabilities larger than value 63 2016-08-30 15:41:39 -04:00
spirv_endian.cpp Extend copyright to 2016. 2016-01-07 13:44:22 -05:00
spirv_endian.h Rearrange headers 2016-02-17 14:49:44 -05:00
spirv_target_env.cpp Add target envs for OpenCL, OpenGL 2016-08-05 18:19:30 -04:00
spirv_target_env.h DRY file reading code in tools. 2016-06-30 15:56:20 -04:00
table.cpp Add target envs for OpenCL, OpenGL 2016-08-05 18:19:30 -04:00
table.h Refactor CapabilitySet into templated class EnumSet 2016-09-01 09:32:22 -04:00
text_handler.cpp Avoid going out of bound in advanceLine() and refine comments. 2016-04-21 16:08:51 -04:00
text_handler.h Change the interface for getWord(). 2016-03-16 15:46:15 -04:00
text.cpp Remove dependency on SPIR-V headers in libspirv.h. 2016-04-04 10:34:28 -04:00
text.h Rearrange headers 2016-02-17 14:49:44 -05:00
validate_cfg.cpp Handle capabilities larger than value 63 2016-08-30 15:41:39 -04:00
validate_id.cpp Fix compilation. My bad 2016-08-09 18:23:40 -04:00
validate_instruction.cpp Refactor CapabilitySet into templated class EnumSet 2016-09-01 09:32:22 -04:00
validate_layout.cpp Fix several violations of the style guide 2016-06-27 10:45:46 -04:00
validate.cpp Refactor Id -> Instruction 2016-08-09 15:50:03 -04:00
validate.h Refactor Id -> Instruction 2016-08-09 15:50:03 -04:00