Retrieve the index of the OpPhi instruction |phi| which corresponds to the incoming |block| id.
| 336 | // Retrieve the index of the OpPhi instruction |phi| which corresponds to the |
| 337 | // incoming |block| id. |
| 338 | uint32_t GetPhiIndexFromLabel(const BasicBlock* block, const Instruction* phi) { |
| 339 | for (uint32_t i = 1; i < phi->NumInOperands(); i += 2) { |
| 340 | if (block->id() == phi->GetSingleWordInOperand(i)) { |
| 341 | return i; |
| 342 | } |
| 343 | } |
| 344 | assert(false && "Could not find operand in instruction."); |
| 345 | return 0; |
| 346 | } |
| 347 | |
| 348 | void LoopUnrollerUtilsImpl::Init(Loop* loop) { |
| 349 | loop_condition_block_ = loop->FindConditionBlock(); |
no test coverage detected