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.parallel (%iv0) = (%zero) to (%two) step (%one) {
        %mx0 = arith.muli %zero, %two : index
        %ix0 = arith.addi %mx0, %iv0 : index
      %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[%ix0] : memref<?xindex>
      memref.store %one, %target[%ix0] : memref<?xindex>
        %wn1 = arith.addi %wb1, %one : index
        scf.yield %wn1 : index
      }
      %ld4 = memref.load %target[%ix0] : memref<?xindex>
      %ad4 = arith.addi %ld4, %one : index
      memref.store %ad4, %target[%ix0] : memref<?xindex>
        scf.reduce
      }
      scf.forall (%iv5) in (2) {
        %mx5 = arith.muli %zero, %two : index
        %ix5 = arith.addi %mx5, %iv5 : index
      %ld6 = memref.load %target[%ix5] : memref<?xindex>
      %ad6 = arith.addi %ld6, %one : index
      memref.store %ad6, %target[%ix5] : 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.if %flag {
      %ld8 = memref.load %target[%zero] : memref<?xindex>
      %ad8 = arith.addi %ld8, %one : index
      memref.store %ad8, %target[%zero] : memref<?xindex>
      %ld9 = memref.load %target[%zero] : memref<?xindex>
      %ad9 = arith.addi %ld9, %one : index
      memref.store %ad9, %target[%zero] : memref<?xindex>
      }
      scf.forall (%iv10) in (2) {
        %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>
      }
      "loom.spatial_yield"()
          <{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
  }) {graph_name = "g_thread_1", source_maps = []} :
      (index, memref<?xindex>) -> ()
  dataflow.thread.yield
}