mirror of
https://gitee.com/openharmony/third_party_spirv-tools
synced 2024-11-23 23:39:40 +00:00
380f36eae1
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. |
||
---|---|---|
.. | ||
basic_block.h | ||
CMakeLists.txt | ||
constants.h | ||
def_use_manager.cpp | ||
def_use_manager.h | ||
fold_spec_const_op_composite.cpp | ||
function.cpp | ||
function.h | ||
instruction.cpp | ||
instruction.h | ||
ir_loader.cpp | ||
ir_loader.h | ||
iterator.h | ||
libspirv.cpp | ||
libspirv.hpp | ||
make_unique.h | ||
module.cpp | ||
module.h | ||
pass_manager.h | ||
pass.h | ||
passes.cpp | ||
passes.h | ||
reflect.h | ||
type_manager.cpp | ||
type_manager.h | ||
types.cpp | ||
types.h |