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
      scf.for %iv0 = %zero to %two step %one {
      scf.if %flag {
      %ld2 = memref.load %target[%zero] : memref<?xindex>
      %ad2 = arith.addi %ld2, %one : index
      memref.store %ad2, %target[%zero] : memref<?xindex>
      } else {
      %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>
      }
      %wr5 = scf.while (%wa5 = %zero) : (index) -> index {
        %wc5 = arith.cmpi ult, %wa5, %two : index
        scf.condition(%wc5) %wa5 : index
      } do {
      ^bb0(%wb5: index):
      memref.store %one, %target[%zero] : memref<?xindex>
      %ld7 = memref.load %target[%zero] : memref<?xindex>
      %ad7 = arith.addi %ld7, %one : index
      memref.store %ad7, %target[%zero] : memref<?xindex>
        %wn5 = arith.addi %wb5, %one : index
        scf.yield %wn5 : index
      }
      }
      %wr8 = scf.while (%wa8 = %zero) : (index) -> index {
        %wc8 = arith.cmpi ult, %wa8, %two : index
        scf.condition(%wc8) %wa8 : index
      } do {
      ^bb0(%wb8: index):
      %wr9 = scf.while (%wa9 = %zero) : (index) -> index {
        %wc9 = arith.cmpi ult, %wa9, %two : index
        scf.condition(%wc9) %wa9 : index
      } do {
      ^bb0(%wb9: index):
      memref.store %one, %target[%zero] : memref<?xindex>
      %ld11 = memref.load %target[%zero] : memref<?xindex>
      %ad11 = arith.addi %ld11, %one : index
      memref.store %ad11, %target[%zero] : memref<?xindex>
        %wn9 = arith.addi %wb9, %one : index
        scf.yield %wn9 : index
      }
        %wn8 = arith.addi %wb8, %one : index
        scf.yield %wn8 : 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
      %wr12 = scf.while (%wa12 = %zero) : (index) -> index {
        %wc12 = arith.cmpi ult, %wa12, %two : index
        scf.condition(%wc12) %wa12 : index
      } do {
      ^bb0(%wb12: index):
      scf.for %iv13 = %zero to %two step %one {
      memref.store %one, %target[%zero] : memref<?xindex>
      }
        %wn12 = arith.addi %wb12, %one : index
        scf.yield %wn12 : index
      }
      %wr15 = scf.while (%wa15 = %zero) : (index) -> index {
        %wc15 = arith.cmpi ult, %wa15, %two : index
        scf.condition(%wc15) %wa15 : index
      } do {
      ^bb0(%wb15: index):
      scf.for %iv16 = %zero to %two step %one {
      memref.store %one, %target[%zero] : memref<?xindex>
      }
      %ld18 = memref.load %target[%zero] : memref<?xindex>
      %ad18 = arith.addi %ld18, %one : index
      memref.store %ad18, %target[%zero] : memref<?xindex>
        %wn15 = arith.addi %wb15, %one : index
        scf.yield %wn15 : index
      }
      "loom.spatial_yield"()
          <{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
  }) {graph_name = "g_thread_1", source_maps = []} :
      (index, memref<?xindex>) -> ()
  dataflow.thread.yield
}