Lines Matching refs:Rewriter
104 void simplifyAndExtend(Loop *L, SCEVExpander &Rewriter, LoopInfo *LI);
107 void rewriteLoopExitValues(Loop *L, SCEVExpander &Rewriter);
111 PHINode *IndVar, SCEVExpander &Rewriter);
115 Value *expandSCEVIfNeeded(SCEVExpander &Rewriter, const SCEV *S, Loop *L,
479 Value *IndVarSimplify::expandSCEVIfNeeded(SCEVExpander &Rewriter, const SCEV *S, in expandSCEVIfNeeded() argument
484 if (Value *ExistingValue = Rewriter.findExistingExpansion(S, InsertPt, L)) in expandSCEVIfNeeded()
489 return Rewriter.expandCodeFor(S, ResultTy, InsertPt); in expandSCEVIfNeeded()
507 void IndVarSimplify::rewriteLoopExitValues(Loop *L, SCEVExpander &Rewriter) { in rewriteLoopExitValues() argument
606 bool HighCost = Rewriter.isHighCostExpansion(ExitValue, L, Inst); in rewriteLoopExitValues()
608 expandSCEVIfNeeded(Rewriter, ExitValue, L, Inst, PN->getType()); in rewriteLoopExitValues()
658 Rewriter.clearInsertPoint(); in rewriteLoopExitValues()
910 PHINode *createWideIV(SCEVExpander &Rewriter);
928 Instruction *widenIVUse(NarrowIVDefUse DU, SCEVExpander &Rewriter);
1252 Instruction *WidenIV::widenIVUse(NarrowIVDefUse DU, SCEVExpander &Rewriter) { in widenIVUse() argument
1346 if (WideAddRec == WideIncExpr && Rewriter.hoistIVInc(WideInc, DU.NarrowUse)) in widenIVUse()
1396 PHINode *WidenIV::createWideIV(SCEVExpander &Rewriter) { in createWideIV() argument
1428 WidePhi = cast<PHINode>(Rewriter.expandCodeFor(AddRec, WideType, InsertPt)); in createWideIV()
1454 Instruction *WideUse = widenIVUse(DU, Rewriter); in createWideIV()
1505 SCEVExpander &Rewriter, in simplifyAndExtend() argument
1539 if (PHINode *WidePhi = Widener.createWideIV(Rewriter)) { in simplifyAndExtend()
1565 SCEVExpander &Rewriter) { in canExpandBackedgeTakenCount() argument
1578 if (Rewriter.isHighCostExpansion(BackedgeTakenCount, L)) in canExpandBackedgeTakenCount()
1827 SCEVExpander &Rewriter, ScalarEvolution *SE) { in genLoopLimit() argument
1850 Value *GEPOffset = Rewriter.expandCodeFor(IVOffset, OfsTy, BI); in genLoopLimit()
1901 return Rewriter.expandCodeFor(IVLimit, LimitTy, BI); in genLoopLimit()
1914 SCEVExpander &Rewriter) { in linearFunctionTestReplace() argument
1915 assert(canExpandBackedgeTakenCount(L, SE, Rewriter) && "precondition"); in linearFunctionTestReplace()
1936 Value *ExitCnt = genLoopLimit(IndVar, IVCount, L, Rewriter, SE); in linearFunctionTestReplace()
2121 SCEVExpander Rewriter(*SE, DL, "indvars"); in run() local
2123 Rewriter.setDebugType(DEBUG_TYPE); in run()
2132 Rewriter.disableCanonicalMode(); in run()
2133 simplifyAndExtend(L, Rewriter, LI); in run()
2143 rewriteLoopExitValues(L, Rewriter); in run()
2146 NumElimIV += Rewriter.replaceCongruentIVs(L, DT, DeadInsts); in run()
2150 if (canExpandBackedgeTakenCount(L, SE, Rewriter) && needsLFTR(L, DT)) { in run()
2164 Rewriter); in run()
2170 Rewriter.clear(); in run()