| 145 | } |
| 146 | |
| 147 | Instruction* 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| |
no test coverage detected