@@ -494,7 +494,7 @@ static std::optional<APInt> tryIntoAPInt(const SCEV *S) {
494494
495495// / Collects the absolute values of constant steps for all induction variables.
496496// / Returns true if we can prove that all step recurrences are constants and \p
497- // / Expr is dividable by \p ElementSize. Each step recurrence is stored in \p
497+ // / Expr is divisible by \p ElementSize. Each step recurrence is stored in \p
498498// / Steps after divided by \p ElementSize.
499499static bool collectConstantAbsSteps (ScalarEvolution &SE, const SCEV *Expr,
500500 SmallVectorImpl<unsigned > &Steps,
@@ -567,7 +567,7 @@ static bool findFixedSizeArrayDimensions(ScalarEvolution &SE, const SCEV *Expr,
567567 // in like Arr[UnknownSize][8][32] with elements of size 8 bytes, where Arr is
568568 // a base pointer.
569569 //
570- // TODO: Catch more cases, e.g., when a step recurrence is not dividable by
570+ // TODO: Catch more cases, e.g., when a step recurrence is not divisible by
571571 // the next smaller one, like A[i][3*j].
572572 llvm::sort (Sizes.rbegin (), Sizes.rend ());
573573 Sizes.erase (llvm::unique (Sizes), Sizes.end ());
@@ -615,14 +615,11 @@ static bool findFixedSizeArrayDimensions(ScalarEvolution &SE, const SCEV *Expr,
615615// / subscript, so the caller should perform additional boundary checks if
616616// / necessary.
617617// /
618- // / TODO: At the moment, this function can handle only simple cases. For
619- // / example, we cannot handle a case where a step recurrence is not dividable by
620- // / the next smaller step recurrence, e.g., A[i][3*j]. Furthermore, this
621- // / function doesn't guarantee that the original array size is restored
622- // / "correctly". For example, in the following case:
618+ // / Also note that this function doesn't guarantee that the original array size
619+ // / is restored "correctly". For example, in the following case:
623620// /
624- // / double A[42][4][32 ];
625- // / double B[42][8][64 ];
621+ // / double A[42][4][64 ];
622+ // / double B[42][8][32 ];
626623// / for i
627624// / for j
628625// / for k
@@ -635,6 +632,10 @@ static bool findFixedSizeArrayDimensions(ScalarEvolution &SE, const SCEV *Expr,
635632// /
636633// / The array sizes for both A and B will be computed as
637634// / ArrayDecl[UnknownSize][4][64], which matches for A, but not for B.
635+ // /
636+ // / TODO: At the moment, this function can handle only simple cases. For
637+ // / example, we cannot handle a case where a step recurrence is not divisible
638+ // / by the next smaller step recurrence, e.g., A[i][3*j].
638639void llvm::delinearizeFixedSizeArray (ScalarEvolution &SE, const SCEV *Expr,
639640 SmallVectorImpl<const SCEV *> &Subscripts,
640641 SmallVectorImpl<const SCEV *> &Sizes,
0 commit comments