Returns true if |id| is the merge target of a merge instruction.
| 33 | |
| 34 | // Returns true if |id| is the merge target of a merge instruction. |
| 35 | bool IsMerge(IRContext* context, uint32_t id) { |
| 36 | return !context->get_def_use_mgr()->WhileEachUse( |
| 37 | id, [](Instruction* user, uint32_t index) { |
| 38 | spv::Op op = user->opcode(); |
| 39 | if ((op == spv::Op::OpLoopMerge || op == spv::Op::OpSelectionMerge) && |
| 40 | index == 0u) { |
| 41 | return false; |
| 42 | } |
| 43 | return true; |
| 44 | }); |
| 45 | } |
| 46 | |
| 47 | // Returns true if |block| is the merge target of a merge instruction. |
| 48 | bool IsMerge(IRContext* context, BasicBlock* block) { |
no test coverage detected