Lines Matching defs:Sum
289 const SCEV *Sum = NoAddRecs.empty() ?
293 // the sum into a single value, so just use that.
295 if (const SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(Sum))
297 else if (!Sum->isZero())
298 Ops.push_back(Sum);
711 Value *Sum = 0;
716 if (!Sum) {
718 Sum = expand(Op);
720 } else if (PointerType *PTy = dyn_cast<PointerType>(Sum->getType())) {
721 // The running sum expression is a pointer. Try to form a getelementptr
733 Sum = expandAddToGEP(NewOps.begin(), NewOps.end(), PTy, Ty, Sum);
735 // The running sum is an integer, and there's a pointer at this level.
736 // Try to form a getelementptr. If the running sum is instructions,
739 NewOps.push_back(isa<Instruction>(Sum) ? SE.getUnknown(Sum) :
740 SE.getSCEV(Sum));
743 Sum = expandAddToGEP(NewOps.begin(), NewOps.end(), PTy, Ty, expand(Op));
747 Sum = InsertNoopCastOfTo(Sum, Ty);
748 Sum = InsertBinop(Instruction::Sub, Sum, W);
753 Sum = InsertNoopCastOfTo(Sum, Ty);
755 if (isa<Constant>(Sum)) std::swap(Sum, W);
756 Sum = InsertBinop(Instruction::Add, Sum, W);
761 return Sum;