Index: lib/Analysis/ScalarEvolution.cpp =================================================================== --- lib/Analysis/ScalarEvolution.cpp +++ lib/Analysis/ScalarEvolution.cpp @@ -2434,7 +2434,7 @@ bool DeletedAdd = false; while (const SCEVAddExpr *Add = dyn_cast(Ops[Idx])) { if (Ops.size() > AddOpsInlineThreshold || - Add->getNumOperands() > AddOpsInlineThreshold) + (Ops.size() + Add->getNumOperands()) > AddOpsInlineThreshold) break; // If we have an add, expand the add operands onto the end of the operands // list.