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;
174 const SCEV *CT = SE->getOne(StrideSCEV->getType());
176 const SCEV *Expr = PSE.getSCEV(Ptr);
178 LLVM_DEBUG(dbgs() << "LAA: Replacing SCEV: " << *OrigSCEV
193 std::pair<const SCEV *, const SCEV *> llvm::getStartAndEndForAccess(
194 const Loop *Lp, const SCEV *PtrExpr, Type *AccessTy, const SCEV *MaxBECount,
196 DenseMap<std::pair<const SCEV *, Type *>,
197 std::pair<const SCEV *, const SCEV *>> *PointerBounds) {
198 std::pair<const SCEV *, const SCEV *> *PtrBoundsPair;
208 const SCEV *ScStart;
209 const SCEV *ScEnd;
216 const SCEV *Step = AR->getStepRecurrence(*SE);
239 const SCEV *EltSizeSCEV = SE->getStoreSizeOfExpr(IdxTy, AccessTy);
242 std::pair<const SCEV *, const SCEV *> Res = {ScStart, ScEnd};
250 void RuntimePointerChecking::insert(Loop *Lp, Value *Ptr, const SCEV *PtrExpr,
255 const SCEV *MaxBECount = PSE.getSymbolicMaxBackedgeTakenCount();
331 const SCEV *SinkStartInt = SE->getPtrToIntExpr(SinkAR->getStart(), IntTy);
332 const SCEV *SrcStartInt = SE->getPtrToIntExpr(SrcAR->getStart(), IntTy);
403 static const SCEV *getMinFromExprs(const SCEV *I, const SCEV *J,
419 bool RuntimeCheckingPtrGroup::addPointer(unsigned Index, const SCEV *Start,
420 const SCEV *End, unsigned AS,
429 const SCEV *Min0 = getMinFromExprs(Start, Low, &SE);
433 const SCEV *Min1 = getMinFromExprs(End, High, &SE);
679 const DenseMap<Value *, const SCEV *> &Strides,
690 Loop *TheLoop, const DenseMap<Value *, const SCEV *> &Strides,
784 /// The SCEV predicate containing all the SCEV-related assumptions.
800 const SCEV *PtrScev, Loop *L, bool Assume) {
818 const DenseMap<Value *, const SCEV *> &Strides, Value *Ptr,
820 const SCEV *PtrScev = PSE.getSCEV(Ptr);
839 // SCEV does not look through non-header PHIs inside the loop. Such phis
864 // like a constant, then we just add the SCEV for that term to the list passed
866 // SCEVAddRecExpr then we decompose it into parts and build the SCEV terms
870 SmallVectorImpl<PointerIntPair<const SCEV *, 1, bool>> &ScevList,
876 const SCEV *Scev = SE->getSCEV(Ptr);
885 auto UndefPoisonCheck = [](PointerIntPair<const SCEV *, 1, bool> S) {
889 auto GetBinOpExpr = [&SE](unsigned Opcode, const SCEV *L, const SCEV *R) {
912 SmallVector<PointerIntPair<const SCEV *, 1, bool>, 2> BaseScevs;
913 SmallVector<PointerIntPair<const SCEV *, 1, bool>, 2> OffsetScevs;
922 // Copy the SCEV across for the one without a fork in order to generate
923 // the full SCEV for both sides of the GEP.
940 const SCEV *Size = SE->getSizeOfExpr(IntPtrTy, SourceTy);
943 const SCEV *Scaled1 = SE->getMulExpr(
945 const SCEV *Scaled2 = SE->getMulExpr(
954 SmallVector<PointerIntPair<const SCEV *, 1, bool>, 2> ChildScevs;
957 // then we just bail out and return the generic SCEV.
968 SmallVector<PointerIntPair<const SCEV *, 1, bool>, 2> ChildScevs;
971 // then we just bail out and return the generic SCEV.
985 SmallVector<PointerIntPair<const SCEV *, 1, bool>> LScevs;
986 SmallVector<PointerIntPair<const SCEV *, 1, bool>> RScevs;
995 // Copy the SCEV across for the one without a fork in order to generate
996 // the full SCEV for both sides of the BinOp.
1015 // Just return the current SCEV if we haven't handled the instruction yet.
1022 static SmallVector<PointerIntPair<const SCEV *, 1, bool>>
1024 const DenseMap<Value *, const SCEV *> &StridesMap, Value *Ptr,
1028 SmallVector<PointerIntPair<const SCEV *, 1, bool>> Scevs;
1049 const DenseMap<Value *, const SCEV *> &StridesMap,
1056 SmallVector<PointerIntPair<const SCEV *, 1, bool>> TranslatedPtrs =
1060 const SCEV *PtrExpr = get<0>(P);
1106 const DenseMap<Value *, const SCEV *> &StridesMap,
1387 if (AR->getNoWrapFlags(SCEV::NoWrapMask))
1424 const SCEV *OpScev = PSE.getSCEV(OBO->getOperand(0));
1427 return OpAR->getLoop() == L && OpAR->getNoWrapFlags(SCEV::FlagNSW);
1437 const DenseMap<Value *, const SCEV *> &StridesMap,
1439 const SCEV *PtrScev = replaceSymbolicStrideSCEV(PSE, StridesMap, Ptr);
1457 << " SCEV: " << *PtrScev << "\n");
1464 << *Ptr << " SCEV: " << *AR << "\n");
1469 const SCEV *Step = AR->getStepRecurrence(*PSE.getSE());
1475 << " SCEV: " << *AR << "\n");
1525 << "LAA: SCEV: " << *AR << "\n"
1531 << *Ptr << " SCEV: " << *AR << "\n");
1581 // Otherwise compute the distance with SCEV between the base pointers.
1582 const SCEV *PtrSCEVA = SE.getSCEV(PtrA);
1583 const SCEV *PtrSCEVB = SE.getSCEV(PtrB);
1791 const SCEV &MaxBTC, const SCEV &Dist,
1813 const SCEV *Step = SE.getConstant(MaxBTC.getType(), ByteStride);
1814 const SCEV *Product = SE.getMulExpr(&MaxBTC, Step);
1816 const SCEV *CastedDist = &Dist;
1817 const SCEV *CastedProduct = Product;
1831 const SCEV *Minus = SE.getMinusSCEV(CastedDist, CastedProduct);
1837 const SCEV *NegDist = SE.getNegativeSCEV(CastedDist);
1905 const SCEV *Src = PSE.getSCEV(APtr);
1906 const SCEV *Sink = PSE.getSCEV(BPtr);
1918 const SCEV *Dist = SE.getMinusSCEV(Sink, Src);
1931 const SCEV *MaxBECount = PSE.getSymbolicMaxBackedgeTakenCount();
2380 const SCEV *ExitCount = PSE->getSymbolicMaxBackedgeTakenCount();
2384 LLVM_DEBUG(dbgs() << "LAA: SCEV could not compute the loop exit count.\n");
2804 // TODO: Is this really what we want? Even without FP SCEV, we may want some
2808 const SCEV *S = SE->getSCEV(V);
2860 static const SCEV *getStrideFromPointer(Value *Ptr, ScalarEvolution *SE, Loop *Lp) {
2874 const SCEV *V = SE->getSCEV(Ptr);
2941 const SCEV *StrideExpr = getStrideFromPointer(Ptr, PSE->getSE(), TheLoop);
2967 const SCEV *MaxBTC = PSE->getSymbolicMaxBackedgeTakenCount();
2975 const SCEV *CastedStride = StrideExpr;
2976 const SCEV *CastedBECount = MaxBTC;
2982 const SCEV *StrideMinusBETaken = SE->getMinusSCEV(CastedStride, CastedBECount);
2997 const SCEV *StrideBase = StrideExpr;
3070 OS.indent(Depth) << "SCEV assumptions:\n";
3092 // moment, that is loops requiring memory or SCEV runtime checks, as those cache