Skip to content

Commit 99255bb

Browse files
SwapnilGhanshyalaHarsh Chaudhari
authored andcommitted
[MLIR][Affine]Fixed crash with invalid cachesize (Issue #64979)
Updated LoopTiling::runOnOperation() to signal pass failure incase the set cachesize is invalid, i.e., less than or equal to zero. #64979 is the reporting issue.
1 parent beb12f9 commit 99255bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ void LoopTiling::getTileSizes(ArrayRef<AffineForOp> band,
173173
}
174174

175175
void LoopTiling::runOnOperation() {
176+
if (cacheSizeInKiB <= 0) {
177+
getOperation().emitError(
178+
"illegal argument: '--affine-loop-tile=cache-size' cannot be "
179+
"less than or equal to zero. \nAborted!");
180+
return signalPassFailure();
181+
}
176182
// Bands of loops to tile.
177183
std::vector<SmallVector<AffineForOp, 6>> bands;
178184
getTileableBands(getOperation(), &bands);

0 commit comments

Comments
 (0)