[MLIR][scf.parallel] Don't allow a tile size of 0 (#68762)
Fix a crash reported in #64331. The crash is described in the following comment: > It looks like the bug is being caused by the command line argument --scf-parallel-loop-tiling=parallel-loop-tile-sizes=0. More specifically, --scf-parallel-loop-tiling=parallel-loop-tile-sizes sets the tileSize variable to 0 on [this line](https://github.com/llvm/llvm-project/blob/7cc1bfaf371c4a816cf4e62fe31d8515bf8f6fbd/mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp#L67). tileSize is then used on [this line](https://github.com/llvm/llvm-project/blob/7cc1bfaf371c4a816cf4e62fe31d8515bf8f6fbd/mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp#L117) causing a divide by zero exception. This PR will: 1. Call `signalPassFail()` when 0 is passed as a tile size. 2. Avoid the divide by zero that causes the crash. Note: This is my first PR for MLIR, so please liberally critique it.
parent
f0812480
Please register or sign in to comment