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

Function IsMerge

source/opt/block_merge_util.cpp:35–45  ·  view source on GitHub ↗

Returns true if |id| is the merge target of a merge instruction.

Source from the content-addressed store, hash-verified

33
34// Returns true if |id| is the merge target of a merge instruction.
35bool 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.
48bool IsMerge(IRContext* context, BasicBlock* block) {

Callers 1

CanMergeWithSuccessorFunction · 0.85

Calls 4

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

Tested by

no test coverage detected