Home | History | Annotate | Download | only in Scalar

Lines Matching refs:SE

69     ScalarEvolution *SE;
79 IndVarSimplify() : LoopPass(ID), LI(0), SE(0), DT(0), TD(0),
173 const SCEV *FromBase = SE->getPointerBase(SE->getSCEV(FromPtr));
174 const SCEV *ToBase = SE->getPointerBase(SE->getSCEV(ToPtr));
459 SE->forgetLoop(L);
512 SE->forgetValue(PN);
534 const SCEV *ExitValue = SE->getSCEVAtScope(Inst, L->getParentLoop());
535 if (!SE->isLoopInvariant(ExitValue, L))
599 ScalarEvolution *SE;
607 SE(SCEV), TD(TData) { WI.NarrowIV = NarrowIV; }
623 uint64_t Width = SE->getTypeSizeInBits(Ty);
628 WI.WidestNativeType = SE->getEffectiveSCEVType(Ty);
637 if (Width > SE->getTypeSizeInBits(WI.WidestNativeType))
638 WI.WidestNativeType = SE->getEffectiveSCEVType(Ty);
671 ScalarEvolution *SE;
692 SE(SEv),
807 ExtendOperExpr = SE->getSignExtendExpr(
808 SE->getSCEV(DU.NarrowUse->getOperand(ExtendOperIdx)), WideType);
810 ExtendOperExpr = SE->getZeroExtendExpr(
811 SE->getSCEV(DU.NarrowUse->getOperand(ExtendOperIdx)), WideType);
821 SE->getAddExpr(SE->getSCEV(DU.WideDef), ExtendOperExpr));
834 if (!SE->isSCEVable(NarrowUse->getType()))
837 const SCEV *NarrowExpr = SE->getSCEV(NarrowUse);
838 if (SE->getTypeSizeInBits(NarrowExpr->getType())
839 >= SE->getTypeSizeInBits(WideType)) {
846 SE->getSignExtendExpr(NarrowExpr, WideType) :
847 SE->getZeroExtendExpr(NarrowExpr, WideType);
867 unsigned CastWidth = SE->getTypeSizeInBits(DU.NarrowUse->getType());
868 unsigned IVWidth = SE->getTypeSizeInBits(WideType);
936 if (WideAddRec != SE->getSCEV(WideUse)) {
938 << ": " << *SE->getSCEV(WideUse) << " != " << *WideAddRec << "\n");
974 const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(OrigPhi));
980 SE->getSignExtendExpr(AddRec, WideType) :
981 SE->getZeroExtendExpr(AddRec, WideType);
983 assert(SE->getEffectiveSCEVType(WideIVExpr->getType()) == WideType &&
994 assert(SE->properlyDominates(AddRec->getStart(), L->getHeader()) &&
995 SE->properlyDominates(AddRec->getStepRecurrence(*SE), L->getHeader())
1012 WideIncExpr = SE->getSCEV(WideInc);
1077 WideIVVisitor WIV(CurrIV, SE, TD);
1079 Changed |= simplifyUsersOfIV(CurrIV, SE, &LPM, DeadInsts, &WIV);
1087 WidenIV Widener(WideIVs.back(), LI, SE, DT, DeadInsts);
1105 ScalarEvolution *SE) {
1117 const SCEV *R = SE->getSCEV(OrigCond->getOperand(1));
1118 R = SE->getMinusSCEV(R, SE->getConstant(R->getType(), 1));
1120 const SCEV *L = SE->getSCEV(OrigCond->getOperand(0));
1121 L = SE->getMinusSCEV(L, SE->getConstant(L->getType(), 1));
1133 if (isHighCostExpansion(*I, BI, Processed, SE))
1162 static bool canExpandBackedgeTakenCount(Loop *L, ScalarEvolution *SE) {
1163 const SCEV *BackedgeTakenCount = SE->getBackedgeTakenCount(L);
1177 if (isHighCostExpansion(BackedgeTakenCount, BI, Processed, SE))
1349 ScalarEvolution *SE, DominatorTree *DT, const DataLayout *TD) {
1350 uint64_t BCWidth = SE->getTypeSizeInBits(BECount->getType());
1363 if (!SE->isSCEVable(Phi->getType()))
1370 const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(Phi));
1377 uint64_t PhiWidth = SE->getTypeSizeInBits(AR->getType());
1381 const SCEV *Step = dyn_cast<SCEVConstant>(AR->getStepRecurrence(*SE));
1419 else if (PhiWidth <= SE->getTypeSizeInBits(BestPhi->getType()))
1431 SCEVExpander &Rewriter, ScalarEvolution *SE) {
1432 const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(IndVar));
1443 Type *OfsTy = SE->getEffectiveSCEVType(IVInit->getType());
1444 const SCEV *IVOffset = SE->getTruncateOrSignExtend(IVCount, OfsTy);
1447 assert(SE->isLoopInvariant(IVOffset, L) &&
1453 assert(AR->getStart() == SE->getSCEV(GEPBase) && "bad loop counter");
1456 assert(SE->getSizeOfExpr(
1480 assert(AR->getStepRecurrence(*SE)->isOne() && "only handles unit stride");
1484 if (SE->getTypeSizeInBits(IVInit->getType())
1485 > SE->getTypeSizeInBits(IVCount->getType()))
1486 IVInit = SE->getTruncateExpr(IVInit, IVCount->getType());
1488 IVLimit = SE->getAddExpr(IVInit, IVCount);
1493 assert(SE->isLoopInvariant(IVLimit, L) &&
1514 assert(canExpandBackedgeTakenCount(L, SE) && "precondition");
1531 SE->getAddExpr(IVCount, SE->getConstant(IVCount->getType(), 1));
1535 const SCEV *Zero = SE->getConstant(IVCount->getType(), 0);
1537 SE->isLoopEntryGuardedByCond(L, ICmpInst::ICMP_NE, N, Zero)) {
1539 IVCount = SE->getTruncateOrZeroExtend(N, CntTy);
1542 IVCount = SE->getTruncateOrZeroExtend(IVCount, CntTy);
1543 IVCount = SE->getAddExpr(IVCount, SE->getConstant(CntTy, 1));
1552 IVCount = SE->getTruncateOrZeroExtend(IVCount, CntTy);
1556 Value *ExitCnt = genLoopLimit(IndVar, IVCount, L, Rewriter, SE);
1576 if (SE->getTypeSizeInBits(CmpIndVar->getType())
1577 > SE->getTypeSizeInBits(ExitCnt->getType())) {
1704 SE = &getAnalysis<ScalarEvolution>();
1716 const SCEV *BackedgeTakenCount = SE->getBackedgeTakenCount(L);
1719 SCEVExpander Rewriter(*SE, "indvars");
1747 if (canExpandBackedgeTakenCount(L, SE) && needsLFTR(L, DT)) {
1748 PHINode *IndVar = FindLoopCounter(L, BackedgeTakenCount, SE, DT, TD);
1792 SE->forgetLoop(L);
1793 const SCEV *NewBECount = SE->getBackedgeTakenCount(L);
1794 if (SE->getTypeSizeInBits(BackedgeTakenCount->getType()) <
1795 SE->getTypeSizeInBits(NewBECount->getType()))
1796 NewBECount = SE->getTruncateOrNoop(NewBECount,
1799 BackedgeTakenCount = SE->getTruncateOrNoop(BackedgeTakenCount,