SPIRV-Tools/tools
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
..
as DRY file writing code in tools. 2016-06-30 15:56:47 -04:00
cfg Avoid double-copy of NameMapper object. 2016-08-11 12:11:36 -04:00
dis Disassembling: map IDs to friendly names. 2016-07-19 16:28:17 -04:00
lesspipe Add spirv-lesspipe.sh 2016-08-24 10:39:04 -04:00
opt Unify constants pass 2016-09-01 11:46:05 -04:00
val DRY file reading code in tools. 2016-06-30 15:56:20 -04:00
CMakeLists.txt Add spirv-lesspipe.sh 2016-08-24 10:39:04 -04:00
io.h Avoid integer modulo by 1, to avoid warning 2016-08-15 11:27:13 -04:00