Lines Matching defs:SCEV
154 const SCEV *llvm::replaceSymbolicStrideSCEV(PredicatedScalarEvolution &PSE,
155 const DenseMap<Value *, const SCEV *> &PtrToStride,
157 const SCEV *OrigSCEV = PSE.getSCEV(Ptr);
159 // If there is an entry in the map return the SCEV of the pointer with the
161 DenseMap<Value *, const SCEV *>::const_iterator SI = PtrToStride.find(Ptr);
166 const SCEV *StrideSCEV = SI->second;
178 LLVM_DEBUG(dbgs() << "LAA: Replacing SCEV: " << *OrigSCEV
206 static std::pair<const SCEV *, const SCEV *> getStartAndEndForAccess(
207 const Loop *Lp, const SCEV *PtrExpr, Type *AccessTy,
209 DenseMap<std::pair<const SCEV *, Type *>,
210 std::pair<const SCEV *, const SCEV *>> &PointerBounds) {
219 const SCEV *ScStart;
220 const SCEV *ScEnd;
225 const SCEV *Ex = PSE.getSymbolicMaxBackedgeTakenCount();
229 const SCEV *Step = AR->getStepRecurrence(*SE);
252 const SCEV *EltSizeSCEV = SE->getStoreSizeOfExpr(IdxTy, AccessTy);
261 void RuntimePointerChecking::insert(Loop *Lp, Value *Ptr, const SCEV *PtrExpr,
341 const SCEV *SinkStartInt = SE->getPtrToIntExpr(SinkAR->getStart(), IntTy);
342 const SCEV *SrcStartInt = SE->getPtrToIntExpr(SrcAR->getStart(), IntTy);
413 static const SCEV *getMinFromExprs(const SCEV *I, const SCEV *J,
415 const SCEV *Diff = SE->getMinusSCEV(J, I);
431 bool RuntimeCheckingPtrGroup::addPointer(unsigned Index, const SCEV *Start,
432 const SCEV *End, unsigned AS,
441 const SCEV *Min0 = getMinFromExprs(Start, Low, &SE);
445 const SCEV *Min1 = getMinFromExprs(End, High, &SE);
696 const DenseMap<Value *, const SCEV *> &Strides,
707 Loop *TheLoop, const DenseMap<Value *, const SCEV *> &Strides,
800 /// The SCEV predicate containing all the SCEV-related assumptions.
816 const SCEV *PtrScev, Loop *L, bool Assume) {
834 const DenseMap<Value *, const SCEV *> &Strides, Value *Ptr, Type *AccessTy,
836 const SCEV *PtrScev = PSE.getSCEV(Ptr);
858 // SCEV does not look through non-header PHIs inside the loop. Such phis
883 // like a constant, then we just add the SCEV for that term to the list passed
885 // SCEVAddRecExpr then we decompose it into parts and build the SCEV terms
889 SmallVectorImpl<PointerIntPair<const SCEV *, 1, bool>> &ScevList,
895 const SCEV *Scev = SE->getSCEV(Ptr);
904 auto UndefPoisonCheck = [](PointerIntPair<const SCEV *, 1, bool> S) {
908 auto GetBinOpExpr = [&SE](unsigned Opcode, const SCEV *L, const SCEV *R) {
931 SmallVector<PointerIntPair<const SCEV *, 1, bool>, 2> BaseScevs;
932 SmallVector<PointerIntPair<const SCEV *, 1, bool>, 2> OffsetScevs;
941 // Copy the SCEV across for the one without a fork in order to generate
942 // the full SCEV for both sides of the GEP.
959 const SCEV *Size = SE->getSizeOfExpr(IntPtrTy, SourceTy);
962 const SCEV *Scaled1 = SE->getMulExpr(
964 const SCEV *Scaled2 = SE->getMulExpr(
973 SmallVector<PointerIntPair<const SCEV *, 1, bool>, 2> ChildScevs;
976 // then we just bail out and return the generic SCEV.
987 SmallVector<PointerIntPair<const SCEV *, 1, bool>, 2> ChildScevs;
990 // then we just bail out and return the generic SCEV.
1004 SmallVector<PointerIntPair<const SCEV *, 1, bool>> LScevs;
1005 SmallVector<PointerIntPair<const SCEV *, 1, bool>> RScevs;
1014 // Copy the SCEV across for the one without a fork in order to generate
1015 // the full SCEV for both sides of the BinOp.
1034 // Just return the current SCEV if we haven't handled the instruction yet.
1041 static SmallVector<PointerIntPair<const SCEV *, 1, bool>>
1043 const DenseMap<Value *, const SCEV *> &StridesMap, Value *Ptr,
1047 SmallVector<PointerIntPair<const SCEV *, 1, bool>> Scevs;
1068 const DenseMap<Value *, const SCEV *> &StridesMap,
1075 SmallVector<PointerIntPair<const SCEV *, 1, bool>> TranslatedPtrs =
1079 const SCEV *PtrExpr = get<0>(P);
1129 const DenseMap<Value *, const SCEV *> &StridesMap,
1410 if (AR->getNoWrapFlags(SCEV::NoWrapMask))
1450 return OpAR->getLoop() == L && OpAR->getNoWrapFlags(SCEV::FlagNSW);
1460 const DenseMap<Value *, const SCEV *> &StridesMap,
1462 const SCEV *PtrScev = replaceSymbolicStrideSCEV(PSE, StridesMap, Ptr);
1480 << " SCEV: " << *PtrScev << "\n");
1487 << *Ptr << " SCEV: " << *AR << "\n");
1492 const SCEV *Step = AR->getStepRecurrence(*PSE.getSE());
1498 << " SCEV: " << *AR << "\n");
1547 << "LAA: SCEV: " << *AR << "\n"
1553 << *Ptr << " SCEV: " << *AR << "\n");
1601 // Otherwise compute the distance with SCEV between the base pointers.
1602 const SCEV *PtrSCEVA = SE.getSCEV(PtrA);
1603 const SCEV *PtrSCEVB = SE.getSCEV(PtrB);
1811 const SCEV &MaxBTC, const SCEV &Dist,
1833 const SCEV *Step = SE.getConstant(MaxBTC.getType(), ByteStride);
1834 const SCEV *Product = SE.getMulExpr(&MaxBTC, Step);
1836 const SCEV *CastedDist = &Dist;
1837 const SCEV *CastedProduct = Product;
1851 const SCEV *Minus = SE.getMinusSCEV(CastedDist, CastedProduct);
1857 const SCEV *NegDist = SE.getNegativeSCEV(CastedDist);
1925 const SCEV *Src = PSE.getSCEV(APtr);
1926 const SCEV *Sink = PSE.getSCEV(BPtr);
1937 const SCEV *Dist = SE.getMinusSCEV(Sink, Src);
2378 const SCEV *ExitCount = PSE->getSymbolicMaxBackedgeTakenCount();
2382 LLVM_DEBUG(dbgs() << "LAA: SCEV could not compute the loop exit count.\n");
2795 // TODO: Is this really what we want? Even without FP SCEV, we may want some
2799 const SCEV *S = SE->getSCEV(V);
2851 static const SCEV *getStrideFromPointer(Value *Ptr, ScalarEvolution *SE, Loop *Lp) {
2865 const SCEV *V = SE->getSCEV(Ptr);
2932 const SCEV *StrideExpr = getStrideFromPointer(Ptr, PSE->getSE(), TheLoop);
2958 const SCEV *MaxBTC = PSE->getSymbolicMaxBackedgeTakenCount();
2966 const SCEV *CastedStride = StrideExpr;
2967 const SCEV *CastedBECount = MaxBTC;
2973 const SCEV *StrideMinusBETaken = SE->getMinusSCEV(CastedStride, CastedBECount);
2988 const SCEV *StrideBase = StrideExpr;
3061 OS.indent(Depth) << "SCEV assumptions:\n";
3083 // moment, that is loops requiring memory or SCEV runtime checks, as those cache