SPIRV-Tools/tools
qining 380f36eae1 Fold spec constants to normal constants (values fixed)
For the spec constants defined by OpSpecConstantOp and
OpSpecContantComposite, if all of their operands are constants with
determined values (normal constants whose values are fixed), calculate
the correct values of the spec constants and re-define them as normal
constants.

In short, this pass replaces all the spec constants defined by
OpSpecContantOp and OpSpecConstantComposite with normal constants when
possible. So far not all valid operations of OpSpecConstantOp are
supported, we have several constriction here:

1) Only 32-bit integer and boolean (both scalar and vector) are
supported for any arithmetic operations. Integers in other width (like
64-bit) are not supported.
2) OpSConvert, OpFConvert, OpQuantizeToF16, and all the
operations under Kernel capability, are not supported.
3) OpCompositeInsert is not supported.

Note that this pass does not unify normal constants. This means it is
possible to have new generatd constants defining the same values.
2016-08-29 08:58:53 -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 Fold spec constants to normal constants (values fixed) 2016-08-29 08:58:53 -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