Back to PBT run

input.mlir

dataflow.graph private @wo_0(%start: none, %lb: i64, %ub: i64, %step: i64, %value: i32,
    %a: memref<64xi32>) -> ()
    attributes {input_segments = array<i32: 4, 0, 1>,
                result_segments = array<i32: 0, 0, 0>} {
  scf.for %i = %lb to %ub step %step : i64 {
    %scaled = arith.muli %i, %step : i64
    %idx = arith.index_cast %scaled : i64 to index
    memref.store %value, %a[%idx] : memref<64xi32>
  }
  dataflow.graph.return %start : none
}

dataflow.graph private @nest_1(%start: none, %lb: i64, %ub: i64, %step: i64, %value: i32,
    %a: memref<256xi32>) -> ()
    attributes {input_segments = array<i32: 4, 0, 1>,
                result_segments = array<i32: 0, 0, 0>} {
  scf.for %outer = %lb to %ub step %step : i64 {
    scf.for %i = %lb to %outer step %step : i64 {
      %inner_idx = arith.index_cast %i : i64 to index
      %nloaded = memref.load %a[%inner_idx] : memref<256xi32>
      %nnext = arith.addi %nloaded, %value : i32
      memref.store %nnext, %a[%inner_idx] : memref<256xi32>
    }
  }
  dataflow.graph.return %start : none
}

dataflow.graph private @rw_2(%start: none, %lb: i64, %ub: i64, %step: i64, %value: i32,
    %a: memref<32xi32>) -> ()
    attributes {input_segments = array<i32: 4, 0, 1>,
                result_segments = array<i32: 0, 0, 0>} {
  scf.for %i = %lb to %ub step %step : i64 {
    %scaled = arith.muli %i, %step : i64
    %idx = arith.index_cast %scaled : i64 to index
    %bloaded = memref.load %a[%idx] : memref<32xi32>
    %bnext = arith.muli %bloaded, %value : i32
    memref.store %bnext, %a[%idx] : memref<32xi32>
  }
  dataflow.graph.return %start : none
}