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

Function GetLoopFromMergeBlock

source/fuzz/fuzzer_util.cpp:578–598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578uint32_t GetLoopFromMergeBlock(opt::IRContext* ir_context,
579 uint32_t merge_block_id) {
580 uint32_t result = 0;
581 ir_context->get_def_use_mgr()->WhileEachUse(
582 merge_block_id,
583 [ir_context, &result](opt::Instruction* use_instruction,
584 uint32_t use_index) -> bool {
585 switch (use_instruction->opcode()) {
586 case spv::Op::OpLoopMerge:
587 // The merge block operand is the first operand in OpLoopMerge.
588 if (use_index == 0) {
589 result = ir_context->get_instr_block(use_instruction)->id();
590 return false;
591 }
592 return true;
593 default:
594 return true;
595 }
596 });
597 return result;
598}
599
600uint32_t FindFunctionType(opt::IRContext* ir_context,
601 const std::vector<uint32_t>& type_ids) {

Calls 5

WhileEachUseMethod · 0.80
get_instr_blockMethod · 0.80
get_def_use_mgrMethod · 0.45
opcodeMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected