Back to PBT run
input.mlir
dataflow.graph private @wo_0(%start: none, %lb: i64, %ub: i64, %step: i64, %value: i32,
%a: memref<?xi32>) -> ()
attributes {input_segments = array<i32: 4, 0, 1>,
result_segments = array<i32: 0, 0, 0>} {
scf.for %i = %lb to %ub step %step : i64 {
%idx = arith.index_cast %i : i64 to index
memref.store %value, %a[%idx] : memref<?xi32>
}
dataflow.graph.return %start : none
}
dataflow.graph private @acc_1(%start: none, %lb: i64, %ub: i64, %step: i64, %init: i32,
%a: memref<128xi32>) -> (i32)
attributes {input_segments = array<i32: 4, 0, 1>,
result_segments = array<i32: 1, 0, 0>} {
%total = scf.for %i = %lb to %ub step %step
iter_args(%state = %init) -> (i32) : i64 {
%scaled = arith.muli %i, %step : i64
%idx = arith.index_cast %scaled : i64 to index
%aloaded = memref.load %a[%idx] : memref<128xi32>
%asum = arith.addi %state, %aloaded : i32
memref.store %asum, %a[%idx] : memref<128xi32>
scf.yield %asum : i32
}
dataflow.graph.return %start, %total : none, i32
}
dataflow.graph private @guard_2(%start: none, %lb: i64, %ub: i64, %step: i64, %limit: i64,
%value: i32, %a: memref<?xi32>) -> ()
attributes {input_segments = array<i32: 5, 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
%gcond = arith.cmpi slt, %i, %limit : i64
scf.if %gcond {
memref.store %value, %a[%idx] : memref<?xi32>
}
}
dataflow.graph.return %start : none
}