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.if %flag {
memref.store %one, %target[%zero] : memref<?xindex>
memref.store %one, %target[%zero] : memref<?xindex>
} else {
%ld3 = memref.load %target[%zero] : memref<?xindex>
%ad3 = arith.addi %ld3, %one : index
memref.store %ad3, %target[%zero] : memref<?xindex>
}
%wr4 = scf.while (%wa4 = %zero) : (index) -> index {
%wc4 = arith.cmpi ult, %wa4, %two : index
scf.condition(%wc4) %wa4 : index
} do {
^bb0(%wb4: index):
memref.store %one, %target[%zero] : memref<?xindex>
%wn4 = arith.addi %wb4, %one : index
scf.yield %wn4 : index
}
"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
scf.parallel (%iv6) = (%zero) to (%two) step (%one) {
%mx6 = arith.muli %zero, %two : index
%ix6 = arith.addi %mx6, %iv6 : index
memref.store %one, %target[%ix6] : memref<?xindex>
memref.store %one, %target[%ix6] : memref<?xindex>
scf.reduce
}
%wr9 = scf.while (%wa9 = %zero) : (index) -> index {
%wc9 = arith.cmpi ult, %wa9, %two : index
scf.condition(%wc9) %wa9 : index
} do {
^bb0(%wb9: index):
scf.for %iv10 = %zero to %two step %one {
%ld11 = memref.load %target[%zero] : memref<?xindex>
%ad11 = arith.addi %ld11, %one : index
memref.store %ad11, %target[%zero] : memref<?xindex>
}
memref.store %one, %target[%zero] : memref<?xindex>
%wn9 = arith.addi %wb9, %one : index
scf.yield %wn9 : index
}
"loom.spatial_yield"()
<{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
}) {graph_name = "g_thread_1", source_maps = []} :
(index, memref<?xindex>) -> ()
dataflow.thread.yield
}