Back to PBT run

input.mlir

module {
  dataflow.thread private @thread_0 domain(#dataflow.thread_domain<dense>)(%value: i32, %mem: memref<4xi32>, %chan: !dataflow.channel<i32>, %flag: i1) ctrl (%start: none) {
    %c0 = arith.constant 0 : index
    %c1 = arith.constant 1 : index
    %c4 = arith.constant 4 : index
    scf.for %i = %c0 to %c4 step %c1 {
      scf.if %flag {
      %sum_0 = "loom.spatial_region"(%value)
          <{operandSegmentSizes = array<i32: 1, 0, 0, 0>,
            resultSegmentSizes = array<i32: 1, 0>}> ({
        ^bb0(%payload: i32):
          %doubled = arith.addi %payload, %payload : i32
          "loom.spatial_yield"(%doubled)
              <{operandSegmentSizes = array<i32: 1, 0>}> : (i32) -> ()
      }) {graph_name = "graph_0", source_maps = []} :
          (i32) -> i32
      }
    }
    dataflow.thread.yield
  }
  dataflow.thread private @thread_1 domain(#dataflow.thread_domain<dense>)(%value: i32, %mem: memref<4xi32>, %chan: !dataflow.channel<i32>, %flag: i1) ctrl (%start: none) {
    %c0 = arith.constant 0 : index
    %c1 = arith.constant 1 : index
    %c4 = arith.constant 4 : index
    scf.for %i = %c0 to %c4 step %c1 {
      "loom.spatial_region"()
          <{operandSegmentSizes = array<i32: 0, 0, 0, 0>,
            resultSegmentSizes = array<i32: 0, 0>}> ({
        ^bb0:
          "loom.spatial_yield"()
              <{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
      }) {graph_name = "graph_1", source_maps = []} : () -> ()
    }
    dataflow.thread.yield
  }
  dataflow.thread private @thread_2 domain(#dataflow.thread_domain<dense>)(%value: i32, %mem: memref<4xi32>, %chan: !dataflow.channel<i32>, %flag: i1) ctrl (%start: none) {
    %c0 = arith.constant 0 : index
    %c1 = arith.constant 1 : index
    %c4 = arith.constant 4 : index
    scf.for %i = %c0 to %c4 step %c1 {
      "loom.spatial_region"()
          <{operandSegmentSizes = array<i32: 0, 0, 0, 0>,
            resultSegmentSizes = array<i32: 0, 0>}> ({
        ^bb0:
          "loom.spatial_yield"()
              <{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
      }) {graph_name = "graph_2", source_maps = []} : () -> ()
    }
    dataflow.thread.yield
  }
}