Lines Matching defs:Sum
297 const SCEV *Sum = NoAddRecs.empty() ?
301 // the sum into a single value, so just use that.
303 if (const SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(Sum))
305 else if (!Sum->isZero())
306 Ops.push_back(Sum);
684 Value *Sum = nullptr;
689 if (!Sum) {
691 Sum = expand(Op);
693 } else if (PointerType *PTy = dyn_cast<PointerType>(Sum->getType())) {
694 // The running sum expression is a pointer. Try to form a getelementptr
706 Sum = expandAddToGEP(NewOps.begin(), NewOps.end(), PTy, Ty, Sum);
708 // The running sum is an integer, and there's a pointer at this level.
709 // Try to form a getelementptr. If the running sum is instructions,
712 NewOps.push_back(isa<Instruction>(Sum) ? SE.getUnknown(Sum) :
713 SE.getSCEV(Sum));
716 Sum = expandAddToGEP(NewOps.begin(), NewOps.end(), PTy, Ty, expand(Op));
720 Sum = InsertNoopCastOfTo(Sum, Ty);
721 Sum = InsertBinop(Instruction::Sub, Sum, W);
726 Sum = InsertNoopCastOfTo(Sum, Ty);
728 if (isa<Constant>(Sum)) std::swap(Sum, W);
729 Sum = InsertBinop(Instruction::Add, Sum, W);
734 return Sum;