Back to PBT run
input.mlir
dataflow.thread private @t0 domain(#dataflow.thread_domain<dense>)(
%scratch: memref<8xindex>, %memory: memref<8xindex>, %grid: memref<4x4xindex>,
%n: index) ctrl (%ctrl: none) {
%rzero = arith.constant 0 : index
%rval = arith.constant 3 : index
memref.store %rval, %scratch[%rzero] : memref<8xindex>
"loom.spatial_region"(%n, %memory, %grid)
<{operandSegmentSizes = array<i32: 1, 0, 2, 0>,
resultSegmentSizes = array<i32: 0, 0>}> ({
^bb0(%limit: index, %target: memref<8xindex>, %tile: memref<4x4xindex>):
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cw = arith.constant 2 : index
%kv = arith.constant 7 : index
scf.parallel (%pi) = (%c0) to (%cw) step (%c1) {
scf.parallel (%pj) = (%c0) to (%cw) step (%c1) {
memref.store %kv, %tile[%pi, %pj] : memref<4x4xindex>
scf.reduce
}
scf.reduce
}
"loom.spatial_yield"()
<{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
}) {graph_name = "g_t0_0", source_maps = []} :
(index, memref<8xindex>, memref<4x4xindex>) -> ()
dataflow.thread.yield
}
dataflow.thread private @t1 domain(#dataflow.thread_domain<dense>)(
%scratch: memref<8xindex>, %memory: memref<8xindex>, %grid: memref<4x4xindex>,
%n: index) ctrl (%ctrl: none) {
%rzero = arith.constant 0 : index
%rval = arith.constant 3 : index
memref.store %rval, %scratch[%rzero] : memref<8xindex>
"loom.spatial_region"(%n, %memory, %grid)
<{operandSegmentSizes = array<i32: 1, 0, 2, 0>,
resultSegmentSizes = array<i32: 0, 0>}> ({
^bb0(%limit: index, %target: memref<8xindex>, %tile: memref<4x4xindex>):
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%cw = arith.constant 1 : index
%kv = arith.constant 7 : index
scf.parallel (%lane) = (%c0) to (%cw) step (%c1) {
%bsum = scf.for %bi = %c0 to %limit step %c1 iter_args(%bacc = %lane) -> (index) {
%bnext = arith.addi %bacc, %c1 : index
scf.yield %bnext : index
}
memref.store %bsum, %target[%lane] : memref<8xindex>
scf.reduce
}
"loom.spatial_yield"()
<{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
}) {graph_name = "g_t1_0", source_maps = []} :
(index, memref<8xindex>, memref<4x4xindex>) -> ()
dataflow.thread.yield
}