MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / IsFoldableVectorType

Method IsFoldableVectorType

source/opt/fold.cpp:680–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

678}
679
680bool InstructionFolder::IsFoldableVectorType(Instruction* type_inst) const {
681 // Support vectors with foldable components
682 if (type_inst->opcode() == spv::Op::OpTypeVector) {
683 uint32_t component_type_id = type_inst->GetSingleWordInOperand(0);
684 Instruction* def_component_type =
685 context_->get_def_use_mgr()->GetDef(component_type_id);
686 return def_component_type != nullptr &&
687 IsFoldableScalarType(def_component_type);
688 }
689 // Nothing else yet.
690 return false;
691}
692
693bool InstructionFolder::FoldInstruction(Instruction* inst) const {
694 bool modified = false;

Callers 1

Calls 4

opcodeMethod · 0.45
GetDefMethod · 0.45
get_def_use_mgrMethod · 0.45

Tested by

no test coverage detected