Home | History | Annotate | Download | only in Scalar

Lines Matching refs:SE

73     ScalarEvolution *SE;
83 IndVarSimplify() : LoopPass(ID), LI(nullptr), SE(nullptr), DT(nullptr),
177 const SCEV *FromBase = SE->getPointerBase(SE->getSCEV(FromPtr));
178 const SCEV *ToBase = SE->getPointerBase(SE->getSCEV(ToPtr));
463 SE->forgetLoop(L);
531 SE->forgetValue(PN);
553 const SCEV *ExitValue = SE->getSCEVAtScope(Inst, L->getParentLoop());
554 if (!SE->isLoopInvariant(ExitValue, L) ||
555 !isSafeToExpand(ExitValue, *SE))
663 static void visitIVCast(CastInst *Cast, WideIVInfo &WI, ScalarEvolution *SE,
670 uint64_t Width = SE->getTypeSizeInBits(Ty);
675 WI.WidestNativeType = SE->getEffectiveSCEVType(Ty);
684 if (Width > SE->getTypeSizeInBits(WI.WidestNativeType))
685 WI.WidestNativeType = SE->getEffectiveSCEVType(Ty);
718 ScalarEvolution *SE;
739 SE(SEv),
854 ExtendOperExpr = SE->getSignExtendExpr(
855 SE->getSCEV(DU.NarrowUse->getOperand(ExtendOperIdx)), WideType);
857 ExtendOperExpr = SE->getZeroExtendExpr(
858 SE->getSCEV(DU.NarrowUse->getOperand(ExtendOperIdx)), WideType);
868 SE->getAddExpr(SE->getSCEV(DU.WideDef), ExtendOperExpr));
881 if (!SE->isSCEVable(NarrowUse->getType()))
884 const SCEV *NarrowExpr = SE->getSCEV(NarrowUse);
885 if (SE->getTypeSizeInBits(NarrowExpr->getType())
886 >= SE->getTypeSizeInBits(WideType)) {
893 SE->getSignExtendExpr(NarrowExpr, WideType) :
894 SE->getZeroExtendExpr(NarrowExpr, WideType);
942 unsigned CastWidth = SE->getTypeSizeInBits(DU.NarrowUse->getType());
943 unsigned IVWidth = SE->getTypeSizeInBits(WideType);
1009 if (WideAddRec != SE->getSCEV(WideUse)) {
1011 << ": " << *SE->getSCEV(WideUse) << " != " << *WideAddRec << "\n");
1046 const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(OrigPhi));
1052 SE->getSignExtendExpr(AddRec, WideType) :
1053 SE->getZeroExtendExpr(AddRec, WideType);
1055 assert(SE->getEffectiveSCEVType(WideIVExpr->getType()) == WideType &&
1066 assert(SE->properlyDominates(AddRec->getStart(), L->getHeader()) &&
1067 SE->properlyDominates(AddRec->getStepRecurrence(*SE), L->getHeader())
1084 WideIncExpr = SE->getSCEV(WideInc);
1125 ScalarEvolution *SE;
1134 SE(SCEV), DL(DL), IVPhi(IV) {
1142 void visitCast(CastInst *Cast) override { visitIVCast(Cast, WI, SE, DL); }
1176 IndVarSimplifyVisitor Visitor(CurrIV, SE, DL, DT);
1178 Changed |= simplifyUsersOfIV(CurrIV, SE, &LPM, DeadInsts, &Visitor);
1186 WidenIV Widener(WideIVs.back(), LI, SE, DT, DeadInsts);
1204 ScalarEvolution *SE) {
1216 const SCEV *R = SE->getSCEV(OrigCond->getOperand(1));
1217 R = SE->getMinusSCEV(R, SE->getConstant(R->getType(), 1));
1219 const SCEV *L = SE->getSCEV(OrigCond->getOperand(0));
1220 L = SE->getMinusSCEV(L, SE->getConstant(L->getType(), 1));
1232 if (isHighCostExpansion(*I, BI, Processed, SE))
1261 static bool canExpandBackedgeTakenCount(Loop *L, ScalarEvolution *SE) {
1262 const SCEV *BackedgeTakenCount = SE->getBackedgeTakenCount(L);
1276 if (isHighCostExpansion(BackedgeTakenCount, BI, Processed, SE))
1444 ScalarEvolution *SE, DominatorTree *DT, const DataLayout *DL) {
1445 uint64_t BCWidth = SE->getTypeSizeInBits(BECount->getType());
1458 if (!SE->isSCEVable(Phi->getType()))
1465 const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(Phi));
1472 uint64_t PhiWidth = SE->getTypeSizeInBits(AR->getType());
1476 const SCEV *Step = dyn_cast<SCEVConstant>(AR->getStepRecurrence(*SE));
1514 else if (PhiWidth <= SE->getTypeSizeInBits(BestPhi->getType()))
1526 SCEVExpander &Rewriter, ScalarEvolution *SE) {
1527 const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(IndVar));
1544 Type *OfsTy = SE->getEffectiveSCEVType(IVInit->getType());
1545 const SCEV *IVOffset = SE->getTruncateOrZeroExtend(IVCount, OfsTy);
1548 assert(SE->isLoopInvariant(IVOffset, L) &&
1554 assert(AR->getStart() == SE->getSCEV(GEPBase) && "bad loop counter");
1557 assert(SE->getSizeOfExpr(IntegerType::getInt64Ty(IndVar->getContext()),
1582 assert(AR->getStepRecurrence(*SE)->isOne() && "only handles unit stride");
1586 if (SE->getTypeSizeInBits(IVInit->getType())
1587 > SE->getTypeSizeInBits(IVCount->getType()))
1588 IVInit = SE->getTruncateExpr(IVInit, IVCount->getType());
1590 IVLimit = SE->getAddExpr(IVInit, IVCount);
1595 assert(SE->isLoopInvariant(IVLimit, L) &&
1616 assert(canExpandBackedgeTakenCount(L, SE) && "precondition");
1629 IVCount = SE->getAddExpr(BackedgeTakenCount,
1630 SE->getConstant(BackedgeTakenCount->getType(), 1));
1637 Value *ExitCnt = genLoopLimit(IndVar, IVCount, L, Rewriter, SE);
1660 unsigned CmpIndVarSize = SE->getTypeSizeInBits(CmpIndVar->getType());
1661 unsigned ExitCntSize = SE->getTypeSizeInBits(ExitCnt->getType());
1663 const SCEVAddRecExpr *AR = cast<SCEVAddRecExpr>(SE->getSCEV(IndVar));
1665 const SCEV *ARStep = AR->getStepRecurrence(*SE);
1815 SE = &getAnalysis<ScalarEvolution>();
1828 const SCEV *BackedgeTakenCount = SE->getBackedgeTakenCount(L);
1831 SCEVExpander Rewriter(*SE, "indvars");
1859 if (canExpandBackedgeTakenCount(L, SE) && needsLFTR(L, DT)) {
1860 PHINode *IndVar = FindLoopCounter(L, BackedgeTakenCount, SE, DT, DL);
1904 SE->forgetLoop(L);
1905 const SCEV *NewBECount = SE->getBackedgeTakenCount(L);
1906 if (SE->getTypeSizeInBits(BackedgeTakenCount->getType()) <
1907 SE->getTypeSizeInBits(NewBECount->getType()))
1908 NewBECount = SE->getTruncateOrNoop(NewBECount,
1911 BackedgeTakenCount = SE->getTruncateOrNoop(BackedgeTakenCount,