-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
transformations: Split varith into neighbour and own data across csl_…
…stencil regions (#3307) Background: The `csl_stencil.apply` op does communicate-and-compute on a given stencil buffer. It holds two regions, one for processing chunks of neighbour data (of this one buffer only), and one region for processing everything else after the exchange is done. The `convert-stencil-to-csl-stencil` pass splits the computation of the `stencil.apply` op across these two regions. The split was done in two steps, first re-ordering arith ops in the `RestructureSymmetricReductionPattern`, and then calling the `get_ops_split` function on the re-shuffled arith ops. Intuitively, the re-order pass would identify chained reductions (`arith.addf`, `arith.mulf`) and restructure them such that all neighbour data which should end up in the first region is consumed first, and the chained arith ops become easily splittable. This PR replaces this logic by converting arith to varith, splitting the varith op into neighbour/other data in the `SplitVarithOpPattern` rewrite, and then proceeding with `get_ops_split` and everything else as before. At the end, varith is converted back to arith. Minor improvements: * Constants are now always duplicated and appear on both regions, which `dce` can clean up --------- Co-authored-by: n-io <[email protected]>
- Loading branch information
Showing
3 changed files
with
228 additions
and
135 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
Oops, something went wrong.