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.if %flag {
      %wr1 = scf.while (%wa1 = %zero) : (index) -> index {
        %wc1 = arith.cmpi ult, %wa1, %two : index
        scf.condition(%wc1) %wa1 : index
      } do {
      ^bb0(%wb1: index):
      memref.store %one, %target[%zero] : memref<?xindex>
        %wn1 = arith.addi %wb1, %one : index
        scf.yield %wn1 : index
      }
      scf.for %iv3 = %zero to %two step %one {
      memref.store %one, %target[%zero] : memref<?xindex>
      }
      } else {
      %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>
        %wn5 = arith.addi %wb5, %one : index
        scf.yield %wn5 : index
      }
      %wr7 = scf.while (%wa7 = %zero) : (index) -> index {
        %wc7 = arith.cmpi ult, %wa7, %two : index
        scf.condition(%wc7) %wa7 : index
      } do {
      ^bb0(%wb7: index):
      memref.store %one, %target[%zero] : memref<?xindex>
        %wn7 = arith.addi %wb7, %one : index
        scf.yield %wn7 : index
      }
      }
      scf.parallel (%iv9) = (%zero) to (%two) step (%one) {
        %mx9 = arith.muli %zero, %two : index
        %ix9 = arith.addi %mx9, %iv9 : index
      %ld10 = memref.load %target[%ix9] : memref<?xindex>
      %ad10 = arith.addi %ld10, %one : index
      memref.store %ad10, %target[%ix9] : memref<?xindex>
      %ld11 = memref.load %target[%ix9] : memref<?xindex>
      %ad11 = arith.addi %ld11, %one : index
      memref.store %ad11, %target[%ix9] : memref<?xindex>
        scf.reduce
      }
      "loom.spatial_yield"()
          <{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
  }) {graph_name = "g_thread_0", source_maps = []} :
      (index, memref<?xindex>) -> ()
  dataflow.thread.yield
}