Back to PBT run
input.mlir
dataflow.thread private @thread_0 domain(#dataflow.thread_domain<dense>)(
%limit: index, %memory: memref<?xindex>) ctrl (%ctrl: none) {
"loom.spatial_region"(%limit, %memory)
<{operandSegmentSizes = array<i32: 1, 0, 1, 0>,
resultSegmentSizes = array<i32: 0, 0>}> ({
^bb0(%lim: index, %target: memref<?xindex>):
%zero = arith.constant 0 : index
%one = arith.constant 1 : index
%two = arith.constant 2 : index
%flag = arith.cmpi ult, %zero, %two : index
%ld0 = memref.load %target[%zero] : memref<?xindex>
%ad0 = arith.addi %ld0, %one : index
memref.store %ad0, %target[%zero] : memref<?xindex>
"loom.spatial_yield"()
<{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
}) {graph_name = "g_thread_0", source_maps = []} :
(index, memref<?xindex>) -> ()
dataflow.thread.yield
}
dataflow.thread private @thread_1 domain(#dataflow.thread_domain<dense>)(
%limit: index, %memory: memref<?xindex>) ctrl (%ctrl: none) {
"loom.spatial_region"(%limit, %memory)
<{operandSegmentSizes = array<i32: 1, 0, 1, 0>,
resultSegmentSizes = array<i32: 0, 0>}> ({
^bb0(%lim: index, %target: memref<?xindex>):
%zero = arith.constant 0 : index
%one = arith.constant 1 : index
%two = arith.constant 2 : index
%flag = arith.cmpi ult, %zero, %two : index
%wr1 = scf.while (%wa1 = %zero) : (index) -> index {
%wc1 = arith.cmpi ult, %wa1, %two : index
scf.condition(%wc1) %wa1 : index
} do {
^bb0(%wb1: index):
scf.forall (%iv2) in (2) {
%mx2 = arith.muli %zero, %two : index
%ix2 = arith.addi %mx2, %iv2 : index
%ld3 = memref.load %target[%ix2] : memref<?xindex>
%ad3 = arith.addi %ld3, %one : index
memref.store %ad3, %target[%ix2] : memref<?xindex>
}
%ld4 = memref.load %target[%zero] : memref<?xindex>
%ad4 = arith.addi %ld4, %one : index
memref.store %ad4, %target[%zero] : memref<?xindex>
%wn1 = arith.addi %wb1, %one : index
scf.yield %wn1 : index
}
"loom.spatial_yield"()
<{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
}) {graph_name = "g_thread_1", source_maps = []} :
(index, memref<?xindex>) -> ()
dataflow.thread.yield
}