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

Method GetMergeInst

source/opt/basic_block.cpp:57–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57const Instruction* BasicBlock::GetMergeInst() const {
58 const Instruction* result = nullptr;
59 // If it exists, the merge instruction immediately precedes the
60 // terminator.
61 auto iter = ctail();
62 if (iter != cbegin()) {
63 --iter;
64 const auto opcode = iter->opcode();
65 if (opcode == spv::Op::OpLoopMerge || opcode == spv::Op::OpSelectionMerge) {
66 result = &*iter;
67 }
68 }
69 return result;
70}
71
72Instruction* BasicBlock::GetMergeInst() {
73 Instruction* result = nullptr;

Callers 15

ApplyMethod · 0.80
ApplyMethod · 0.80
FixExitConditionMethod · 0.80
IsHeaderFunction · 0.80
CanMergeWithSuccessorFunction · 0.80
MergeWithSuccessorFunction · 0.80

Calls 1

opcodeMethod · 0.45

Tested by

no test coverage detected