Home | History | Annotate | Download | only in Scalar

Lines Matching refs:Value

17 //      induction value against the exit value.  This turns loops like:
20 // is changed to compute the derived value outside of the loop, eliminating
21 // the dependence on the exit value of the induction variable. If the only
22 // purpose of the loop is to compute the exit value of some derived
79 cl::desc("Choose the strategy to replace exit value in IndVarSimplify"),
80 cl::values(clEnumValN(NeverRepl, "never", "never replace exit value"),
82 "only replace exit value when the cost is cheap"),
84 "always replace exit value whenever possible"),
127 bool isValidRewrite(Value *FromVal, Value *ToVal);
137 Value *linearFunctionTestReplace(Loop *L, const SCEV *BackedgeTakenCount,
142 Value *expandSCEVIfNeeded(SCEVExpander &Rewriter, const SCEV *S, Loop *L,
163 /// original value. SCEV guarantees that it produces the same value, but the way
166 bool IndVarSimplify::isValidRewrite(Value *FromVal, Value *ToVal) {
177 Value *FromPtr = FromVal;
178 Value *ToPtr = ToVal;
218 static Instruction *getInsertPointForUses(Instruction *User, Value *Def,
284 // Check incoming value.
292 // an add or increment value can not be represented by an integer.
306 Value::user_iterator IncrUse = Incr->user_begin();
334 // If it isn't a comparison with an integer-as-fp (the exit value), we can't
360 // We convert the floating point induction variable to a signed i32 value if
377 // exit value.
390 // If this is an equality comparison, we require that the strided value
391 // exactly land on the exit value, otherwise the IV condition will wrap
404 // exit value.
417 // If this is an equality comparison, we require that the strided value
418 // exactly land on the exit value, otherwise the IV condition will wrap
437 Value *NewAdd =
461 // in the loop uses its value. In order to canonicalize the induction
468 Value *Conv = new SIToFPInst(NewPHI, PN->getType(), "indvar.conv",
504 unsigned Ith; // Ith incoming value.
505 Value *Val; // Exit value after expansion.
509 RewritePhi(PHINode *P, unsigned I, Value *V, bool H, bool S)
514 Value *IndVarSimplify::expandSCEVIfNeeded(SCEVExpander &Rewriter, const SCEV *S,
518 // already existing value as the expansion for S.
519 if (Value *ExistingValue = Rewriter.findExistingExpansion(S, InsertPt, L))
533 /// If so, this means that we can compute the final value of any expressions
563 // We would like to be able to RAUW single-incoming value PHI nodes. We
565 // While the computed exit value is no longer varying in *this* loop, the
567 // the exit value may be varying in the outer loop, and thus it may still
571 // In either case the exit value could (at most) be varying in the same
590 // watching the PHI itself. Once the new exit value is in place, there
597 // If the value being merged in is not integer or is not defined
599 Value *InVal = PN->getIncomingValue(i);
613 // and varies predictably *inside* the loop. Evaluate the value it
620 // Computing the value outside of the loop brings no benefit if :
660 Value *ExitVal =
683 Value *ExitVal = Phi.Val;
686 // If LoopCanBeDel is true, rewrite exit value aggressively.
716 /// value. If it is possible, ignore ReplaceExitValue and do rewriting
729 // after exit value rewriting, we can enhance the logic here.
740 Value *Incoming = P->getIncomingValueForBlock(ExitingBlocks[0]);
742 // If the Incoming value of P is found in RewritePhiSet, we know it
743 // could be rewritten to use a loop invariant value in transformation
828 value as the Narrow IV def. This avoids caching Use*
893 Value *createExtendInst(Value *NarrowOper, Type *WideType, bool IsSigned,
919 static bool isLoopInvariant(Value *V, const Loop *L, const DominatorTree *DT) {
927 Value *WidenIV::createExtendInst(Value *NarrowOper, Type *WideType,
977 Value *LHS = (NarrowUse->getOperand(0) == NarrowDef)
981 Value *RHS = (NarrowUse->getOperand(1) == NarrowDef)
1068 Value *LHS = (NarrowUse->getOperand(0) == NarrowDef)
1072 Value *RHS = (NarrowUse->getOperand(1) == NarrowDef)
1100 /// operands. Generate the SCEV value for the widened operation without
1152 /// the loop with SCEV reducing the value to a recurrence on the same loop. If
1182 Value *Trunc = Builder.CreateTrunc(DU.WideDef, DU.NarrowDef->getType());
1212 Value *Op = Cmp->getOperand(Cmp->getOperand(0) == DU.NarrowDef ? 1 : 0);
1224 Value *ExtOp = createExtendInst(Op, WideType, Cmp->isSigned(), Cmp);
1248 Value *Trunc = Builder.CreateTrunc(WidePhi, DU.NarrowDef->getType());
1259 Value *NewDef = DU.WideDef;
1398 // The rewriter provides a value for the desired IV expression. This may
1537 /// of element types (given that the initial pointer value originates from or is
1561 /// Return the loop header phi IFF IncV adds a loop invariant value to the phi.
1562 static PHINode *getLoopPhiForCounter(Value *IncV, Loop *L, DominatorTree *DT) {
1626 Value *LHS = Cond->getOperand(0);
1627 Value *RHS = Cond->getOperand(1);
1647 Value *IncV = Phi->getIncomingValue(Idx);
1654 static bool hasConcreteDefImpl(Value *V, SmallPtrSetImpl<Value*> &Visited,
1673 for (Value *Op : I->operands()) {
1682 /// Return true if the given value is concrete. We must prove that undef can
1687 static bool hasConcreteDef(Value *V) {
1688 SmallPtrSet<Value*, 8> Visited;
1695 static bool AlmostDeadIV(PHINode *Phi, BasicBlock *LatchBlock, Value *Cond) {
1697 Value *IncV = Phi->getIncomingValue(LatchIdx);
1724 Value *Cond =
1759 Value *IncV = Phi->getIncomingValue(LatchIdx);
1763 // Avoid reusing a potentially undef value to compute other values that may
1801 /// Help linearFunctionTestReplace by generating a value that holds the RHS of
1803 static Value *genLoopLimit(PHINode *IndVar, const SCEV *IVCount, Loop *L,
1811 // GEP. Avoid running SCEVExpander on a new pointer value, instead reusing
1817 // signed value. IVCount on the other hand represents the loop trip count,
1818 // which is an unsigned value. FindLoopCounter only allows induction
1829 Value *GEPOffset = Rewriter.expandCodeFor(IVOffset, OfsTy, BI);
1831 Value *GEPBase = IndVar->getIncomingValueForBlock(L->getLoopPreheader());
1877 // SCEV expression (IVInit) for a pointer type IV value (IndVar).
1889 Value *IndVarSimplify::
1897 Value *CmpIndVar = IndVar;
1901 // compare against the post-incremented value, otherwise we must compare
1902 // against the preincremented value.
1915 Value *ExitCnt = genLoopLimit(IndVar, IVCount, L, Rewriter, SE);
1948 // Note that the post-inc value of BackedgeTakenCount may have overflowed
1969 Value *Cond = Builder.CreateICmp(P, CmpIndVar, ExitCnt, "exitcond");
1970 Value *OrigCond = BI->getCondition();
2126 // If so, this means that we can compute the final value of any expressions