Lines Matching refs:SE

93          SE.DT.dominates(cast<Instruction>(Ret), &*BIP));  in ReuseOrCreateCast()
162 assert(SE.getTypeSizeInBits(V->getType()) == SE.getTypeSizeInBits(Ty) && in InsertNoopCastOfTo()
186 SE.getTypeSizeInBits(Ty) == SE.getTypeSizeInBits(V->getType())) { in InsertNoopCastOfTo()
190 SE.getTypeSizeInBits(CI->getType()) == in InsertNoopCastOfTo()
191 SE.getTypeSizeInBits(CI->getOperand(0)->getType())) in InsertNoopCastOfTo()
196 SE.getTypeSizeInBits(CE->getType()) == in InsertNoopCastOfTo()
197 SE.getTypeSizeInBits(CE->getOperand(0)->getType())) in InsertNoopCastOfTo()
261 while (const Loop *L = SE.LI.getLoopFor(Builder.GetInsertBlock())) { in InsertBinop()
313 SE.DT.dominates(cast<Instruction>(V), &*Builder.GetInsertPoint())); in expandAddToGEP()
347 while (const Loop *L = SE.LI.getLoopFor(Builder.GetInsertBlock())) { in expandAddToGEP()
403 L = PickMostRelevantLoop(L, getRelevantLoop(Op), SE.DT); in getRelevantLoop()
409 return Pair.first->second = SE.LI.getLoopFor(I->getParent()); in getRelevantLoop()
465 llvm::stable_sort(OpsAndLoops, LoopCompare(SE.DT)); in visitAddExpr()
491 X = SE.getSCEV(U->getValue()); in visitAddExpr()
494 Sum = expandAddToGEP(SE.getAddExpr(NewOps), Sum); in visitAddExpr()
497 Value *W = expand(SE.getNegativeSCEV(Op)); in visitAddExpr()
526 llvm::stable_sort(OpsAndLoops, LoopCompare(SE.DT)); in visitMulExpr()
620 /*IsSafeToHoist*/ SE.isKnownNonZero(S->getRHS())); in visitUDivExpr()
636 if (!SE.DT.dominates(OInst, IVIncInsertPos)) in isNormalAddRecExprPHI()
675 if (!OInst || SE.DT.dominates(OInst, InsertPos)) in getIVIncOperand()
686 if (!SE.DT.dominates(OInst, InsertPos)) in getIVIncOperand()
729 if (auto Flags = SE.getStrengthenedNoWrapFlagsFromBinOp(OBO)) { in hoistIVInc()
738 if (SE.DT.dominates(IncV, InsertPos)) { in hoistIVInc()
747 !SE.DT.dominates(InsertPos->getParent(), IncV->getParent())) in hoistIVInc()
750 if (!SE.LI.movementPreservesLCSSAForm(IncV, InsertPos)) in hoistIVInc()
762 if (SE.DT.dominates(IncV, InsertPos)) in hoistIVInc()
798 IncV = expandAddToGEP(SE.getSCEV(StepV), PN); in expandIVInc()
809 static bool canBeCheaplyTransformed(ScalarEvolution &SE, in canBeCheaplyTransformed() argument
823 Phi = dyn_cast<SCEVAddRecExpr>(SE.getTruncateOrNoop(Phi, RequestedTy)); in canBeCheaplyTransformed()
834 if (SE.getMinusSCEV(Requested->getStart(), Requested) == Phi) { in canBeCheaplyTransformed()
842 static bool IsIncrementNSW(ScalarEvolution &SE, const SCEVAddRecExpr *AR) { in IsIncrementNSW() argument
848 const SCEV *Step = AR->getStepRecurrence(SE); in IsIncrementNSW()
849 const SCEV *OpAfterExtend = SE.getAddExpr(SE.getSignExtendExpr(Step, WideTy), in IsIncrementNSW()
850 SE.getSignExtendExpr(AR, WideTy)); in IsIncrementNSW()
852 SE.getSignExtendExpr(SE.getAddExpr(AR, Step), WideTy); in IsIncrementNSW()
856 static bool IsIncrementNUW(ScalarEvolution &SE, const SCEVAddRecExpr *AR) { in IsIncrementNUW() argument
862 const SCEV *Step = AR->getStepRecurrence(SE); in IsIncrementNUW()
863 const SCEV *OpAfterExtend = SE.getAddExpr(SE.getZeroExtendExpr(Step, WideTy), in IsIncrementNUW()
864 SE.getZeroExtendExpr(AR, WideTy)); in IsIncrementNUW()
866 SE.getZeroExtendExpr(SE.getAddExpr(AR, Step), WideTy); in IsIncrementNUW()
892 SE.DT.properlyDominates(LatchBlock, IVIncInsertLoop->getHeader()); in getAddRecExprPHILiterally()
895 if (!SE.isSCEVable(PN.getType())) in getAddRecExprPHILiterally()
906 const SCEVAddRecExpr *PhiSCEV = dyn_cast<SCEVAddRecExpr>(SE.getSCEV(&PN)); in getAddRecExprPHILiterally()
944 canBeCheaplyTransformed(SE, PhiSCEV, Normalized, InvertStep)) { in getAddRecExprPHILiterally()
988 SE.DT.properlyDominates(cast<Instruction>(StartV)->getParent(), in getAddRecExprPHILiterally()
993 const SCEV *Step = Normalized->getStepRecurrence(SE); in getAddRecExprPHILiterally()
1000 Step = SE.getNegativeSCEV(Step); in getAddRecExprPHILiterally()
1007 bool IncrementIsNUW = !useSubtract && IsIncrementNUW(SE, Normalized); in getAddRecExprPHILiterally()
1008 bool IncrementIsNSW = !useSubtract && IsIncrementNSW(SE, Normalized); in getAddRecExprPHILiterally()
1065 normalizeForPostIncUse(S, Loops, SE, /*CheckInvertible=*/false)); in expandAddRecExprLiterally()
1069 const SCEV *Step = Normalized->getStepRecurrence(SE); in expandAddRecExprLiterally()
1070 assert(SE.properlyDominates(Start, L->getHeader()) && in expandAddRecExprLiterally()
1072 assert(SE.dominates(Step, L->getHeader()) && "Step not dominate loop header"); in expandAddRecExprLiterally()
1105 !SE.DT.dominates(cast<Instruction>(Result), in expandAddRecExprLiterally()
1119 Step = SE.getNegativeSCEV(Step); in expandAddRecExprLiterally()
1159 Type *Ty = SE.getEffectiveSCEVType(S->getType()); in visitAddRecExpr()
1165 if (SE.getTypeSizeInBits(PN->getType()) >= SE.getTypeSizeInBits(Ty)) in visitAddRecExpr()
1171 SE.getTypeSizeInBits(CanonicalIV->getType()) > SE.getTypeSizeInBits(Ty) && in visitAddRecExpr()
1175 NewOps[i] = SE.getAnyExtendExpr(S->getOperand(i), CanonicalIV->getType()); in visitAddRecExpr()
1176 Value *V = expand(SE.getAddRecExpr(NewOps, S->getLoop(), in visitAddRecExpr()
1180 V = expand(SE.getTruncateExpr(SE.getUnknown(V), Ty), NewInsertPt); in visitAddRecExpr()
1187 Value *StartV = expand(SE.getPointerBase(S)); in visitAddRecExpr()
1188 return expandAddToGEP(SE.removePointerBase(S), StartV); in visitAddRecExpr()
1192 NewOps[0] = SE.getConstant(Ty, 0); in visitAddRecExpr()
1193 const SCEV *Rest = SE.getAddRecExpr(NewOps, L, in visitAddRecExpr()
1200 const SCEV *AddExprLHS = SE.getUnknown(expand(S->getStart())); in visitAddRecExpr()
1201 const SCEV *AddExprRHS = SE.getUnknown(expand(Rest)); in visitAddRecExpr()
1202 return expand(SE.getAddExpr(AddExprLHS, AddExprRHS)); in visitAddRecExpr()
1243 assert(Ty == SE.getEffectiveSCEVType(CanonicalIV->getType()) && in visitAddRecExpr()
1254 expand(SE.getTruncateOrNoop( in visitAddRecExpr()
1255 SE.getMulExpr(SE.getUnknown(CanonicalIV), in visitAddRecExpr()
1256 SE.getNoopOrAnyExtend(S->getOperand(1), in visitAddRecExpr()
1264 const SCEV *IH = SE.getUnknown(CanonicalIV); // Get I as a "symbolic" SCEV. in visitAddRecExpr()
1268 const SCEV *Ext = SE.getNoopOrAnyExtend(S, CanonicalIV->getType()); in visitAddRecExpr()
1272 const SCEV *V = cast<SCEVAddRecExpr>(NewS)->evaluateAtIteration(IH, SE); in visitAddRecExpr()
1275 const SCEV *T = SE.getTruncateOrNoop(V, Ty); in visitAddRecExpr()
1293 SE.isKnownNonNegative(S->getOperand())); in visitZeroExtendExpr()
1362 assert(SE.getTypeSizeInBits(Ty) == SE.getTypeSizeInBits(SH->getType()) && in expandCodeFor()
1374 if (!CanonicalMode && SE.containsAddRecurrence(S)) in FindValueInExprValueMap()
1381 for (Value *V : SE.getSCEVValues(S)) { in FindValueInExprValueMap()
1390 if (S->getType() != V->getType() || !SE.DT.dominates(EntInst, InsertPt) || in FindValueInExprValueMap()
1391 !(SE.LI.getLoopFor(EntInst->getParent()) == nullptr || in FindValueInExprValueMap()
1392 SE.LI.getLoopFor(EntInst->getParent())->contains(InsertPt))) in FindValueInExprValueMap()
1396 if (SE.canReuseInstruction(S, EntInst, DropPoisonGeneratingInsts)) in FindValueInExprValueMap()
1432 for (Loop *L = SE.LI.getLoopFor(Builder.GetInsertBlock());; in expand()
1434 if (SE.isLoopInvariant(S, L)) { in expand()
1448 if (L && SE.hasComputableLoopEvolution(S, L) && !PostIncLoops.count(L)) in expand()
1481 if (auto Flags = SE.getStrengthenedNoWrapFlagsFromBinOp(OBO)) { in expand()
1549 if (Value *V = simplifyInstruction(PN, {DL, &SE.TLI, &SE.DT, &SE.AC})) in replaceCongruentIVs()
1551 if (!SE.isSCEVable(PN->getType())) in replaceCongruentIVs()
1553 auto *Const = dyn_cast<SCEVConstant>(SE.getSCEV(PN)); in replaceCongruentIVs()
1564 SE.forgetValue(Phi); in replaceCongruentIVs()
1574 if (!SE.isSCEVable(Phi->getType())) in replaceCongruentIVs()
1577 PHINode *&OrigPhiRef = ExprToIVMap[SE.getSCEV(Phi)]; in replaceCongruentIVs()
1585 const SCEV *PhiExpr = SE.getSCEV(Phi); in replaceCongruentIVs()
1590 SE.getTruncateExpr(PhiExpr, Phis.back()->getType()); in replaceCongruentIVs()
1630 SE.getTruncateOrNoop(SE.getSCEV(OrigInc), IsomorphicInc->getType()); in replaceCongruentIVs()
1632 TruncExpr == SE.getSCEV(IsomorphicInc) && in replaceCongruentIVs()
1633 SE.LI.replacementPreservesLCSSAForm(IsomorphicInc, OrigInc) && in replaceCongruentIVs()
1693 if (SE.getSCEV(LHS) == S && SE.DT.dominates(LHS, At)) in hasRelatedExistingExpansion()
1696 if (SE.getSCEV(RHS) == S && SE.DT.dominates(RHS, At)) in hasRelatedExistingExpansion()
1926 SE.getAddExpr(S, SE.getConstant(S->getType(), 1)), &At, L)) in isHighCostExpansionHelper()
1994 SE.getPredicatedBackedgeTakenCount(AR->getLoop(), Pred); in generateOverflowCheck()
1998 const SCEV *Step = AR->getStepRecurrence(SE); in generateOverflowCheck()
2002 unsigned SrcBits = SE.getTypeSizeInBits(ExitCount->getType()); in generateOverflowCheck()
2003 unsigned DstBits = SE.getTypeSizeInBits(ARTy); in generateOverflowCheck()
2014 IntegerType::get(Loc->getContext(), SE.getTypeSizeInBits(ARTy)); in generateOverflowCheck()
2017 Value *NegStepValue = expand(SE.getNegativeSCEV(Step), Loc); in generateOverflowCheck()
2038 if (!Signed && Start->isZero() && SE.isKnownPositive(Step)) in generateOverflowCheck()
2061 bool NeedPosCheck = !SE.isKnownNegative(Step); in generateOverflowCheck()
2062 bool NeedNegCheck = !SE.isKnownPositive(Step); in generateOverflowCheck()
2156 Loop *DefLoop = SE.LI.getLoopFor(DefI->getParent()); in fixupLCSSAFormFor()
2157 Loop *UseLoop = SE.LI.getLoopFor(InsertPt->getParent()); in fixupLCSSAFormFor()
2182 formLCSSAForInstructions(ToUpdate, SE.DT, SE.LI, &SE, &PHIsToRemove, in fixupLCSSAFormFor()
2217 ScalarEvolution &SE; member
2221 SCEVFindUnsafe(ScalarEvolution &SE, bool CanonicalMode) in SCEVFindUnsafe()
2222 : SE(SE), CanonicalMode(CanonicalMode) {} in SCEVFindUnsafe()
2226 if (!SE.isKnownNonZero(D->getRHS())) { in follow()
2247 SCEVFindUnsafe Search(SE, CanonicalMode); in isSafeToExpand()
2262 if (SE.properlyDominates(S, InsertionPoint->getParent())) in isSafeToExpandAt()
2264 if (SE.dominates(S, InsertionPoint->getParent())) { in isSafeToExpandAt()