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
%wr0 = scf.while (%wa0 = %zero) : (index) -> index {
%wc0 = arith.cmpi ult, %wa0, %two : index
scf.condition(%wc0) %wa0 : index
} do {
^bb0(%wb0: index):
memref.store %one, %target[%zero] : memref<?xindex>
%wn0 = arith.addi %wb0, %one : index
scf.yield %wn0 : 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.forall (%iv2) in (2) {
%mx2 = arith.muli %zero, %two : index
%ix2 = arith.addi %mx2, %iv2 : index
memref.store %one, %target[%ix2] : memref<?xindex>
}
scf.parallel (%iv4) = (%zero) to (%two) step (%one) {
%mx4 = arith.muli %zero, %two : index
%ix4 = arith.addi %mx4, %iv4 : index
%ld5 = memref.load %target[%ix4] : memref<?xindex>
%ad5 = arith.addi %ld5, %one : index
memref.store %ad5, %target[%ix4] : 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
}