Skip to content

Commit 7a64022

Browse files
committed
Change the return type to bool
1 parent 3ed1cb7 commit 7a64022

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/include/llvm/Analysis/Delinearization.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ bool findFixedSizeArrayDimensions(ScalarEvolution &SE, const SCEV *Expr,
136136
/// This function is intended to replace getIndexExpressionsFromGEP and
137137
/// tryDelinearizeFixedSizeImpl. They rely on the GEP source element type so
138138
/// that they will be removed in the future.
139-
void delinearizeFixedSizeArray(ScalarEvolution &SE, const SCEV *Expr,
139+
bool delinearizeFixedSizeArray(ScalarEvolution &SE, const SCEV *Expr,
140140
SmallVectorImpl<const SCEV *> &Subscripts,
141141
SmallVectorImpl<const SCEV *> &Sizes,
142142
const SCEV *ElementSize);

llvm/lib/Analysis/Delinearization.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ bool llvm::findFixedSizeArrayDimensions(ScalarEvolution &SE, const SCEV *Expr,
642642
/// TODO: At the moment, this function can handle only simple cases. For
643643
/// example, we cannot handle a case where a step recurrence is not divisible
644644
/// by the next smaller step recurrence, e.g., A[i][3*j].
645-
void llvm::delinearizeFixedSizeArray(ScalarEvolution &SE, const SCEV *Expr,
645+
bool llvm::delinearizeFixedSizeArray(ScalarEvolution &SE, const SCEV *Expr,
646646
SmallVectorImpl<const SCEV *> &Subscripts,
647647
SmallVectorImpl<const SCEV *> &Sizes,
648648
const SCEV *ElementSize) {
@@ -651,7 +651,7 @@ void llvm::delinearizeFixedSizeArray(ScalarEvolution &SE, const SCEV *Expr,
651651
SmallVector<unsigned, 4> ConstSizes;
652652
if (!findFixedSizeArrayDimensions(SE, Expr, ConstSizes, ElementSize)) {
653653
Sizes.clear();
654-
return;
654+
return false;
655655
}
656656

657657
// Convert the constant size to SCEV.
@@ -661,8 +661,7 @@ void llvm::delinearizeFixedSizeArray(ScalarEvolution &SE, const SCEV *Expr,
661661
// Second step: compute the access functions for each subscript.
662662
computeAccessFunctions(SE, Expr, Subscripts, Sizes);
663663

664-
if (Subscripts.empty())
665-
return;
664+
return !Subscripts.empty();
666665
}
667666

668667
bool llvm::getIndexExpressionsFromGEP(ScalarEvolution &SE,

0 commit comments

Comments
 (0)