| 72 | } |
| 73 | |
| 74 | SENode* ScalarEvolutionAnalysis::CreateRecurrentExpression( |
| 75 | const Loop* loop, SENode* offset, SENode* coefficient) { |
| 76 | assert(loop && "Recurrent add expressions must have a valid loop."); |
| 77 | |
| 78 | // If operands are can't compute then the whole graph is can't compute. |
| 79 | if (offset->IsCantCompute() || coefficient->IsCantCompute()) |
| 80 | return CreateCantComputeNode(); |
| 81 | |
| 82 | const Loop* loop_to_use = nullptr; |
| 83 | if (pretend_equal_[loop]) { |
| 84 | loop_to_use = pretend_equal_[loop]; |
| 85 | } else { |
| 86 | loop_to_use = loop; |
| 87 | } |
| 88 | |
| 89 | std::unique_ptr<SERecurrentNode> phi_node{ |
| 90 | new SERecurrentNode(this, loop_to_use)}; |
| 91 | phi_node->AddOffset(offset); |
| 92 | phi_node->AddCoefficient(coefficient); |
| 93 | |
| 94 | return GetCachedOrAdd(std::move(phi_node)); |
| 95 | } |
| 96 | |
| 97 | SENode* ScalarEvolutionAnalysis::AnalyzeMultiplyOp( |
| 98 | const Instruction* multiply) { |
no test coverage detected