[all-commits] [llvm/llvm-project] e38c8b: [MLIR][scf.parallel] Don't allow a tile size of 0 ...
Justin Fargnoli via All-commits
all-commits at lists.llvm.org
Mon Oct 23 14:28:58 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e38c8bdca8ca1c05d8e6e2e665524c0841fb13d3
https://github.com/llvm/llvm-project/commit/e38c8bdca8ca1c05d8e6e2e665524c0841fb13d3
Author: Justin Fargnoli <34139864+justinfargnoli at users.noreply.github.com>
Date: 2023-10-23 (Mon, 23 Oct 2023)
Changed paths:
M mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp
A mlir/test/Dialect/SCF/parallel-loop-invalid.mlir
Log Message:
-----------
[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.
More information about the All-commits
mailing list