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
scf.forall (%iv0) in (2) {
%mx0 = arith.muli %zero, %two : index
%ix0 = arith.addi %mx0, %iv0 : index
scf.for %iv1 = %zero to %two step %one {
%ld2 = memref.load %target[%ix0] : memref<?xindex>
%ad2 = arith.addi %ld2, %one : index
memref.store %ad2, %target[%ix0] : memref<?xindex>
}
memref.store %one, %target[%ix0] : 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
%wr4 = scf.while (%wa4 = %zero) : (index) -> index {
%wc4 = arith.cmpi ult, %wa4, %two : index
scf.condition(%wc4) %wa4 : index
} do {
^bb0(%wb4: index):
scf.for %iv5 = %zero to %two step %one {
%ld6 = memref.load %target[%zero] : memref<?xindex>
%ad6 = arith.addi %ld6, %one : index
memref.store %ad6, %target[%zero] : memref<?xindex>
%ld7 = memref.load %target[%zero] : memref<?xindex>
%ad7 = arith.addi %ld7, %one : index
memref.store %ad7, %target[%zero] : memref<?xindex>
}
memref.store %one, %target[%zero] : memref<?xindex>
%wn4 = arith.addi %wb4, %one : index
scf.yield %wn4 : index
}
scf.parallel (%iv9) = (%zero) to (%two) step (%one) {
%mx9 = arith.muli %zero, %two : index
%ix9 = arith.addi %mx9, %iv9 : index
%ld10 = memref.load %target[%ix9] : memref<?xindex>
%ad10 = arith.addi %ld10, %one : index
memref.store %ad10, %target[%ix9] : memref<?xindex>
%ld11 = memref.load %target[%ix9] : memref<?xindex>
%ad11 = arith.addi %ld11, %one : index
memref.store %ad11, %target[%ix9] : memref<?xindex>
scf.reduce
}
"loom.spatial_yield"()
<{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
}) {graph_name = "g_thread_1", source_maps = []} :
(index, memref<?xindex>) -> ()
dataflow.thread.yield
}