Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir][linalg] Add control to pad-slice swap pattern
The pad-slice swap pattern generates `scf.if` and `tensor.generate` to guard against zero-sized slices if it cannot prove the slice is always non-zero. This is safe but quite conservative. It can be unnecessary for cases where we know by problem definition such cases does not exist, even if with dynamic shaped ops or unknown tile/slice sizes, e.g., convolution padding size = 1 with kernel dim size = 3. So this commit introduces a control to the pattern to specify whether to generate the if constructs to handle such cases better, given that once the if constructs is materialized, it's very hard to analyze and simplify. Reviewed By: mravishankar Differential Revision: https://reviews.llvm.org/D117017
- Loading branch information
1 parent
27cd2a6
commit 0edb412
Showing
6 changed files
with
257 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.