Back to PBT run
input.mlir
module {
dataflow.thread private @thread_0 domain(#dataflow.thread_domain<dense>)(%value: i32, %mem: memref<4xi32>, %chan: !dataflow.channel<i32>, %flag: i1) ctrl (%start: none) {
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%c4 = arith.constant 4 : index
scf.for %i = %c0 to %c4 step %c1 {
scf.if %flag {
"loom.spatial_region"(%value, %mem)
<{operandSegmentSizes = array<i32: 1, 0, 1, 0>,
resultSegmentSizes = array<i32: 0, 0>}> ({
^bb0(%payload: i32, %memory: memref<4xi32>):
%zero = arith.constant 0 : index
memref.store %payload, %memory[%zero] : memref<4xi32>
"loom.spatial_yield"()
<{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
}) {graph_name = "graph_0", source_maps = []} :
(i32, memref<4xi32>) -> ()
}
}
dataflow.thread.yield
}
dataflow.thread private @thread_1 domain(#dataflow.thread_domain<dense>)(%value: i32, %mem: memref<4xi32>, %chan: !dataflow.channel<i32>, %flag: i1) ctrl (%start: none) {
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%c4 = arith.constant 4 : index
"loom.spatial_region"(%chan, %mem)
<{operandSegmentSizes = array<i32: 0, 1, 1, 0>,
resultSegmentSizes = array<i32: 0, 0>}> ({
^bb0(%channel: !dataflow.channel<i32>, %target: memref<4xi32>):
%message = dataflow.channel.receive %channel : !dataflow.channel<i32>
%zero = arith.constant 0 : index
memref.store %message, %target[%zero] : memref<4xi32>
"loom.spatial_yield"()
<{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
}) {graph_name = "graph_1", source_maps = [affine_map<() -> ()>]} :
(!dataflow.channel<i32>, memref<4xi32>) -> ()
dataflow.thread.yield
}
dataflow.thread private @thread_2 domain(#dataflow.thread_domain<dense>)(%value: i32, %mem: memref<4xi32>, %chan: !dataflow.channel<i32>, %flag: i1) ctrl (%start: none) {
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%c4 = arith.constant 4 : index
scf.for %i = %c0 to %c4 step %c1 {
"loom.spatial_region"()
<{operandSegmentSizes = array<i32: 0, 0, 0, 0>,
resultSegmentSizes = array<i32: 0, 0>}> ({
^bb0:
"loom.spatial_yield"()
<{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
}) {graph_name = "graph_2", source_maps = []} : () -> ()
}
dataflow.thread.yield
}
}