Skip to content

Commit af12a66

Browse files
committed
Address review comments
1 parent 5a75284 commit af12a66

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

llvm/include/llvm/Analysis/DependenceAnalysis.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -759,18 +759,16 @@ class DependenceInfo {
759759
const SmallBitVector &Loops,
760760
FullDependence &Result) const;
761761

762-
/// collectCoefficientInfo - Walks through the subscript,
763-
/// collecting each coefficient, the associated loop bounds,
764-
/// and recording its positive and negative parts for later use.
762+
/// collectCoeffInfo - Walks through the subscript, collecting each
763+
/// coefficient, the associated loop bounds, and recording its positive and
764+
/// negative parts for later use.
765765
CoefficientInfo *collectCoeffInfo(const SCEV *Subscript, bool SrcFlag,
766766
const SCEV *&Constant) const;
767767

768768
/// getPositivePart - X^+ = max(X, 0).
769-
///
770769
const SCEV *getPositivePart(const SCEV *X) const;
771770

772771
/// getNegativePart - X^- = min(X, 0).
773-
///
774772
const SCEV *getNegativePart(const SCEV *X) const;
775773

776774
/// getLowerBound - Looks through all the bounds info and

llvm/lib/Analysis/DependenceAnalysis.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,14 +1474,11 @@ static bool findGCD(unsigned Bits, const APInt &AM, const APInt &BM,
14741474
APInt R = G0;
14751475
APInt::sdivrem(G0, G1, Q, R);
14761476
while (R != 0) {
1477-
APInt A2 = A0 - Q * A1;
1478-
A0 = A1;
1479-
A1 = A2;
1480-
APInt B2 = B0 - Q * B1;
1481-
B0 = B1;
1482-
B1 = B2;
1483-
G0 = G1;
1484-
G1 = R;
1477+
// clang-format off
1478+
APInt A2 = A0 - Q*A1; A0 = A1; A1 = A2;
1479+
APInt B2 = B0 - Q*B1; B0 = B1; B1 = B2;
1480+
G0 = G1; G1 = R;
1481+
// clang-format on
14851482
APInt::sdivrem(G0, G1, Q, R);
14861483
}
14871484
G = G1;
@@ -2770,8 +2767,10 @@ bool DependenceInfo::testBounds(unsigned char DirKind, unsigned Level,
27702767
// and the upper bound is always >= 0.
27712768
void DependenceInfo::findBoundsALL(CoefficientInfo *A, CoefficientInfo *B,
27722769
BoundInfo *Bound, unsigned K) const {
2773-
Bound[K].Lower[Dependence::DVEntry::ALL] = nullptr; // Represents -infinity
2774-
Bound[K].Upper[Dependence::DVEntry::ALL] = nullptr; // Represents +infinity
2770+
Bound[K].Lower[Dependence::DVEntry::ALL] =
2771+
nullptr; // Default value = -infinity.
2772+
Bound[K].Upper[Dependence::DVEntry::ALL] =
2773+
nullptr; // Default value = +infinity.
27752774
if (Bound[K].Iterations) {
27762775
Bound[K].Lower[Dependence::DVEntry::ALL] = SE->getMulExpr(
27772776
SE->getMinusSCEV(A[K].NegPart, B[K].PosPart), Bound[K].Iterations);
@@ -3144,8 +3143,6 @@ bool DependenceInfo::propagateLine(const SCEV *&Src, const SCEV *&Dst,
31443143
APInt CdivB = Charlie.sdiv(Beta);
31453144
assert(Charlie.srem(Beta) == 0 && "C should be evenly divisible by B");
31463145
const SCEV *AP_K = findCoefficient(Dst, CurLoop);
3147-
// Src = SE->getAddExpr(Src, SE->getMulExpr(AP_K,
3148-
// SE->getConstant(CdivB)));
31493146
Src = SE->getMinusSCEV(Src, SE->getMulExpr(AP_K, SE->getConstant(CdivB)));
31503147
Dst = zeroCoefficient(Dst, CurLoop);
31513148
if (!findCoefficient(Src, CurLoop)->isZero())

0 commit comments

Comments
 (0)