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

Method CreateRecurrentExpression

source/opt/scalar_analysis.cpp:74–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74SENode* 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
97SENode* ScalarEvolutionAnalysis::AnalyzeMultiplyOp(
98 const Instruction* multiply) {

Callers 1

PropagateConstraintsMethod · 0.80

Calls 3

IsCantComputeMethod · 0.80
AddOffsetMethod · 0.80
AddCoefficientMethod · 0.80

Tested by

no test coverage detected