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

Method GetConditionInst

source/opt/loop_descriptor.cpp:147–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147Instruction* Loop::GetConditionInst() const {
148 BasicBlock* condition_block = FindConditionBlock();
149 if (!condition_block) {
150 return nullptr;
151 }
152 Instruction* branch_conditional = &*condition_block->tail();
153 if (!branch_conditional ||
154 branch_conditional->opcode() != spv::Op::OpBranchConditional) {
155 return nullptr;
156 }
157 Instruction* condition_inst = context_->get_def_use_mgr()->GetDef(
158 branch_conditional->GetSingleWordInOperand(0));
159 if (IsSupportedCondition(condition_inst->opcode())) {
160 return condition_inst;
161 }
162
163 return nullptr;
164}
165
166// Extract the initial value from the |induction| OpPhi instruction and store it
167// in |value|. If the function couldn't find the initial value of |induction|

Callers 4

CheckConditionMethod · 0.80
GetLowerBoundMethod · 0.80
GetUpperBoundMethod · 0.80
GetTripCountMethod · 0.80

Calls 5

tailMethod · 0.45
opcodeMethod · 0.45
GetDefMethod · 0.45
get_def_use_mgrMethod · 0.45

Tested by

no test coverage detected