Home | History | Annotate | Download | only in Analysis

Lines Matching refs:SCEV

29 // analysis is using SCEV->delinearize to recover the representation of multiple
35 // Subtract, or Multiply, with both APInt's and SCEV's.
41 // Finally, it seems like certain test cases expose weaknesses in the SCEV
250 const SCEV *FullDependence::getDistance(unsigned Level) const {
293 const SCEV *DependenceAnalysis::Constraint::getX() const {
301 const SCEV *DependenceAnalysis::Constraint::getY() const {
309 const SCEV *DependenceAnalysis::Constraint::getA() const {
318 const SCEV *DependenceAnalysis::Constraint::getB() const {
327 const SCEV *DependenceAnalysis::Constraint::getC() const {
336 const SCEV *DependenceAnalysis::Constraint::getD() const {
350 void DependenceAnalysis::Constraint::setPoint(const SCEV *X,
351 const SCEV *Y,
360 void DependenceAnalysis::Constraint::setLine(const SCEV *AA,
361 const SCEV *BB,
362 const SCEV *CC,
372 void DependenceAnalysis::Constraint::setDistance(const SCEV *D,
468 const SCEV *Prod1 = SE->getMulExpr(X->getA(), Y->getB());
469 const SCEV *Prod2 = SE->getMulExpr(X->getB(), Y->getA());
487 const SCEV *C1B2 = SE->getMulExpr(X->getC(), Y->getB());
488 const SCEV *C1A2 = SE->getMulExpr(X->getC(), Y->getA());
489 const SCEV *C2B1 = SE->getMulExpr(Y->getC(), X->getB());
490 const SCEV *C2A1 = SE->getMulExpr(Y->getC(), X->getA());
491 const SCEV *A1B2 = SE->getMulExpr(X->getA(), Y->getB());
492 const SCEV *A2B1 = SE->getMulExpr(Y->getA(), X->getB());
553 const SCEV *A1X1 = SE->getMulExpr(Y->getA(), X->getX());
554 const SCEV *B1Y1 = SE->getMulExpr(Y->getB(), X->getY());
555 const SCEV *Sum = SE->getAddExpr(A1X1, B1Y1);
597 const SCEV *Distance = getDistance(II);
762 bool DependenceAnalysis::isLoopInvariant(const SCEV *Expression,
773 // have a level <= CommonLevels and are referred to by the SCEV Expression.
774 void DependenceAnalysis::collectCommonLoops(const SCEV *Expression,
791 const SCEV *Src = Pair->Src;
792 const SCEV *Dst = Pair->Dst;
805 // Examine the scev and return true iff it's linear.
807 bool DependenceAnalysis::checkSrcSubscript(const SCEV *Src,
813 const SCEV *Start = AddRec->getStart();
814 const SCEV *Step = AddRec->getStepRecurrence(*SE);
823 // Examine the scev and return true iff it's linear.
825 bool DependenceAnalysis::checkDstSubscript(const SCEV *Dst,
831 const SCEV *Start = AddRec->getStart();
832 const SCEV *Step = AddRec->getStepRecurrence(*SE);
844 DependenceAnalysis::classifyPair(const SCEV *Src, const Loop *SrcLoopNest,
845 const SCEV *Dst, const Loop *DstLoopNest,
868 // A wrapper around SCEV::isKnownPredicate.
872 // SCEV::isKnownPredicate. Perhaps, someday, the ScalarEvolution package
875 // If SCEV::isKnownPredicate can't prove the predicate,
879 const SCEV *X,
880 const SCEV *Y) const {
889 const SCEV *Xop = CX->getOperand();
890 const SCEV *Yop = CY->getOperand();
904 const SCEV *Delta = SE->getMinusSCEV(X, Y);
929 const SCEV *DependenceAnalysis::collectUpperBound(const Loop *L,
932 const SCEV *UB = SE->getBackedgeTakenCount(L);
944 if (const SCEV *UB = collectUpperBound(L, T))
960 bool DependenceAnalysis::testZIV(const SCEV *Src,
961 const SCEV *Dst,
1008 bool DependenceAnalysis::strongSIVtest(const SCEV *Coeff,
1009 const SCEV *SrcConst,
1010 const SCEV *DstConst,
1026 const SCEV *Delta = SE->getMinusSCEV(SrcConst, DstConst);
1031 if (const SCEV *UpperBound = collectUpperBound(CurLoop, Delta->getType())) {
1034 const SCEV *AbsDelta =
1036 const SCEV *AbsCoeff =
1038 const SCEV *Product = SE->getMulExpr(UpperBound, AbsCoeff);
1147 bool DependenceAnalysis::weakCrossingSIVtest(const SCEV *Coeff,
1148 const SCEV *SrcConst,
1149 const SCEV *DstConst,
1154 const SCEV *&SplitIter) const {
1163 const SCEV *Delta = SE->getMinusSCEV(DstConst, SrcConst);
1215 if (const SCEV *UpperBound = collectUpperBound(CurLoop, Delta->getType())) {
1217 const SCEV *ConstantTwo = SE->getConstant(UpperBound->getType(), 2);
1218 const SCEV *ML = SE->getMulExpr(SE->getMulExpr(ConstCoeff, UpperBound),
1369 bool DependenceAnalysis::exactSIVtest(const SCEV *SrcCoeff,
1370 const SCEV *DstCoeff,
1371 const SCEV *SrcConst,
1372 const SCEV *DstConst,
1386 SCEV *Delta = SE->getMinusSCEV(DstConst, SrcConst);
1410 // since SCEV construction normalizes, LM = 0
1581 bool DependenceAnalysis::weakZeroSrcSIVtest(const SCEV *DstCoeff,
1582 const SCEV *SrcConst,
1583 const SCEV *DstConst,
1599 const SCEV *Delta = SE->getMinusSCEV(SrcConst, DstConst);
1614 const SCEV *AbsCoeff =
1617 const SCEV *NewDelta =
1622 if (const SCEV *UpperBound = collectUpperBound(CurLoop, Delta->getType())) {
1624 const SCEV *Product = SE->getMulExpr(AbsCoeff, UpperBound);
1692 bool DependenceAnalysis::weakZeroDstSIVtest(const SCEV *SrcCoeff,
1693 const SCEV *SrcConst,
1694 const SCEV *DstConst,
1709 const SCEV *Delta = SE->getMinusSCEV(DstConst, SrcConst);
1724 const SCEV *AbsCoeff =
1727 const SCEV *NewDelta =
1732 if (const SCEV *UpperBound = collectUpperBound(CurLoop, Delta->getType())) {
1734 const SCEV *Product = SE->getMulExpr(AbsCoeff, UpperBound);
1778 bool DependenceAnalysis::exactRDIVtest(const SCEV *SrcCoeff,
1779 const SCEV *DstCoeff,
1780 const SCEV *SrcConst,
1781 const SCEV *DstConst,
1792 const SCEV *Delta = SE->getMinusSCEV(DstConst, SrcConst);
1813 // since SCEV construction seems to normalize, LM = 0
1922 bool DependenceAnalysis::symbolicRDIVtest(const SCEV *A1,
1923 const SCEV *A2,
1924 const SCEV *C1,
1925 const SCEV *C2,
1935 const SCEV *N1 = collectUpperBound(Loop1, A1->getType());
1936 const SCEV *N2 = collectUpperBound(Loop2, A1->getType());
1939 const SCEV *C2_C1 = SE->getMinusSCEV(C2, C1);
1940 const SCEV *C1_C2 = SE->getMinusSCEV(C1, C2);
1948 const SCEV *A1N1 = SE->getMulExpr(A1, N1);
1957 const SCEV *A2N2 = SE->getMulExpr(A2, N2);
1969 const SCEV *A1N1 = SE->getMulExpr(A1, N1);
1970 const SCEV *A2N2 = SE->getMulExpr(A2, N2);
1971 const SCEV *A1N1_A2N2 = SE->getMinusSCEV(A1N1, A2N2);
1990 const SCEV *A1N1 = SE->getMulExpr(A1, N1);
1991 const SCEV *A2N2 = SE->getMulExpr(A2, N2);
1992 const SCEV *A1N1_A2N2 = SE->getMinusSCEV(A1N1, A2N2);
2009 const SCEV *A1N1 = SE->getMulExpr(A1, N1);
2018 const SCEV *A2N2 = SE->getMulExpr(A2, N2);
2039 bool DependenceAnalysis::testSIV(const SCEV *Src,
2040 const SCEV *Dst,
2044 const SCEV *&SplitIter) const {
2050 const SCEV *SrcConst = SrcAddRec->getStart();
2051 const SCEV *DstConst = DstAddRec->getStart();
2052 const SCEV *SrcCoeff = SrcAddRec->getStepRecurrence(*SE);
2053 const SCEV *DstCoeff = DstAddRec->getStepRecurrence(*SE);
2073 const SCEV *SrcConst = SrcAddRec->getStart();
2074 const SCEV *SrcCoeff = SrcAddRec->getStepRecurrence(*SE);
2075 const SCEV *DstConst = Dst;
2083 const SCEV *DstConst = DstAddRec->getStart();
2084 const SCEV *DstCoeff = DstAddRec->getStepRecurrence(*SE);
2085 const SCEV *SrcConst = Src;
2110 bool DependenceAnalysis::testRDIV(const SCEV *Src,
2111 const SCEV *Dst,
2119 const SCEV *SrcConst, *DstConst;
2120 const SCEV *SrcCoeff, *DstCoeff;
2177 bool DependenceAnalysis::testMIV(const SCEV *Src,
2178 const SCEV *Dst,
2219 bool DependenceAnalysis::gcdMIVtest(const SCEV *Src,
2220 const SCEV *Dst,
2231 const SCEV *Coefficients = Src;
2234 const SCEV *Coeff = AddRec->getStepRecurrence(*SE);
2246 const SCEV *SrcConst = Coefficients;
2255 const SCEV *Coeff = AddRec->getStepRecurrence(*SE);
2267 const SCEV *DstConst = Coefficients;
2270 const SCEV *Delta = SE->getMinusSCEV(DstConst, SrcConst);
2276 const SCEV *Operand = Sum->getOperand(Op);
2330 const SCEV *SrcCoeff = AddRec->getStepRecurrence(*SE);
2331 const SCEV *DstCoeff = SE->getMinusSCEV(SrcCoeff, SrcCoeff);
2332 const SCEV *Inner = Src;
2335 const SCEV *Coeff = AddRec->getStepRecurrence(*SE);
2353 const SCEV *Coeff = AddRec->getStepRecurrence(*SE);
2419 // by the SCEV package, N_k = 1 and L_k = 0, allowing us to simplify the
2433 bool DependenceAnalysis::banerjeeMIVtest(const SCEV *Src,
2434 const SCEV *Dst,
2440 const SCEV *A0;
2443 const SCEV *B0;
2446 const SCEV *Delta = SE->getMinusSCEV(B0, A0);
2520 const SCEV *Delta) const {
2618 const SCEV *Delta) const {
2620 if (const SCEV *LowerBound = getLowerBound(Bound))
2623 if (const SCEV *UpperBound = getUpperBound(Bound))
2693 const SCEV *Delta = SE->getMinusSCEV(A[K].Coeff, B[K].Coeff);
2694 const SCEV *NegativePart = getNegativePart(Delta);
2697 const SCEV *PositivePart = getPositivePart(Delta);
2704 const SCEV *Delta = SE->getMinusSCEV(A[K].Coeff, B[K].Coeff);
2705 const SCEV *NegativePart = getNegativePart(Delta);
2708 const SCEV *PositivePart = getPositivePart(Delta);
2735 const SCEV *Iter_1 =
2738 const SCEV *NegPart =
2742 const SCEV *PosPart =
2750 const SCEV *NegPart =
2754 const SCEV *PosPart =
2782 const SCEV *Iter_1 =
2785 const SCEV *NegPart =
2789 const SCEV *PosPart =
2797 const SCEV *NegPart = getNegativePart(SE->getMinusSCEV(A[K].Coeff, B[K].PosPart));
2800 const SCEV *PosPart = getPositivePart(SE->getMinusSCEV(A[K].Coeff, B[K].NegPart));
2808 const SCEV *DependenceAnalysis::getPositivePart(const SCEV *X) const {
2814 const SCEV *DependenceAnalysis::getNegativePart(const SCEV *X) const {
2823 DependenceAnalysis::collectCoeffInfo(const SCEV *Subscript,
2825 const SCEV *&Constant) const {
2826 const SCEV *Zero = SE->getConstant(Subscript->getType(), 0);
2869 const SCEV *DependenceAnalysis::getLowerBound(BoundInfo *Bound) const {
2870 const SCEV *Sum = Bound[1].Lower[Bound[1].Direction];
2885 const SCEV *DependenceAnalysis::getUpperBound(BoundInfo *Bound) const {
2886 const SCEV *Sum = Bound[1].Upper[Bound[1].Direction];
2900 // Given a linear SCEV,
2906 const SCEV *DependenceAnalysis::findCoefficient(const SCEV *Expr,
2917 // Given a linear SCEV,
2918 // return the SCEV given by zeroing out the coefficient
2922 const SCEV *DependenceAnalysis::zeroCoefficient(const SCEV *Expr,
2936 // Given a linear SCEV Expr,
2937 // return the SCEV given by adding some Value to the
2941 const SCEV *DependenceAnalysis::addToCoefficient(const SCEV *Expr,
2943 const SCEV *Value) const {
2949 SCEV::FlagAnyWrap); // Worst case, with no info.
2951 const SCEV *Sum = SE->getAddExpr(AddRec->getStepRecurrence(*SE), Value);
2963 SCEV::FlagAnyWrap);
2982 bool DependenceAnalysis::propagate(const SCEV *&Src,
2983 const SCEV *&Dst,
3007 bool DependenceAnalysis::propagateDistance(const SCEV *&Src,
3008 const SCEV *&Dst,
3013 const SCEV *A_K = findCoefficient(Src, CurLoop);
3016 const SCEV *DA_K = SE->getMulExpr(A_K, CurConstraint.getD());
3034 bool DependenceAnalysis::propagateLine(const SCEV *&Src,
3035 const SCEV *&Dst,
3039 const SCEV *A = CurConstraint.getA();
3040 const SCEV *B = CurConstraint.getB();
3041 const SCEV *C = CurConstraint.getC();
3053 const SCEV *AP_K = findCoefficient(Dst, CurLoop);
3068 const SCEV *A_K = findCoefficient(Src, CurLoop);
3082 const SCEV *A_K = findCoefficient(Src, CurLoop);
3091 const SCEV *A_K = findCoefficient(Src, CurLoop);
3109 bool DependenceAnalysis::propagatePoint(const SCEV *&Src,
3110 const SCEV *&Dst,
3113 const SCEV *A_K = findCoefficient(Src, CurLoop);
3114 const SCEV *AP_K = findCoefficient(Dst, CurLoop);
3115 const SCEV *XA_K = SE->getMulExpr(A_K, CurConstraint.getX());
3116 const SCEV *YAP_K = SE->getMulExpr(AP_K, CurConstraint.getY());
3183 bool DependenceAnalysis::tryDelinearize(const SCEV *SrcSCEV,
3184 const SCEV *DstSCEV,
3186 const SCEV *ElementSize) const {
3204 SmallVector<const SCEV *, 4> Terms;
3209 SmallVector<const SCEV *, 4> Sizes;
3213 SmallVector<const SCEV *, 4> SrcSubscripts, DstSubscripts;
3328 const SCEV *SrcPtrSCEV = SE->getSCEV(SrcGEP->getPointerOperand());
3329 const SCEV *DstPtrSCEV = SE->getSCEV(DstGEP->getPointerOperand());
3353 const SCEV *SrcSCEV = SE->getSCEV(SrcPtr);
3354 const SCEV *DstSCEV = SE->getSCEV(DstPtr);
3509 const SCEV *SplitIter = nullptr;
3557 const SCEV *SplitIter = nullptr;
3732 const SCEV *DependenceAnalysis::getSplitIteration(const Dependence *Dep,
3759 const SCEV *SrcPtrSCEV = SE->getSCEV(SrcGEP->getPointerOperand());
3760 const SCEV *DstPtrSCEV = SE->getSCEV(DstGEP->getPointerOperand());
3779 const SCEV *SrcSCEV = SE->getSCEV(SrcPtr);
3780 const SCEV *DstSCEV = SE->getSCEV(DstPtr);
3852 const SCEV *SplitIter = nullptr;
3891 const SCEV *SplitIter = nullptr;