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 {
      memref.store %one, %target[%zero] : memref<?xindex>
      scf.if %flag {
      %ld3 = memref.load %target[%zero] : memref<?xindex>
      %ad3 = arith.addi %ld3, %one : index
      memref.store %ad3, %target[%zero] : memref<?xindex>
      } else {
      memref.store %one, %target[%zero] : memref<?xindex>
      }
      }
      scf.if %flag {
      %ld6 = memref.load %target[%zero] : memref<?xindex>
      %ad6 = arith.addi %ld6, %one : index
      memref.store %ad6, %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.for %iv7 = %zero to %two step %one {
      memref.store %one, %target[%zero] : memref<?xindex>
      memref.store %one, %target[%zero] : memref<?xindex>
      }
      %wr10 = scf.while (%wa10 = %zero) : (index) -> index {
        %wc10 = arith.cmpi ult, %wa10, %two : index
        scf.condition(%wc10) %wa10 : index
      } do {
      ^bb0(%wb10: index):
      %wr11 = scf.while (%wa11 = %zero) : (index) -> index {
        %wc11 = arith.cmpi ult, %wa11, %two : index
        scf.condition(%wc11) %wa11 : index
      } do {
      ^bb0(%wb11: index):
      %ld12 = memref.load %target[%zero] : memref<?xindex>
      %ad12 = arith.addi %ld12, %one : index
      memref.store %ad12, %target[%zero] : memref<?xindex>
        %wn11 = arith.addi %wb11, %one : index
        scf.yield %wn11 : index
      }
        %wn10 = arith.addi %wb10, %one : index
        scf.yield %wn10 : index
      }
      "loom.spatial_yield"()
          <{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
  }) {graph_name = "g_thread_1", source_maps = []} :
      (index, memref<?xindex>) -> ()
  dataflow.thread.yield
}