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.forall (%iv1) in (2) {
        %mx1 = arith.muli %zero, %two : index
        %ix1 = arith.addi %mx1, %iv1 : index
      %ld2 = memref.load %target[%ix1] : memref<?xindex>
      %ad2 = arith.addi %ld2, %one : index
      memref.store %ad2, %target[%ix1] : memref<?xindex>
      }
      } else {
      scf.forall (%iv3) in (2) {
        %mx3 = arith.muli %zero, %two : index
        %ix3 = arith.addi %mx3, %iv3 : index
      %ld4 = memref.load %target[%ix3] : memref<?xindex>
      %ad4 = arith.addi %ld4, %one : index
      memref.store %ad4, %target[%ix3] : memref<?xindex>
      }
      %ld5 = memref.load %target[%zero] : memref<?xindex>
      %ad5 = arith.addi %ld5, %one : index
      memref.store %ad5, %target[%zero] : memref<?xindex>
      }
      scf.forall (%iv6) in (2) {
        %mx6 = arith.muli %zero, %two : index
        %ix6 = arith.addi %mx6, %iv6 : index
      scf.for %iv7 = %zero to %two step %one {
      memref.store %one, %target[%ix6] : memref<?xindex>
      }
      %ld9 = memref.load %target[%ix6] : memref<?xindex>
      %ad9 = arith.addi %ld9, %one : index
      memref.store %ad9, %target[%ix6] : memref<?xindex>
      }
      "loom.spatial_yield"()
          <{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
  }) {graph_name = "g_thread_0", source_maps = []} :
      (index, memref<?xindex>) -> ()
  dataflow.thread.yield
}