Back to PBT run
input.mlir
llvm.func @imported_callable(i64) -> i64
func.func private @native_callable(%arg_a: i32) -> i32 {
return %arg_a : i32
}
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
memref.store %one, %target[%zero] : memref<?xindex>
%ld1 = memref.load %target[%zero] : memref<?xindex>
%ad1 = arith.addi %ld1, %one : index
memref.store %ad1, %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
scf.parallel (%iv2) = (%zero) to (%two) step (%one) {
%mx2 = arith.muli %zero, %two : index
%ix2 = arith.addi %mx2, %iv2 : index
%wr3 = scf.while (%wa3 = %zero) : (index) -> index {
%wc3 = arith.cmpi ult, %wa3, %two : index
scf.condition(%wc3) %wa3 : index
} do {
^bb0(%wb3: index):
memref.store %one, %target[%ix2] : memref<?xindex>
%wn3 = arith.addi %wb3, %one : index
scf.yield %wn3 : index
}
scf.reduce
}
%wr5 = scf.while (%wa5 = %zero) : (index) -> index {
%wc5 = arith.cmpi ult, %wa5, %two : index
scf.condition(%wc5) %wa5 : index
} do {
^bb0(%wb5: index):
%wr6 = scf.while (%wa6 = %zero) : (index) -> index {
%wc6 = arith.cmpi ult, %wa6, %two : index
scf.condition(%wc6) %wa6 : index
} do {
^bb0(%wb6: index):
%ld7 = memref.load %target[%zero] : memref<?xindex>
%ad7 = arith.addi %ld7, %one : index
memref.store %ad7, %target[%zero] : memref<?xindex>
%wn6 = arith.addi %wb6, %one : index
scf.yield %wn6 : index
}
%wn5 = arith.addi %wb5, %one : index
scf.yield %wn5 : index
}
"loom.spatial_yield"()
<{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
}) {graph_name = "g_thread_1", source_maps = []} :
(index, memref<?xindex>) -> ()
dataflow.thread.yield
}