Lines Matching refs:SE
68 ScalarEvolution *SE; member in __anon5f70900a0111::IndVarSimplify
77 IndVarSimplify() : LoopPass(ID), LI(0), SE(0), DT(0), TD(0), in IndVarSimplify()
171 const SCEV *FromBase = SE->getPointerBase(SE->getSCEV(FromPtr)); in isValidRewrite()
172 const SCEV *ToBase = SE->getPointerBase(SE->getSCEV(ToPtr)); in isValidRewrite()
459 SE->forgetLoop(L); in RewriteNonIntegerIVs()
512 SE->forgetValue(PN); in RewriteLoopExitValues()
534 const SCEV *ExitValue = SE->getSCEVAtScope(Inst, L->getParentLoop()); in RewriteLoopExitValues()
535 if (!SE->isLoopInvariant(ExitValue, L)) in RewriteLoopExitValues()
597 ScalarEvolution *SE; member in __anon5f70900a0211::WideIVVisitor
605 SE(SCEV), TD(TData) { WI.NarrowIV = NarrowIV; } in WideIVVisitor()
621 uint64_t Width = SE->getTypeSizeInBits(Ty); in visitCast()
626 WI.WidestNativeType = SE->getEffectiveSCEVType(Ty); in visitCast()
635 if (Width > SE->getTypeSizeInBits(WI.WidestNativeType)) in visitCast()
636 WI.WidestNativeType = SE->getEffectiveSCEVType(Ty); in visitCast()
669 ScalarEvolution *SE; member in __anon5f70900a0311::WidenIV
690 SE(SEv), in WidenIV()
805 ExtendOperExpr = SE->getSignExtendExpr( in GetExtendedOperandRecurrence()
806 SE->getSCEV(DU.NarrowUse->getOperand(ExtendOperIdx)), WideType); in GetExtendedOperandRecurrence()
808 ExtendOperExpr = SE->getZeroExtendExpr( in GetExtendedOperandRecurrence()
809 SE->getSCEV(DU.NarrowUse->getOperand(ExtendOperIdx)), WideType); in GetExtendedOperandRecurrence()
819 SE->getAddExpr(SE->getSCEV(DU.WideDef), ExtendOperExpr)); in GetExtendedOperandRecurrence()
832 if (!SE->isSCEVable(NarrowUse->getType())) in GetWideRecurrence()
835 const SCEV *NarrowExpr = SE->getSCEV(NarrowUse); in GetWideRecurrence()
836 if (SE->getTypeSizeInBits(NarrowExpr->getType()) in GetWideRecurrence()
837 >= SE->getTypeSizeInBits(WideType)) { in GetWideRecurrence()
844 SE->getSignExtendExpr(NarrowExpr, WideType) : in GetWideRecurrence()
845 SE->getZeroExtendExpr(NarrowExpr, WideType); in GetWideRecurrence()
865 unsigned CastWidth = SE->getTypeSizeInBits(DU.NarrowUse->getType()); in WidenIVUse()
866 unsigned IVWidth = SE->getTypeSizeInBits(WideType); in WidenIVUse()
934 if (WideAddRec != SE->getSCEV(WideUse)) { in WidenIVUse()
936 << ": " << *SE->getSCEV(WideUse) << " != " << *WideAddRec << "\n"); in WidenIVUse()
972 const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(OrigPhi)); in CreateWideIV()
978 SE->getSignExtendExpr(AddRec, WideType) : in CreateWideIV()
979 SE->getZeroExtendExpr(AddRec, WideType); in CreateWideIV()
981 assert(SE->getEffectiveSCEVType(WideIVExpr->getType()) == WideType && in CreateWideIV()
992 assert(SE->properlyDominates(AddRec->getStart(), L->getHeader()) && in CreateWideIV()
993 SE->properlyDominates(AddRec->getStepRecurrence(*SE), L->getHeader()) in CreateWideIV()
1010 WideIncExpr = SE->getSCEV(WideInc); in CreateWideIV()
1075 WideIVVisitor WIV(CurrIV, SE, TD); in SimplifyAndExtend()
1077 Changed |= simplifyUsersOfIV(CurrIV, SE, &LPM, DeadInsts, &WIV); in SimplifyAndExtend()
1085 WidenIV Widener(WideIVs.back(), LI, SE, DT, DeadInsts); in SimplifyAndExtend()
1103 ScalarEvolution *SE) { in isHighCostExpansion() argument
1115 const SCEV *R = SE->getSCEV(OrigCond->getOperand(1)); in isHighCostExpansion()
1116 R = SE->getMinusSCEV(R, SE->getConstant(R->getType(), 1)); in isHighCostExpansion()
1118 const SCEV *L = SE->getSCEV(OrigCond->getOperand(0)); in isHighCostExpansion()
1119 L = SE->getMinusSCEV(L, SE->getConstant(L->getType(), 1)); in isHighCostExpansion()
1131 if (isHighCostExpansion(*I, BI, Processed, SE)) in isHighCostExpansion()
1160 static bool canExpandBackedgeTakenCount(Loop *L, ScalarEvolution *SE) { in canExpandBackedgeTakenCount() argument
1161 const SCEV *BackedgeTakenCount = SE->getBackedgeTakenCount(L); in canExpandBackedgeTakenCount()
1175 if (isHighCostExpansion(BackedgeTakenCount, BI, Processed, SE)) in canExpandBackedgeTakenCount()
1293 ScalarEvolution *SE, DominatorTree *DT, const TargetData *TD) { in FindLoopCounter() argument
1294 uint64_t BCWidth = SE->getTypeSizeInBits(BECount->getType()); in FindLoopCounter()
1307 if (!SE->isSCEVable(Phi->getType())) in FindLoopCounter()
1314 const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(Phi)); in FindLoopCounter()
1321 uint64_t PhiWidth = SE->getTypeSizeInBits(AR->getType()); in FindLoopCounter()
1325 const SCEV *Step = dyn_cast<SCEVConstant>(AR->getStepRecurrence(*SE)); in FindLoopCounter()
1350 if (PhiWidth <= SE->getTypeSizeInBits(BestPhi->getType())) in FindLoopCounter()
1362 SCEVExpander &Rewriter, ScalarEvolution *SE) { in genLoopLimit() argument
1363 const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(IndVar)); in genLoopLimit()
1374 Type *OfsTy = SE->getEffectiveSCEVType(IVInit->getType()); in genLoopLimit()
1375 const SCEV *IVOffset = SE->getTruncateOrSignExtend(IVCount, OfsTy); in genLoopLimit()
1378 assert(SE->isLoopInvariant(IVOffset, L) && in genLoopLimit()
1384 assert(AR->getStart() == SE->getSCEV(GEPBase) && "bad loop counter"); in genLoopLimit()
1387 assert(SE->getSizeOfExpr( in genLoopLimit()
1411 assert(AR->getStepRecurrence(*SE)->isOne() && "only handles unit stride"); in genLoopLimit()
1415 if (SE->getTypeSizeInBits(IVInit->getType()) in genLoopLimit()
1416 > SE->getTypeSizeInBits(IVCount->getType())) in genLoopLimit()
1417 IVInit = SE->getTruncateExpr(IVInit, IVCount->getType()); in genLoopLimit()
1419 IVLimit = SE->getAddExpr(IVInit, IVCount); in genLoopLimit()
1424 assert(SE->isLoopInvariant(IVLimit, L) && in genLoopLimit()
1445 assert(canExpandBackedgeTakenCount(L, SE) && "precondition"); in LinearFunctionTestReplace()
1462 SE->getAddExpr(IVCount, SE->getConstant(IVCount->getType(), 1)); in LinearFunctionTestReplace()
1466 const SCEV *Zero = SE->getConstant(IVCount->getType(), 0); in LinearFunctionTestReplace()
1468 SE->isLoopEntryGuardedByCond(L, ICmpInst::ICMP_NE, N, Zero)) { in LinearFunctionTestReplace()
1470 IVCount = SE->getTruncateOrZeroExtend(N, CntTy); in LinearFunctionTestReplace()
1473 IVCount = SE->getTruncateOrZeroExtend(IVCount, CntTy); in LinearFunctionTestReplace()
1474 IVCount = SE->getAddExpr(IVCount, SE->getConstant(CntTy, 1)); in LinearFunctionTestReplace()
1483 IVCount = SE->getTruncateOrZeroExtend(IVCount, CntTy); in LinearFunctionTestReplace()
1487 Value *ExitCnt = genLoopLimit(IndVar, IVCount, L, Rewriter, SE); in LinearFunctionTestReplace()
1507 if (SE->getTypeSizeInBits(CmpIndVar->getType()) in LinearFunctionTestReplace()
1508 > SE->getTypeSizeInBits(ExitCnt->getType())) { in LinearFunctionTestReplace()
1635 SE = &getAnalysis<ScalarEvolution>(); in runOnLoop()
1646 const SCEV *BackedgeTakenCount = SE->getBackedgeTakenCount(L); in runOnLoop()
1649 SCEVExpander Rewriter(*SE, "indvars"); in runOnLoop()
1677 if (canExpandBackedgeTakenCount(L, SE) && needsLFTR(L, DT)) { in runOnLoop()
1678 PHINode *IndVar = FindLoopCounter(L, BackedgeTakenCount, SE, DT, TD); in runOnLoop()
1722 SE->forgetLoop(L); in runOnLoop()
1723 const SCEV *NewBECount = SE->getBackedgeTakenCount(L); in runOnLoop()
1724 if (SE->getTypeSizeInBits(BackedgeTakenCount->getType()) < in runOnLoop()
1725 SE->getTypeSizeInBits(NewBECount->getType())) in runOnLoop()
1726 NewBECount = SE->getTruncateOrNoop(NewBECount, in runOnLoop()
1729 BackedgeTakenCount = SE->getTruncateOrNoop(BackedgeTakenCount, in runOnLoop()