diff --git a/llvm/include/llvm/Analysis/DependenceAnalysis.h b/llvm/include/llvm/Analysis/DependenceAnalysis.h index 85c9af4fffcde..2e845104464a5 100644 --- a/llvm/include/llvm/Analysis/DependenceAnalysis.h +++ b/llvm/include/llvm/Analysis/DependenceAnalysis.h @@ -365,48 +365,6 @@ class DependenceInfo { depends(Instruction *Src, Instruction *Dst, bool UnderRuntimeAssumptions = false); - /// getSplitIteration - Give a dependence that's splittable at some - /// particular level, return the iteration that should be used to split - /// the loop. - /// - /// Generally, the dependence analyzer will be used to build - /// a dependence graph for a function (basically a map from instructions - /// to dependences). Looking for cycles in the graph shows us loops - /// that cannot be trivially vectorized/parallelized. - /// - /// We can try to improve the situation by examining all the dependences - /// that make up the cycle, looking for ones we can break. - /// Sometimes, peeling the first or last iteration of a loop will break - /// dependences, and there are flags for those possibilities. - /// Sometimes, splitting a loop at some other iteration will do the trick, - /// and we've got a flag for that case. Rather than waste the space to - /// record the exact iteration (since we rarely know), we provide - /// a method that calculates the iteration. It's a drag that it must work - /// from scratch, but wonderful in that it's possible. - /// - /// Here's an example: - /// - /// for (i = 0; i < 10; i++) - /// A[i] = ... - /// ... = A[11 - i] - /// - /// There's a loop-carried flow dependence from the store to the load, - /// found by the weak-crossing SIV test. The dependence will have a flag, - /// indicating that the dependence can be broken by splitting the loop. - /// Calling getSplitIteration will return 5. - /// Splitting the loop breaks the dependence, like so: - /// - /// for (i = 0; i <= 5; i++) - /// A[i] = ... - /// ... = A[11 - i] - /// for (i = 6; i < 10; i++) - /// A[i] = ... - /// ... = A[11 - i] - /// - /// breaks the dependence and allows us to vectorize/parallelize - /// both loops. - LLVM_ABI const SCEV *getSplitIteration(const Dependence &Dep, unsigned Level); - Function *getFunction() const { return F; } /// getRuntimeAssumptions - Returns all the runtime assumptions under which @@ -447,106 +405,6 @@ class DependenceInfo { unsigned char DirSet; }; - /// Constraint - This private class represents a constraint, as defined - /// in the paper - /// - /// Practical Dependence Testing - /// Goff, Kennedy, Tseng - /// PLDI 1991 - /// - /// There are 5 kinds of constraint, in a hierarchy. - /// 1) Any - indicates no constraint, any dependence is possible. - /// 2) Line - A line ax + by = c, where a, b, and c are parameters, - /// representing the dependence equation. - /// 3) Distance - The value d of the dependence distance; - /// 4) Point - A point representing the dependence from - /// iteration x to iteration y. - /// 5) Empty - No dependence is possible. - class Constraint { - private: - enum ConstraintKind { Empty, Point, Distance, Line, Any } Kind; - ScalarEvolution *SE; - const SCEV *A; - const SCEV *B; - const SCEV *C; - const Loop *AssociatedSrcLoop; - const Loop *AssociatedDstLoop; - - public: - /// isEmpty - Return true if the constraint is of kind Empty. - bool isEmpty() const { return Kind == Empty; } - - /// isPoint - Return true if the constraint is of kind Point. - bool isPoint() const { return Kind == Point; } - - /// isDistance - Return true if the constraint is of kind Distance. - bool isDistance() const { return Kind == Distance; } - - /// isLine - Return true if the constraint is of kind Line. - /// Since Distance's can also be represented as Lines, we also return - /// true if the constraint is of kind Distance. - bool isLine() const { return Kind == Line || Kind == Distance; } - - /// isAny - Return true if the constraint is of kind Any; - bool isAny() const { return Kind == Any; } - - /// getX - If constraint is a point , returns X. - /// Otherwise assert. - LLVM_ABI const SCEV *getX() const; - - /// getY - If constraint is a point , returns Y. - /// Otherwise assert. - LLVM_ABI const SCEV *getY() const; - - /// getA - If constraint is a line AX + BY = C, returns A. - /// Otherwise assert. - LLVM_ABI const SCEV *getA() const; - - /// getB - If constraint is a line AX + BY = C, returns B. - /// Otherwise assert. - LLVM_ABI const SCEV *getB() const; - - /// getC - If constraint is a line AX + BY = C, returns C. - /// Otherwise assert. - LLVM_ABI const SCEV *getC() const; - - /// getD - If constraint is a distance, returns D. - /// Otherwise assert. - LLVM_ABI const SCEV *getD() const; - - /// getAssociatedSrcLoop - Returns the source loop associated with this - /// constraint. - LLVM_ABI const Loop *getAssociatedSrcLoop() const; - - /// getAssociatedDstLoop - Returns the destination loop associated with - /// this constraint. - LLVM_ABI const Loop *getAssociatedDstLoop() const; - - /// setPoint - Change a constraint to Point. - LLVM_ABI void setPoint(const SCEV *X, const SCEV *Y, - const Loop *CurrentSrcLoop, - const Loop *CurrentDstLoop); - - /// setLine - Change a constraint to Line. - LLVM_ABI void setLine(const SCEV *A, const SCEV *B, const SCEV *C, - const Loop *CurrentSrcLoop, - const Loop *CurrentDstLoop); - - /// setDistance - Change a constraint to Distance. - LLVM_ABI void setDistance(const SCEV *D, const Loop *CurrentSrcLoop, - const Loop *CurrentDstLoop); - - /// setEmpty - Change a constraint to Empty. - LLVM_ABI void setEmpty(); - - /// setAny - Change a constraint to Any. - LLVM_ABI void setAny(ScalarEvolution *SE); - - /// dump - For debugging purposes. Dumps the constraint - /// out to OS. - LLVM_ABI void dump(raw_ostream &OS) const; - }; - /// Returns true if two loops have the Same iteration Space and Depth. To be /// more specific, two loops have SameSD if they are in the same nesting /// depth and have the same backedge count. SameSD stands for Same iteration @@ -713,8 +571,7 @@ class DependenceInfo { /// If the dependence isn't proven to exist, /// marks the Result as inconsistent. bool testSIV(const SCEV *Src, const SCEV *Dst, unsigned &Level, - FullDependence &Result, Constraint &NewConstraint, - const SCEV *&SplitIter) const; + FullDependence &Result) const; /// testRDIV - Tests the RDIV subscript pair (Src and Dst) for dependence. /// Things of the form [c1 + a1*i] and [c2 + a2*j] @@ -744,7 +601,7 @@ class DependenceInfo { bool strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst, const SCEV *DstConst, const Loop *CurrentSrcLoop, const Loop *CurrentDstLoop, unsigned Level, - FullDependence &Result, Constraint &NewConstraint) const; + FullDependence &Result) const; /// weakCrossingSIVtest - Tests the weak-crossing SIV subscript pair /// (Src and Dst) for dependence. @@ -759,8 +616,7 @@ class DependenceInfo { bool weakCrossingSIVtest(const SCEV *SrcCoeff, const SCEV *SrcConst, const SCEV *DstConst, const Loop *CurrentSrcLoop, const Loop *CurrentDstLoop, unsigned Level, - FullDependence &Result, Constraint &NewConstraint, - const SCEV *&SplitIter) const; + FullDependence &Result) const; /// ExactSIVtest - Tests the SIV subscript pair /// (Src and Dst) for dependence. @@ -774,8 +630,7 @@ class DependenceInfo { bool exactSIVtest(const SCEV *SrcCoeff, const SCEV *DstCoeff, const SCEV *SrcConst, const SCEV *DstConst, const Loop *CurrentSrcLoop, const Loop *CurrentDstLoop, - unsigned Level, FullDependence &Result, - Constraint &NewConstraint) const; + unsigned Level, FullDependence &Result) const; /// weakZeroSrcSIVtest - Tests the weak-zero SIV subscript pair /// (Src and Dst) for dependence. @@ -790,8 +645,7 @@ class DependenceInfo { bool weakZeroSrcSIVtest(const SCEV *DstCoeff, const SCEV *SrcConst, const SCEV *DstConst, const Loop *CurrentSrcLoop, const Loop *CurrentDstLoop, unsigned Level, - FullDependence &Result, - Constraint &NewConstraint) const; + FullDependence &Result) const; /// weakZeroDstSIVtest - Tests the weak-zero SIV subscript pair /// (Src and Dst) for dependence. @@ -806,8 +660,7 @@ class DependenceInfo { bool weakZeroDstSIVtest(const SCEV *SrcCoeff, const SCEV *SrcConst, const SCEV *DstConst, const Loop *CurrentSrcLoop, const Loop *CurrentDstLoop, unsigned Level, - FullDependence &Result, - Constraint &NewConstraint) const; + FullDependence &Result) const; /// exactRDIVtest - Tests the RDIV subscript pair for dependence. /// Things of the form [c1 + a*i] and [c2 + b*j], @@ -927,37 +780,6 @@ class DependenceInfo { void findBoundsEQ(CoefficientInfo *A, CoefficientInfo *B, BoundInfo *Bound, unsigned K) const; - /// intersectConstraints - Updates X with the intersection - /// of the Constraints X and Y. Returns true if X has changed. - bool intersectConstraints(Constraint *X, const Constraint *Y); - - /// findCoefficient - Given a linear SCEV, - /// return the coefficient corresponding to specified loop. - /// If there isn't one, return the SCEV constant 0. - /// For example, given a*i + b*j + c*k, returning the coefficient - /// corresponding to the j loop would yield b. - const SCEV *findCoefficient(const SCEV *Expr, const Loop *TargetLoop) const; - - /// zeroCoefficient - Given a linear SCEV, - /// return the SCEV given by zeroing out the coefficient - /// corresponding to the specified loop. - /// For example, given a*i + b*j + c*k, zeroing the coefficient - /// corresponding to the j loop would yield a*i + c*k. - const SCEV *zeroCoefficient(const SCEV *Expr, const Loop *TargetLoop) const; - - /// addToCoefficient - Given a linear SCEV Expr, - /// return the SCEV given by adding some Value to the - /// coefficient corresponding to the specified TargetLoop. - /// For example, given a*i + b*j + c*k, adding 1 to the coefficient - /// corresponding to the j loop would yield a*i + (b+1)*j + c*k. - const SCEV *addToCoefficient(const SCEV *Expr, const Loop *TargetLoop, - const SCEV *Value) const; - - /// updateDirection - Update direction vector entry - /// based on the current constraint. - void updateDirection(Dependence::DVEntry &Level, - const Constraint &CurConstraint) const; - /// Given a linear access function, tries to recover subscripts /// for each dimension of the array element access. bool tryDelinearize(Instruction *Src, Instruction *Dst, diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp index ea261820fb2e6..940cedea33def 100644 --- a/llvm/lib/Analysis/DependenceAnalysis.cpp +++ b/llvm/lib/Analysis/DependenceAnalysis.cpp @@ -18,11 +18,6 @@ // of memory references in a function, returning either NULL, for no dependence, // or a more-or-less detailed description of the dependence between them. // -// Currently, the implementation cannot propagate constraints between -// coupled RDIV subscripts and lacks a multi-subscript MIV test. -// Both of these are conservative weaknesses; -// that is, not a source of correctness problems. -// // Since Clang linearizes some array subscripts, the dependence // analysis is using SCEV->delinearize to recover the representation of multiple // subscripts, and thus avoid the more expensive and less precise MIV tests. The @@ -92,8 +87,6 @@ STATISTIC(ExactRDIVapplications, "Exact RDIV applications"); STATISTIC(ExactRDIVindependence, "Exact RDIV independence"); STATISTIC(SymbolicRDIVapplications, "Symbolic RDIV applications"); STATISTIC(SymbolicRDIVindependence, "Symbolic RDIV independence"); -STATISTIC(DeltaApplications, "Delta applications"); -STATISTIC(DeltaSuccesses, "Delta successes"); STATISTIC(GCDapplications, "GCD applications"); STATISTIC(GCDsuccesses, "GCD successes"); STATISTIC(GCDindependence, "GCD independence"); @@ -445,7 +438,6 @@ static void dumpExampleDependence(raw_ostream &OS, DependenceInfo *DA, for (unsigned Level = 1; Level <= D->getLevels(); Level++) { if (D->isSplitable(Level)) { OS << " da analyze - split level = " << Level; - OS << ", iteration = " << *DA->getSplitIteration(*D, Level); OS << "!\n"; } } @@ -625,282 +617,6 @@ bool FullDependence::inSameSDLoops(unsigned Level) const { return Level > Levels; } -//===----------------------------------------------------------------------===// -// DependenceInfo::Constraint methods - -// If constraint is a point , returns X. -// Otherwise assert. -const SCEV *DependenceInfo::Constraint::getX() const { - assert(Kind == Point && "Kind should be Point"); - return A; -} - -// If constraint is a point , returns Y. -// Otherwise assert. -const SCEV *DependenceInfo::Constraint::getY() const { - assert(Kind == Point && "Kind should be Point"); - return B; -} - -// If constraint is a line AX + BY = C, returns A. -// Otherwise assert. -const SCEV *DependenceInfo::Constraint::getA() const { - assert((Kind == Line || Kind == Distance) && - "Kind should be Line (or Distance)"); - return A; -} - -// If constraint is a line AX + BY = C, returns B. -// Otherwise assert. -const SCEV *DependenceInfo::Constraint::getB() const { - assert((Kind == Line || Kind == Distance) && - "Kind should be Line (or Distance)"); - return B; -} - -// If constraint is a line AX + BY = C, returns C. -// Otherwise assert. -const SCEV *DependenceInfo::Constraint::getC() const { - assert((Kind == Line || Kind == Distance) && - "Kind should be Line (or Distance)"); - return C; -} - -// If constraint is a distance, returns D. -// Otherwise assert. -const SCEV *DependenceInfo::Constraint::getD() const { - assert(Kind == Distance && "Kind should be Distance"); - return SE->getNegativeSCEV(C); -} - -// Returns the source loop associated with this constraint. -const Loop *DependenceInfo::Constraint::getAssociatedSrcLoop() const { - assert((Kind == Distance || Kind == Line || Kind == Point) && - "Kind should be Distance, Line, or Point"); - return AssociatedSrcLoop; -} - -// Returns the destination loop associated with this constraint. -const Loop *DependenceInfo::Constraint::getAssociatedDstLoop() const { - assert((Kind == Distance || Kind == Line || Kind == Point) && - "Kind should be Distance, Line, or Point"); - return AssociatedDstLoop; -} - -void DependenceInfo::Constraint::setPoint(const SCEV *X, const SCEV *Y, - const Loop *CurSrcLoop, - const Loop *CurDstLoop) { - Kind = Point; - A = X; - B = Y; - AssociatedSrcLoop = CurSrcLoop; - AssociatedDstLoop = CurDstLoop; -} - -void DependenceInfo::Constraint::setLine(const SCEV *AA, const SCEV *BB, - const SCEV *CC, const Loop *CurSrcLoop, - const Loop *CurDstLoop) { - Kind = Line; - A = AA; - B = BB; - C = CC; - AssociatedSrcLoop = CurSrcLoop; - AssociatedDstLoop = CurDstLoop; -} - -void DependenceInfo::Constraint::setDistance(const SCEV *D, - const Loop *CurSrcLoop, - const Loop *CurDstLoop) { - Kind = Distance; - A = SE->getOne(D->getType()); - B = SE->getNegativeSCEV(A); - C = SE->getNegativeSCEV(D); - AssociatedSrcLoop = CurSrcLoop; - AssociatedDstLoop = CurDstLoop; -} - -void DependenceInfo::Constraint::setEmpty() { Kind = Empty; } - -void DependenceInfo::Constraint::setAny(ScalarEvolution *NewSE) { - SE = NewSE; - Kind = Any; -} - -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) -// For debugging purposes. Dumps the constraint out to OS. -LLVM_DUMP_METHOD void DependenceInfo::Constraint::dump(raw_ostream &OS) const { - if (isEmpty()) - OS << " Empty\n"; - else if (isAny()) - OS << " Any\n"; - else if (isPoint()) - OS << " Point is <" << *getX() << ", " << *getY() << ">\n"; - else if (isDistance()) - OS << " Distance is " << *getD() << " (" << *getA() << "*X + " << *getB() - << "*Y = " << *getC() << ")\n"; - else if (isLine()) - OS << " Line is " << *getA() << "*X + " << *getB() << "*Y = " << *getC() - << "\n"; - else - llvm_unreachable("unknown constraint type in Constraint::dump"); -} -#endif - -// Updates X with the intersection -// of the Constraints X and Y. Returns true if X has changed. -// Corresponds to Figure 4 from the paper -// -// Practical Dependence Testing -// Goff, Kennedy, Tseng -// PLDI 1991 -bool DependenceInfo::intersectConstraints(Constraint *X, const Constraint *Y) { - ++DeltaApplications; - LLVM_DEBUG(dbgs() << "\tintersect constraints\n"); - LLVM_DEBUG(dbgs() << "\t X ="; X->dump(dbgs())); - LLVM_DEBUG(dbgs() << "\t Y ="; Y->dump(dbgs())); - assert(!Y->isPoint() && "Y must not be a Point"); - if (X->isAny()) { - if (Y->isAny()) - return false; - *X = *Y; - return true; - } - if (X->isEmpty()) - return false; - if (Y->isEmpty()) { - X->setEmpty(); - return true; - } - - if (X->isDistance() && Y->isDistance()) { - LLVM_DEBUG(dbgs() << "\t intersect 2 distances\n"); - if (isKnownPredicate(CmpInst::ICMP_EQ, X->getD(), Y->getD())) - return false; - if (isKnownPredicate(CmpInst::ICMP_NE, X->getD(), Y->getD())) { - X->setEmpty(); - ++DeltaSuccesses; - return true; - } - // Hmmm, interesting situation. - // I guess if either is constant, keep it and ignore the other. - if (isa(Y->getD())) { - *X = *Y; - return true; - } - return false; - } - - // At this point, the pseudo-code in Figure 4 of the paper - // checks if (X->isPoint() && Y->isPoint()). - // This case can't occur in our implementation, - // since a Point can only arise as the result of intersecting - // two Line constraints, and the right-hand value, Y, is never - // the result of an intersection. - assert(!(X->isPoint() && Y->isPoint()) && - "We shouldn't ever see X->isPoint() && Y->isPoint()"); - - if (X->isLine() && Y->isLine()) { - LLVM_DEBUG(dbgs() << "\t intersect 2 lines\n"); - const SCEV *Prod1 = SE->getMulExpr(X->getA(), Y->getB()); - const SCEV *Prod2 = SE->getMulExpr(X->getB(), Y->getA()); - if (isKnownPredicate(CmpInst::ICMP_EQ, Prod1, Prod2)) { - // slopes are equal, so lines are parallel - LLVM_DEBUG(dbgs() << "\t\tsame slope\n"); - Prod1 = SE->getMulExpr(X->getC(), Y->getB()); - Prod2 = SE->getMulExpr(X->getB(), Y->getC()); - if (isKnownPredicate(CmpInst::ICMP_EQ, Prod1, Prod2)) - return false; - if (isKnownPredicate(CmpInst::ICMP_NE, Prod1, Prod2)) { - X->setEmpty(); - ++DeltaSuccesses; - return true; - } - return false; - } - if (isKnownPredicate(CmpInst::ICMP_NE, Prod1, Prod2)) { - // slopes differ, so lines intersect - LLVM_DEBUG(dbgs() << "\t\tdifferent slopes\n"); - const SCEV *C1B2 = SE->getMulExpr(X->getC(), Y->getB()); - const SCEV *C1A2 = SE->getMulExpr(X->getC(), Y->getA()); - const SCEV *C2B1 = SE->getMulExpr(Y->getC(), X->getB()); - const SCEV *C2A1 = SE->getMulExpr(Y->getC(), X->getA()); - const SCEV *A1B2 = SE->getMulExpr(X->getA(), Y->getB()); - const SCEV *A2B1 = SE->getMulExpr(Y->getA(), X->getB()); - const SCEVConstant *C1A2_C2A1 = - dyn_cast(SE->getMinusSCEV(C1A2, C2A1)); - const SCEVConstant *C1B2_C2B1 = - dyn_cast(SE->getMinusSCEV(C1B2, C2B1)); - const SCEVConstant *A1B2_A2B1 = - dyn_cast(SE->getMinusSCEV(A1B2, A2B1)); - const SCEVConstant *A2B1_A1B2 = - dyn_cast(SE->getMinusSCEV(A2B1, A1B2)); - if (!C1B2_C2B1 || !C1A2_C2A1 || !A1B2_A2B1 || !A2B1_A1B2) - return false; - APInt Xtop = C1B2_C2B1->getAPInt(); - APInt Xbot = A1B2_A2B1->getAPInt(); - APInt Ytop = C1A2_C2A1->getAPInt(); - APInt Ybot = A2B1_A1B2->getAPInt(); - LLVM_DEBUG(dbgs() << "\t\tXtop = " << Xtop << "\n"); - LLVM_DEBUG(dbgs() << "\t\tXbot = " << Xbot << "\n"); - LLVM_DEBUG(dbgs() << "\t\tYtop = " << Ytop << "\n"); - LLVM_DEBUG(dbgs() << "\t\tYbot = " << Ybot << "\n"); - APInt Xq = Xtop; // these need to be initialized, even - APInt Xr = Xtop; // though they're just going to be overwritten - APInt::sdivrem(Xtop, Xbot, Xq, Xr); - APInt Yq = Ytop; - APInt Yr = Ytop; - APInt::sdivrem(Ytop, Ybot, Yq, Yr); - if (Xr != 0 || Yr != 0) { - X->setEmpty(); - ++DeltaSuccesses; - return true; - } - LLVM_DEBUG(dbgs() << "\t\tX = " << Xq << ", Y = " << Yq << "\n"); - if (Xq.slt(0) || Yq.slt(0)) { - X->setEmpty(); - ++DeltaSuccesses; - return true; - } - if (const SCEVConstant *CUB = collectConstantUpperBound( - X->getAssociatedSrcLoop(), Prod1->getType())) { - const APInt &UpperBound = CUB->getAPInt(); - LLVM_DEBUG(dbgs() << "\t\tupper bound = " << UpperBound << "\n"); - if (Xq.sgt(UpperBound) || Yq.sgt(UpperBound)) { - X->setEmpty(); - ++DeltaSuccesses; - return true; - } - } - X->setPoint(SE->getConstant(Xq), SE->getConstant(Yq), - X->getAssociatedSrcLoop(), X->getAssociatedDstLoop()); - ++DeltaSuccesses; - return true; - } - return false; - } - - // if (X->isLine() && Y->isPoint()) This case can't occur. - assert(!(X->isLine() && Y->isPoint()) && "This case should never occur"); - - if (X->isPoint() && Y->isLine()) { - LLVM_DEBUG(dbgs() << "\t intersect Point and Line\n"); - const SCEV *A1X1 = SE->getMulExpr(Y->getA(), X->getX()); - const SCEV *B1Y1 = SE->getMulExpr(Y->getB(), X->getY()); - const SCEV *Sum = SE->getAddExpr(A1X1, B1Y1); - if (isKnownPredicate(CmpInst::ICMP_EQ, Sum, Y->getC())) - return false; - if (isKnownPredicate(CmpInst::ICMP_NE, Sum, Y->getC())) { - X->setEmpty(); - ++DeltaSuccesses; - return true; - } - return false; - } - - llvm_unreachable("shouldn't reach the end of Constraint intersection"); - return false; -} - //===----------------------------------------------------------------------===// // SCEVMonotonicity @@ -1678,8 +1394,7 @@ bool DependenceInfo::testZIV(const SCEV *Src, const SCEV *Dst, bool DependenceInfo::strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst, const SCEV *DstConst, const Loop *CurSrcLoop, const Loop *CurDstLoop, unsigned Level, - FullDependence &Result, - Constraint &NewConstraint) const { + FullDependence &Result) const { if (!isDependenceTestEnabled(DependenceTestType::StrongSIV)) return false; @@ -1743,8 +1458,6 @@ bool DependenceInfo::strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst, return true; } Result.DV[Level].Distance = SE->getConstant(Distance); - NewConstraint.setDistance(SE->getConstant(Distance), CurSrcLoop, - CurDstLoop); if (Distance.sgt(0)) Result.DV[Level].Direction &= Dependence::DVEntry::LT; else if (Distance.slt(0)) @@ -1755,18 +1468,14 @@ bool DependenceInfo::strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst, } else if (Delta->isZero()) { // since 0/X == 0 Result.DV[Level].Distance = Delta; - NewConstraint.setDistance(Delta, CurSrcLoop, CurDstLoop); Result.DV[Level].Direction &= Dependence::DVEntry::EQ; ++StrongSIVsuccesses; } else { if (Coeff->isOne()) { LLVM_DEBUG(dbgs() << "\t Distance = " << *Delta << "\n"); Result.DV[Level].Distance = Delta; // since X/1 == X - NewConstraint.setDistance(Delta, CurSrcLoop, CurDstLoop); } else { Result.Consistent = false; - NewConstraint.setLine(Coeff, SE->getNegativeSCEV(Coeff), - SE->getNegativeSCEV(Delta), CurSrcLoop, CurDstLoop); } // maybe we can get a useful direction @@ -1822,11 +1531,12 @@ bool DependenceInfo::strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst, // Can determine iteration for splitting. // // Return true if dependence disproved. -bool DependenceInfo::weakCrossingSIVtest( - const SCEV *Coeff, const SCEV *SrcConst, const SCEV *DstConst, - const Loop *CurSrcLoop, const Loop *CurDstLoop, unsigned Level, - FullDependence &Result, Constraint &NewConstraint, - const SCEV *&SplitIter) const { +bool DependenceInfo::weakCrossingSIVtest(const SCEV *Coeff, + const SCEV *SrcConst, + const SCEV *DstConst, + const Loop *CurSrcLoop, + const Loop *CurDstLoop, unsigned Level, + FullDependence &Result) const { if (!isDependenceTestEnabled(DependenceTestType::WeakCrossingSIV)) return false; @@ -1840,7 +1550,6 @@ bool DependenceInfo::weakCrossingSIVtest( Result.Consistent = false; const SCEV *Delta = SE->getMinusSCEV(DstConst, SrcConst); LLVM_DEBUG(dbgs() << "\t Delta = " << *Delta << "\n"); - NewConstraint.setLine(Coeff, Coeff, Delta, CurSrcLoop, CurDstLoop); if (Delta->isZero()) { Result.DV[Level].Direction &= ~Dependence::DVEntry::LT; Result.DV[Level].Direction &= ~Dependence::DVEntry::GT; @@ -1865,12 +1574,6 @@ bool DependenceInfo::weakCrossingSIVtest( } assert(SE->isKnownPositive(ConstCoeff) && "ConstCoeff should be positive"); - // compute SplitIter for use by DependenceInfo::getSplitIteration() - SplitIter = SE->getUDivExpr( - SE->getSMaxExpr(SE->getZero(Delta->getType()), Delta), - SE->getMulExpr(SE->getConstant(Delta->getType(), 2), ConstCoeff)); - LLVM_DEBUG(dbgs() << "\t Split iter = " << *SplitIter << "\n"); - const SCEVConstant *ConstDelta = dyn_cast(Delta); if (!ConstDelta) return false; @@ -2086,8 +1789,7 @@ bool DependenceInfo::exactSIVtest(const SCEV *SrcCoeff, const SCEV *DstCoeff, const SCEV *SrcConst, const SCEV *DstConst, const Loop *CurSrcLoop, const Loop *CurDstLoop, unsigned Level, - FullDependence &Result, - Constraint &NewConstraint) const { + FullDependence &Result) const { if (!isDependenceTestEnabled(DependenceTestType::ExactSIV)) return false; @@ -2104,8 +1806,6 @@ bool DependenceInfo::exactSIVtest(const SCEV *SrcCoeff, const SCEV *DstCoeff, if (!Delta) return false; LLVM_DEBUG(dbgs() << "\t Delta = " << *Delta << "\n"); - NewConstraint.setLine(SrcCoeff, SE->getNegativeSCEV(DstCoeff), Delta, - CurSrcLoop, CurDstLoop); const SCEVConstant *ConstDelta = dyn_cast(Delta); const SCEVConstant *ConstSrcCoeff = dyn_cast(SrcCoeff); const SCEVConstant *ConstDstCoeff = dyn_cast(DstCoeff); @@ -2266,10 +1966,12 @@ static bool isRemainderZero(const SCEVConstant *Dividend, // (see also weakZeroDstSIVtest) // // Return true if dependence disproved. -bool DependenceInfo::weakZeroSrcSIVtest( - const SCEV *DstCoeff, const SCEV *SrcConst, const SCEV *DstConst, - const Loop *CurSrcLoop, const Loop *CurDstLoop, unsigned Level, - FullDependence &Result, Constraint &NewConstraint) const { +bool DependenceInfo::weakZeroSrcSIVtest(const SCEV *DstCoeff, + const SCEV *SrcConst, + const SCEV *DstConst, + const Loop *CurSrcLoop, + const Loop *CurDstLoop, unsigned Level, + FullDependence &Result) const { if (!isDependenceTestEnabled(DependenceTestType::WeakZeroSIV)) return false; @@ -2285,8 +1987,6 @@ bool DependenceInfo::weakZeroSrcSIVtest( Level--; Result.Consistent = false; const SCEV *Delta = SE->getMinusSCEV(SrcConst, DstConst); - NewConstraint.setLine(SE->getZero(Delta->getType()), DstCoeff, Delta, - CurSrcLoop, CurDstLoop); LLVM_DEBUG(dbgs() << "\t Delta = " << *Delta << "\n"); if (isKnownPredicate(CmpInst::ICMP_EQ, SrcConst, DstConst)) { if (Level < CommonLevels) { @@ -2380,10 +2080,12 @@ bool DependenceInfo::weakZeroSrcSIVtest( // (see also weakZeroSrcSIVtest) // // Return true if dependence disproved. -bool DependenceInfo::weakZeroDstSIVtest( - const SCEV *SrcCoeff, const SCEV *SrcConst, const SCEV *DstConst, - const Loop *CurSrcLoop, const Loop *CurDstLoop, unsigned Level, - FullDependence &Result, Constraint &NewConstraint) const { +bool DependenceInfo::weakZeroDstSIVtest(const SCEV *SrcCoeff, + const SCEV *SrcConst, + const SCEV *DstConst, + const Loop *CurSrcLoop, + const Loop *CurDstLoop, unsigned Level, + FullDependence &Result) const { if (!isDependenceTestEnabled(DependenceTestType::WeakZeroSIV)) return false; @@ -2398,8 +2100,6 @@ bool DependenceInfo::weakZeroDstSIVtest( Level--; Result.Consistent = false; const SCEV *Delta = SE->getMinusSCEV(DstConst, SrcConst); - NewConstraint.setLine(SrcCoeff, SE->getZero(Delta->getType()), Delta, - CurSrcLoop, CurDstLoop); LLVM_DEBUG(dbgs() << "\t Delta = " << *Delta << "\n"); if (isKnownPredicate(CmpInst::ICMP_EQ, DstConst, SrcConst)) { if (Level < CommonLevels) { @@ -2731,8 +2431,7 @@ bool DependenceInfo::symbolicRDIVtest(const SCEV *A1, const SCEV *A2, // // Return true if dependence disproved. bool DependenceInfo::testSIV(const SCEV *Src, const SCEV *Dst, unsigned &Level, - FullDependence &Result, Constraint &NewConstraint, - const SCEV *&SplitIter) const { + FullDependence &Result) const { LLVM_DEBUG(dbgs() << " src = " << *Src << "\n"); LLVM_DEBUG(dbgs() << " dst = " << *Dst << "\n"); const SCEVAddRecExpr *SrcAddRec = dyn_cast(Src); @@ -2751,15 +2450,13 @@ bool DependenceInfo::testSIV(const SCEV *Src, const SCEV *Dst, unsigned &Level, bool disproven; if (SrcCoeff == DstCoeff) disproven = strongSIVtest(SrcCoeff, SrcConst, DstConst, CurSrcLoop, - CurDstLoop, Level, Result, NewConstraint); + CurDstLoop, Level, Result); else if (SrcCoeff == SE->getNegativeSCEV(DstCoeff)) disproven = weakCrossingSIVtest(SrcCoeff, SrcConst, DstConst, CurSrcLoop, - CurDstLoop, Level, Result, NewConstraint, - SplitIter); + CurDstLoop, Level, Result); else - disproven = - exactSIVtest(SrcCoeff, DstCoeff, SrcConst, DstConst, CurSrcLoop, - CurDstLoop, Level, Result, NewConstraint); + disproven = exactSIVtest(SrcCoeff, DstCoeff, SrcConst, DstConst, + CurSrcLoop, CurDstLoop, Level, Result); return disproven || gcdMIVtest(Src, Dst, Result) || symbolicRDIVtest(SrcCoeff, DstCoeff, SrcConst, DstConst, CurSrcLoop, CurDstLoop); @@ -2771,7 +2468,7 @@ bool DependenceInfo::testSIV(const SCEV *Src, const SCEV *Dst, unsigned &Level, const Loop *CurSrcLoop = SrcAddRec->getLoop(); Level = mapSrcLoop(CurSrcLoop); return weakZeroDstSIVtest(SrcCoeff, SrcConst, DstConst, CurSrcLoop, - CurSrcLoop, Level, Result, NewConstraint) || + CurSrcLoop, Level, Result) || gcdMIVtest(Src, Dst, Result); } if (DstAddRec) { @@ -2781,7 +2478,7 @@ bool DependenceInfo::testSIV(const SCEV *Src, const SCEV *Dst, unsigned &Level, const Loop *CurDstLoop = DstAddRec->getLoop(); Level = mapDstLoop(CurDstLoop); return weakZeroSrcSIVtest(DstCoeff, SrcConst, DstConst, CurDstLoop, - CurDstLoop, Level, Result, NewConstraint) || + CurDstLoop, Level, Result) || gcdMIVtest(Src, Dst, Result); } llvm_unreachable("SIV test expected at least one AddRec"); @@ -3566,113 +3263,6 @@ const SCEV *DependenceInfo::getUpperBound(BoundInfo *Bound) const { return Sum; } -//===----------------------------------------------------------------------===// -// Constraint manipulation for Delta test. - -// Given a linear SCEV, -// return the coefficient (the step) -// corresponding to the specified loop. -// If there isn't one, return 0. -// For example, given a*i + b*j + c*k, finding the coefficient -// corresponding to the j loop would yield b. -const SCEV *DependenceInfo::findCoefficient(const SCEV *Expr, - const Loop *TargetLoop) const { - const SCEVAddRecExpr *AddRec = dyn_cast(Expr); - if (!AddRec) - return SE->getZero(Expr->getType()); - if (AddRec->getLoop() == TargetLoop) - return AddRec->getStepRecurrence(*SE); - return findCoefficient(AddRec->getStart(), TargetLoop); -} - -// Given a linear SCEV, -// return the SCEV given by zeroing out the coefficient -// corresponding to the specified loop. -// For example, given a*i + b*j + c*k, zeroing the coefficient -// corresponding to the j loop would yield a*i + c*k. -const SCEV *DependenceInfo::zeroCoefficient(const SCEV *Expr, - const Loop *TargetLoop) const { - const SCEVAddRecExpr *AddRec = dyn_cast(Expr); - if (!AddRec) - return Expr; // ignore - if (AddRec->getLoop() == TargetLoop) - return AddRec->getStart(); - return SE->getAddRecExpr(zeroCoefficient(AddRec->getStart(), TargetLoop), - AddRec->getStepRecurrence(*SE), AddRec->getLoop(), - AddRec->getNoWrapFlags()); -} - -// Given a linear SCEV Expr, -// return the SCEV given by adding some Value to the -// coefficient corresponding to the specified TargetLoop. -// For example, given a*i + b*j + c*k, adding 1 to the coefficient -// corresponding to the j loop would yield a*i + (b+1)*j + c*k. -const SCEV *DependenceInfo::addToCoefficient(const SCEV *Expr, - const Loop *TargetLoop, - const SCEV *Value) const { - const SCEVAddRecExpr *AddRec = dyn_cast(Expr); - if (!AddRec) // create a new addRec - return SE->getAddRecExpr(Expr, Value, TargetLoop, - SCEV::FlagAnyWrap); // Worst case, with no info. - if (AddRec->getLoop() == TargetLoop) { - const SCEV *Sum = SE->getAddExpr(AddRec->getStepRecurrence(*SE), Value); - if (Sum->isZero()) - return AddRec->getStart(); - return SE->getAddRecExpr(AddRec->getStart(), Sum, AddRec->getLoop(), - AddRec->getNoWrapFlags()); - } - if (SE->isLoopInvariant(AddRec, TargetLoop)) - return SE->getAddRecExpr(AddRec, Value, TargetLoop, SCEV::FlagAnyWrap); - return SE->getAddRecExpr( - addToCoefficient(AddRec->getStart(), TargetLoop, Value), - AddRec->getStepRecurrence(*SE), AddRec->getLoop(), - AddRec->getNoWrapFlags()); -} - -// Update direction vector entry based on the current constraint. -void DependenceInfo::updateDirection(Dependence::DVEntry &Level, - const Constraint &CurConstraint) const { - LLVM_DEBUG(dbgs() << "\tUpdate direction, constraint ="); - LLVM_DEBUG(CurConstraint.dump(dbgs())); - if (CurConstraint.isAny()) - ; // use defaults - else if (CurConstraint.isDistance()) { - // this one is consistent, the others aren't - Level.Scalar = false; - Level.Distance = CurConstraint.getD(); - unsigned NewDirection = Dependence::DVEntry::NONE; - if (!SE->isKnownNonZero(Level.Distance)) // if may be zero - NewDirection = Dependence::DVEntry::EQ; - if (!SE->isKnownNonPositive(Level.Distance)) // if may be positive - NewDirection |= Dependence::DVEntry::LT; - if (!SE->isKnownNonNegative(Level.Distance)) // if may be negative - NewDirection |= Dependence::DVEntry::GT; - Level.Direction &= NewDirection; - } else if (CurConstraint.isLine()) { - Level.Scalar = false; - Level.Distance = nullptr; - // direction should be accurate - } else if (CurConstraint.isPoint()) { - Level.Scalar = false; - Level.Distance = nullptr; - unsigned NewDirection = Dependence::DVEntry::NONE; - if (!isKnownPredicate(CmpInst::ICMP_NE, CurConstraint.getY(), - CurConstraint.getX())) - // if X may be = Y - NewDirection |= Dependence::DVEntry::EQ; - if (!isKnownPredicate(CmpInst::ICMP_SLE, CurConstraint.getY(), - CurConstraint.getX())) - // if Y may be > X - NewDirection |= Dependence::DVEntry::LT; - if (!isKnownPredicate(CmpInst::ICMP_SGE, CurConstraint.getY(), - CurConstraint.getX())) - // if Y may be < X - NewDirection |= Dependence::DVEntry::GT; - Level.Direction &= NewDirection; - } else - llvm_unreachable("constraint has unexpected kind"); -} - /// Check if we can delinearize the subscripts. If the SCEVs representing the /// source and destination array references are recurrences on a nested loop, /// this function flattens the nested recurrences into separate recurrences @@ -3951,8 +3541,6 @@ SCEVUnionPredicate DependenceInfo::getRuntimeAssumptions() const { // Goff, Kennedy, Tseng // PLDI 1991 // -// Care is required to keep the routine below, getSplitIteration(), -// up to date with respect to this routine. std::unique_ptr DependenceInfo::depends(Instruction *Src, Instruction *Dst, bool UnderRuntimeAssumptions) { @@ -4158,11 +3746,7 @@ DependenceInfo::depends(Instruction *Src, Instruction *Dst, case Subscript::SIV: { LLVM_DEBUG(dbgs() << ", SIV\n"); unsigned Level; - const SCEV *SplitIter = nullptr; - Constraint NewConstraint; - NewConstraint.setAny(SE); - if (testSIV(Pair[SI].Src, Pair[SI].Dst, Level, Result, NewConstraint, - SplitIter)) + if (testSIV(Pair[SI].Src, Pair[SI].Dst, Level, Result)) return nullptr; break; } @@ -4256,133 +3840,3 @@ DependenceInfo::depends(Instruction *Src, Instruction *Dst, return std::make_unique(std::move(Result)); } - -//===----------------------------------------------------------------------===// -// getSplitIteration - -// Rather than spend rarely-used space recording the splitting iteration -// during the Weak-Crossing SIV test, we re-compute it on demand. -// The re-computation is basically a repeat of the entire dependence test, -// though simplified since we know that the dependence exists. -// It's tedious, since we must go through all propagations, etc. -// -// Care is required to keep this code up to date with respect to the routine -// above, depends(). -// -// Generally, the dependence analyzer will be used to build -// a dependence graph for a function (basically a map from instructions -// to dependences). Looking for cycles in the graph shows us loops -// that cannot be trivially vectorized/parallelized. -// -// We can try to improve the situation by examining all the dependences -// that make up the cycle, looking for ones we can break. -// Sometimes, peeling the first or last iteration of a loop will break -// dependences, and we've got flags for those possibilities. -// Sometimes, splitting a loop at some other iteration will do the trick, -// and we've got a flag for that case. Rather than waste the space to -// record the exact iteration (since we rarely know), we provide -// a method that calculates the iteration. It's a drag that it must work -// from scratch, but wonderful in that it's possible. -// -// Here's an example: -// -// for (i = 0; i < 10; i++) -// A[i] = ... -// ... = A[11 - i] -// -// There's a loop-carried flow dependence from the store to the load, -// found by the weak-crossing SIV test. The dependence will have a flag, -// indicating that the dependence can be broken by splitting the loop. -// Calling getSplitIteration will return 5. -// Splitting the loop breaks the dependence, like so: -// -// for (i = 0; i <= 5; i++) -// A[i] = ... -// ... = A[11 - i] -// for (i = 6; i < 10; i++) -// A[i] = ... -// ... = A[11 - i] -// -// breaks the dependence and allows us to vectorize/parallelize -// both loops. -const SCEV *DependenceInfo::getSplitIteration(const Dependence &Dep, - unsigned SplitLevel) { - assert(Dep.isSplitable(SplitLevel) && - "Dep should be splitable at SplitLevel"); - Instruction *Src = Dep.getSrc(); - Instruction *Dst = Dep.getDst(); - assert(Src->mayReadFromMemory() || Src->mayWriteToMemory()); - assert(Dst->mayReadFromMemory() || Dst->mayWriteToMemory()); - assert(isLoadOrStore(Src)); - assert(isLoadOrStore(Dst)); - Value *SrcPtr = getLoadStorePointerOperand(Src); - Value *DstPtr = getLoadStorePointerOperand(Dst); - assert(underlyingObjectsAlias( - AA, F->getDataLayout(), MemoryLocation::get(Dst), - MemoryLocation::get(Src)) == AliasResult::MustAlias); - - // establish loop nesting levels - establishNestingLevels(Src, Dst); - - FullDependence Result(Src, Dst, Dep.Assumptions, false, CommonLevels); - - unsigned Pairs = 1; - SmallVector Pair(Pairs); - const SCEV *SrcSCEV = SE->getSCEV(SrcPtr); - const SCEV *DstSCEV = SE->getSCEV(DstPtr); - Pair[0].Src = SE->removePointerBase(SrcSCEV); - Pair[0].Dst = SE->removePointerBase(DstSCEV); - - if (Delinearize) { - if (tryDelinearize(Src, Dst, Pair)) { - LLVM_DEBUG(dbgs() << " delinearized\n"); - Pairs = Pair.size(); - } - } - - for (unsigned P = 0; P < Pairs; ++P) { - assert(Pair[P].Src->getType()->isIntegerTy() && "Src must be an integer"); - assert(Pair[P].Dst->getType()->isIntegerTy() && "Dst must be an integer"); - Pair[P].Loops.resize(MaxLevels + 1); - Pair[P].GroupLoops.resize(MaxLevels + 1); - Pair[P].Group.resize(Pairs); - removeMatchingExtensions(&Pair[P]); - Pair[P].Classification = - classifyPair(Pair[P].Src, LI->getLoopFor(Src->getParent()), Pair[P].Dst, - LI->getLoopFor(Dst->getParent()), Pair[P].Loops); - Pair[P].GroupLoops = Pair[P].Loops; - Pair[P].Group.set(P); - } - - Constraint NewConstraint; - NewConstraint.setAny(SE); - - // Test each subscript individually for split iteration - for (unsigned SI = 0; SI < Pairs; ++SI) { - switch (Pair[SI].Classification) { - case Subscript::NonLinear: - // ignore these, but collect loops for later - collectCommonLoops(Pair[SI].Src, LI->getLoopFor(Src->getParent()), - Pair[SI].Loops); - collectCommonLoops(Pair[SI].Dst, LI->getLoopFor(Dst->getParent()), - Pair[SI].Loops); - Result.Consistent = false; - break; - case Subscript::SIV: { - unsigned Level; - const SCEV *SplitIter = nullptr; - (void)testSIV(Pair[SI].Src, Pair[SI].Dst, Level, Result, NewConstraint, - SplitIter); - if (Level == SplitLevel && SplitIter != nullptr) { - return SplitIter; - } - break; - } - case Subscript::ZIV: - case Subscript::RDIV: - case Subscript::MIV: - break; - } - } - // No split iteration found - return nullptr; -} diff --git a/llvm/test/Analysis/DependenceAnalysis/Propagating.ll b/llvm/test/Analysis/DependenceAnalysis/Propagating.ll index 09598f43c7c7d..1a52f8c2ed450 100644 --- a/llvm/test/Analysis/DependenceAnalysis/Propagating.ll +++ b/llvm/test/Analysis/DependenceAnalysis/Propagating.ll @@ -438,7 +438,7 @@ define void @prop7(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp { ; CHECK-NEXT: da analyze - none! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx7, align 4 --> Dst: %0 = load i32, ptr %arrayidx13, align 4 ; CHECK-NEXT: da analyze - flow [* -38] splitable! -; CHECK-NEXT: da analyze - split level = 1, iteration = 4! +; CHECK-NEXT: da analyze - split level = 1! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx7, align 4 --> Dst: store i32 %0, ptr %B.addr.11, align 4 ; CHECK-NEXT: da analyze - confused! ; CHECK-NEXT: Src: %0 = load i32, ptr %arrayidx13, align 4 --> Dst: %0 = load i32, ptr %arrayidx13, align 4 diff --git a/llvm/test/Analysis/DependenceAnalysis/SymbolicSIV.ll b/llvm/test/Analysis/DependenceAnalysis/SymbolicSIV.ll index 73a415baef4c4..53ebdc0dfb3d2 100644 --- a/llvm/test/Analysis/DependenceAnalysis/SymbolicSIV.ll +++ b/llvm/test/Analysis/DependenceAnalysis/SymbolicSIV.ll @@ -333,7 +333,7 @@ define void @weaktest(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp { ; CHECK-NEXT: da analyze - none! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: %0 = load i32, ptr %arrayidx2, align 4 ; CHECK-NEXT: da analyze - flow [*|<] splitable! -; CHECK-NEXT: da analyze - split level = 1, iteration = ((0 smax (-4 + (-4 * %n))) /u 8)! +; CHECK-NEXT: da analyze - split level = 1! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: store i32 %0, ptr %B.addr.02, align 4 ; CHECK-NEXT: da analyze - confused! ; CHECK-NEXT: Src: %0 = load i32, ptr %arrayidx2, align 4 --> Dst: %0 = load i32, ptr %arrayidx2, align 4 diff --git a/llvm/test/Analysis/DependenceAnalysis/WeakCrossingSIV.ll b/llvm/test/Analysis/DependenceAnalysis/WeakCrossingSIV.ll index cd044032e34f1..18e8c39f43f86 100644 --- a/llvm/test/Analysis/DependenceAnalysis/WeakCrossingSIV.ll +++ b/llvm/test/Analysis/DependenceAnalysis/WeakCrossingSIV.ll @@ -69,7 +69,7 @@ define void @weakcrossing1(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp { ; CHECK-NEXT: da analyze - none! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: %0 = load i32, ptr %arrayidx2, align 4 ; CHECK-NEXT: da analyze - flow [<>] splitable! -; CHECK-NEXT: da analyze - split level = 1, iteration = 0! +; CHECK-NEXT: da analyze - split level = 1! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: store i32 %0, ptr %B.addr.02, align 4 ; CHECK-NEXT: da analyze - confused! ; CHECK-NEXT: Src: %0 = load i32, ptr %arrayidx2, align 4 --> Dst: %0 = load i32, ptr %arrayidx2, align 4 @@ -298,7 +298,7 @@ define void @weakcrossing6(ptr %A, ptr %B, i64 %n) nounwind uwtable ssp { ; CHECK-NEXT: da analyze - none! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: %0 = load i32, ptr %arrayidx1, align 4 ; CHECK-NEXT: da analyze - flow [<>] splitable! -; CHECK-NEXT: da analyze - split level = 1, iteration = 2! +; CHECK-NEXT: da analyze - split level = 1! ; CHECK-NEXT: Src: store i32 %conv, ptr %arrayidx, align 4 --> Dst: store i32 %0, ptr %B.addr.01, align 4 ; CHECK-NEXT: da analyze - confused! ; CHECK-NEXT: Src: %0 = load i32, ptr %arrayidx1, align 4 --> Dst: %0 = load i32, ptr %arrayidx1, align 4 diff --git a/llvm/test/Analysis/DependenceAnalysis/run-specific-dependence-test.ll b/llvm/test/Analysis/DependenceAnalysis/run-specific-dependence-test.ll index 8bfbf930a9ef6..4e22197ed00d8 100644 --- a/llvm/test/Analysis/DependenceAnalysis/run-specific-dependence-test.ll +++ b/llvm/test/Analysis/DependenceAnalysis/run-specific-dependence-test.ll @@ -82,7 +82,7 @@ define void @weak_crossing_siv(ptr %a) { ; CHECK-ALL-NEXT: da analyze - none! ; CHECK-ALL-NEXT: Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 2, ptr %gep.1, align 1 ; CHECK-ALL-NEXT: da analyze - output [*|<] splitable! -; CHECK-ALL-NEXT: da analyze - split level = 1, iteration = 5! +; CHECK-ALL-NEXT: da analyze - split level = 1! ; CHECK-ALL-NEXT: Src: store i8 2, ptr %gep.1, align 1 --> Dst: store i8 2, ptr %gep.1, align 1 ; CHECK-ALL-NEXT: da analyze - none! ; @@ -99,7 +99,7 @@ define void @weak_crossing_siv(ptr %a) { ; CHECK-WEAK-CROSSING-SIV-NEXT: da analyze - consistent output [*]! ; CHECK-WEAK-CROSSING-SIV-NEXT: Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 2, ptr %gep.1, align 1 ; CHECK-WEAK-CROSSING-SIV-NEXT: da analyze - output [*|<] splitable! -; CHECK-WEAK-CROSSING-SIV-NEXT: da analyze - split level = 1, iteration = 5! +; CHECK-WEAK-CROSSING-SIV-NEXT: da analyze - split level = 1! ; CHECK-WEAK-CROSSING-SIV-NEXT: Src: store i8 2, ptr %gep.1, align 1 --> Dst: store i8 2, ptr %gep.1, align 1 ; CHECK-WEAK-CROSSING-SIV-NEXT: da analyze - consistent output [*]! ;