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
      %wr0 = scf.while (%wa0 = %zero) : (index) -> index {
        %wc0 = arith.cmpi ult, %wa0, %two : index
        scf.condition(%wc0) %wa0 : index
      } do {
      ^bb0(%wb0: index):
      scf.parallel (%iv1) = (%zero) to (%two) step (%one) {
        %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>
        scf.reduce
      }
      scf.for %iv3 = %zero to %two step %one {
      memref.store %one, %target[%zero] : memref<?xindex>
      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
      %wr6 = scf.while (%wa6 = %zero) : (index) -> index {
        %wc6 = arith.cmpi ult, %wa6, %two : index
        scf.condition(%wc6) %wa6 : index
      } do {
      ^bb0(%wb6: index):
      scf.forall (%iv7) in (2) {
        %mx7 = arith.muli %zero, %two : index
        %ix7 = arith.addi %mx7, %iv7 : index
      %ld8 = memref.load %target[%ix7] : memref<?xindex>
      %ad8 = arith.addi %ld8, %one : index
      memref.store %ad8, %target[%ix7] : memref<?xindex>
      }
      %ld9 = memref.load %target[%zero] : memref<?xindex>
      %ad9 = arith.addi %ld9, %one : index
      memref.store %ad9, %target[%zero] : memref<?xindex>
        %wn6 = arith.addi %wb6, %one : index
        scf.yield %wn6 : index
      }
      scf.parallel (%iv10) = (%zero) to (%two) step (%one) {
        %mx10 = arith.muli %zero, %two : index
        %ix10 = arith.addi %mx10, %iv10 : index
      %ld11 = memref.load %target[%ix10] : memref<?xindex>
      %ad11 = arith.addi %ld11, %one : index
      memref.store %ad11, %target[%ix10] : memref<?xindex>
      %ld12 = memref.load %target[%ix10] : memref<?xindex>
      %ad12 = arith.addi %ld12, %one : index
      memref.store %ad12, %target[%ix10] : 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
}