mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-26 05:10:05 +00:00
eb60e2945a
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). |
||
---|---|---|
.. | ||
as | ||
cfg | ||
dis | ||
lesspipe | ||
opt | ||
val | ||
CMakeLists.txt | ||
io.h |