[Mlir-commits] [mlir] [mlir][SCF] Add `RecursiveMemoryEffects` to `scf.reduce` (PR #75314)
Ivan Butygin
llvmlistbot at llvm.org
Wed Dec 13 16:50:19 PST 2023
Hardcode84 wrote:
> Why is this a problem to fold it away?
`scf.reduce` has a weird semantics, it describes how values should be reduced between `scf.parallel` loop interations. `scf.reduce` ops count must match reduction variables count and they should never be removed.
```
%0:2 = scf.parallel (%i0, %i1) = (%c1, %c3) to (%c2, %c6) step (%c1, %c3) init(%A, %B) -> (index, index) {
scf.reduce(%i0) : index {
^bb0(%lhs: index, %rhs: index):
%1 = arith.addi %lhs, %rhs : index
scf.reduce.return %1 : index
}
scf.reduce(%i1) : index {
^bb0(%lhs: index, %rhs: index):
%2 = arith.muli %lhs, %rhs : index
scf.reduce.return %2 : index
}
scf.yield
}
```
https://github.com/llvm/llvm-project/pull/75314
More information about the Mlir-commits
mailing list