| 558 | } |
| 559 | |
| 560 | bool IsMergeOrContinue(opt::IRContext* ir_context, uint32_t block_id) { |
| 561 | bool result = false; |
| 562 | ir_context->get_def_use_mgr()->WhileEachUse( |
| 563 | block_id, |
| 564 | [&result](const opt::Instruction* use_instruction, |
| 565 | uint32_t /*unused*/) -> bool { |
| 566 | switch (use_instruction->opcode()) { |
| 567 | case spv::Op::OpLoopMerge: |
| 568 | case spv::Op::OpSelectionMerge: |
| 569 | result = true; |
| 570 | return false; |
| 571 | default: |
| 572 | return true; |
| 573 | } |
| 574 | }); |
| 575 | return result; |
| 576 | } |
| 577 | |
| 578 | uint32_t GetLoopFromMergeBlock(opt::IRContext* ir_context, |
| 579 | uint32_t merge_block_id) { |
no test coverage detected