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
scf.if %flag {
scf.for %iv1 = %zero to %two step %one {
memref.store %one, %target[%zero] : memref<?xindex>
%ld3 = memref.load %target[%zero] : memref<?xindex>
%ad3 = arith.addi %ld3, %one : index
memref.store %ad3, %target[%zero] : memref<?xindex>
}
memref.store %one, %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.forall (%iv5) in (2) {
%mx5 = arith.muli %zero, %two : index
%ix5 = arith.addi %mx5, %iv5 : index
memref.store %one, %target[%ix5] : memref<?xindex>
%ld7 = memref.load %target[%ix5] : memref<?xindex>
%ad7 = arith.addi %ld7, %one : index
memref.store %ad7, %target[%ix5] : memref<?xindex>
}
scf.if %flag {
%ld9 = memref.load %target[%zero] : memref<?xindex>
%ad9 = arith.addi %ld9, %one : index
memref.store %ad9, %target[%zero] : memref<?xindex>
} else {
%ld10 = memref.load %target[%zero] : memref<?xindex>
%ad10 = arith.addi %ld10, %one : index
memref.store %ad10, %target[%zero] : memref<?xindex>
%ld11 = memref.load %target[%zero] : memref<?xindex>
%ad11 = arith.addi %ld11, %one : index
memref.store %ad11, %target[%zero] : memref<?xindex>
}
"loom.spatial_yield"()
<{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
}) {graph_name = "g_thread_1", source_maps = []} :
(index, memref<?xindex>) -> ()
dataflow.thread.yield
}