Lines Matching defs:Sum
309 const SCEV *Sum = NoAddRecs.empty() ?
313 // the sum into a single value, so just use that.
315 if (const SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(Sum))
317 else if (!Sum->isZero())
318 Ops.push_back(Sum);
684 Value *Sum = nullptr;
688 if (!Sum) {
690 Sum = expand(Op);
692 } else if (PointerType *PTy = dyn_cast<PointerType>(Sum->getType())) {
693 // The running sum expression is a pointer. Try to form a getelementptr
705 Sum = expandAddToGEP(NewOps.begin(), NewOps.end(), PTy, Ty, Sum);
707 // The running sum is an integer, and there's a pointer at this level.
708 // Try to form a getelementptr. If the running sum is instructions,
711 NewOps.push_back(isa<Instruction>(Sum) ? SE.getUnknown(Sum) :
712 SE.getSCEV(Sum));
715 Sum = expandAddToGEP(NewOps.begin(), NewOps.end(), PTy, Ty, expand(Op));
719 Sum = InsertNoopCastOfTo(Sum, Ty);
720 Sum = InsertBinop(Instruction::Sub, Sum, W);
725 Sum = InsertNoopCastOfTo(Sum, Ty);
727 if (isa<Constant>(Sum)) std::swap(Sum, W);
728 Sum = InsertBinop(Instruction::Add, Sum, W);
733 return Sum;