• Home
  • Raw
  • Download

Lines Matching refs:Expr

61 static SCEV::NoWrapFlags getNoWrapFlags(const SCEV *Expr) {  in getNoWrapFlags()  argument
62 if (auto *NAry = dyn_cast<SCEVNAryExpr>(Expr)) in getNoWrapFlags()
116 PWACtx SCEVAffinator::getPwAff(const SCEV *Expr, BasicBlock *BB, in getPwAff() argument
128 return visit(Expr); in getPwAff()
131 PWACtx SCEVAffinator::checkForWrapping(const SCEV *Expr, PWACtx PWAC) const { in checkForWrapping() argument
139 if (IgnoreIntegerWrapping || (getNoWrapFlags(Expr) & SCEV::FlagNSW)) in checkForWrapping()
142 isl::pw_aff PWAMod = addModuloSemantic(PWAC.first, Expr->getType()); in checkForWrapping()
187 bool SCEVAffinator::computeModuloForExpr(const SCEV *Expr) { in computeModuloForExpr() argument
188 unsigned Width = TD.getTypeSizeInBits(Expr->getType()); in computeModuloForExpr()
190 if (auto *NAry = dyn_cast<SCEVNAryExpr>(Expr)) in computeModuloForExpr()
196 PWACtx SCEVAffinator::visit(const SCEV *Expr) { in visit() argument
198 auto Key = std::make_pair(Expr, BB); in visit()
203 auto ConstantAndLeftOverPair = extractConstantFactor(Expr, SE); in visit()
205 Expr = ConstantAndLeftOverPair.second; in visit()
208 S->addParams(getParamsInAffineExpr(&S->getRegion(), Scope, Expr, SE)); in visit()
214 if (isl_id *Id = S->getIdForParam(Expr).release()) { in visit()
224 PWAC = SCEVVisitor<SCEVAffinator, PWACtx>::visit(Expr); in visit()
225 if (computeModuloForExpr(Expr)) in visit()
226 PWAC.first = addModuloSemantic(PWAC.first, Expr->getType()); in visit()
228 PWAC = checkForWrapping(Expr, PWAC); in visit()
234 PWAC.first = addModuloSemantic(PWAC.first, Expr->getType()); in visit()
247 PWACtx SCEVAffinator::visitConstant(const SCEVConstant *Expr) { in visitConstant() argument
248 ConstantInt *Value = Expr->getValue(); in visitConstant()
269 PWACtx SCEVAffinator::visitPtrToIntExpr(const SCEVPtrToIntExpr *Expr) { in visitPtrToIntExpr() argument
270 return visit(Expr->getOperand(0)); in visitPtrToIntExpr()
273 PWACtx SCEVAffinator::visitTruncateExpr(const SCEVTruncateExpr *Expr) { in visitTruncateExpr() argument
279 auto *Op = Expr->getOperand(); in visitTruncateExpr()
282 unsigned Width = TD.getTypeSizeInBits(Expr->getType()); in visitTruncateExpr()
284 if (computeModuloForExpr(Expr)) in visitTruncateExpr()
308 PWACtx SCEVAffinator::visitZeroExtendExpr(const SCEVZeroExtendExpr *Expr) { in visitZeroExtendExpr() argument
352 auto *Op = Expr->getOperand(); in visitZeroExtendExpr()
368 PWACtx SCEVAffinator::visitSignExtendExpr(const SCEVSignExtendExpr *Expr) { in visitSignExtendExpr() argument
370 return visit(Expr->getOperand()); in visitSignExtendExpr()
373 PWACtx SCEVAffinator::visitAddExpr(const SCEVAddExpr *Expr) { in visitAddExpr() argument
374 PWACtx Sum = visit(Expr->getOperand(0)); in visitAddExpr()
376 for (int i = 1, e = Expr->getNumOperands(); i < e; ++i) { in visitAddExpr()
377 Sum = combine(Sum, visit(Expr->getOperand(i)), isl_pw_aff_add); in visitAddExpr()
385 PWACtx SCEVAffinator::visitMulExpr(const SCEVMulExpr *Expr) { in visitMulExpr() argument
386 PWACtx Prod = visit(Expr->getOperand(0)); in visitMulExpr()
388 for (int i = 1, e = Expr->getNumOperands(); i < e; ++i) { in visitMulExpr()
389 Prod = combine(Prod, visit(Expr->getOperand(i)), isl_pw_aff_mul); in visitMulExpr()
397 PWACtx SCEVAffinator::visitAddRecExpr(const SCEVAddRecExpr *Expr) { in visitAddRecExpr() argument
398 assert(Expr->isAffine() && "Only affine AddRecurrences allowed"); in visitAddRecExpr()
400 auto Flags = Expr->getNoWrapFlags(); in visitAddRecExpr()
403 if (Expr->getStart()->isZero()) { in visitAddRecExpr()
404 assert(S->contains(Expr->getLoop()) && in visitAddRecExpr()
407 PWACtx Step = visit(Expr->getOperand(1)); in visitAddRecExpr()
411 unsigned loopDimension = S->getRelativeLoopDepth(Expr->getLoop()); in visitAddRecExpr()
427 SE.getAddRecExpr(SE.getConstant(Expr->getStart()->getType(), 0), in visitAddRecExpr()
428 Expr->getStepRecurrence(SE), Expr->getLoop(), Flags); in visitAddRecExpr()
431 PWACtx Start = visit(Expr->getStart()); in visitAddRecExpr()
436 PWACtx SCEVAffinator::visitSMaxExpr(const SCEVSMaxExpr *Expr) { in visitSMaxExpr() argument
437 PWACtx Max = visit(Expr->getOperand(0)); in visitSMaxExpr()
439 for (int i = 1, e = Expr->getNumOperands(); i < e; ++i) { in visitSMaxExpr()
440 Max = combine(Max, visit(Expr->getOperand(i)), isl_pw_aff_max); in visitSMaxExpr()
448 PWACtx SCEVAffinator::visitSMinExpr(const SCEVSMinExpr *Expr) { in visitSMinExpr() argument
449 PWACtx Min = visit(Expr->getOperand(0)); in visitSMinExpr()
451 for (int i = 1, e = Expr->getNumOperands(); i < e; ++i) { in visitSMinExpr()
452 Min = combine(Min, visit(Expr->getOperand(i)), isl_pw_aff_min); in visitSMinExpr()
460 PWACtx SCEVAffinator::visitUMaxExpr(const SCEVUMaxExpr *Expr) { in visitUMaxExpr() argument
464 PWACtx SCEVAffinator::visitUMinExpr(const SCEVUMinExpr *Expr) { in visitUMinExpr() argument
468 PWACtx SCEVAffinator::visitUDivExpr(const SCEVUDivExpr *Expr) { in visitUDivExpr() argument
476 auto *Dividend = Expr->getLHS(); in visitUDivExpr()
477 auto *Divisor = Expr->getRHS(); in visitUDivExpr()
488 unsigned Width = TD.getTypeSizeInBits(Expr->getType()); in visitUDivExpr()
540 PWACtx SCEVAffinator::visitUnknown(const SCEVUnknown *Expr) { in visitUnknown() argument
541 if (Instruction *I = dyn_cast<Instruction>(Expr->getValue())) { in visitUnknown()