Back to PBT run

input.generic.mlir

"builtin.module"() ({
  "dataflow.graph"() <{function_type = (i32, memref<?xi32>, memref<?xi32>) -> (), input_segments = array<i32: 1, 0, 2>, result_segments = array<i32: 0, 0, 0>, sym_name = "while_case0", sym_visibility = "private"}> ({
  ^bb0(%arg8: none, %arg9: i32, %arg10: memref<?xi32>, %arg11: memref<?xi32>):
    %12 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %13 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %14 = "arith.constant"() <{value = 3 : i32}> : () -> i32
    %15:2 = "scf.while"(%12, %12) ({
    ^bb0(%arg14: i32, %arg15: i32):
      %19 = "arith.index_cast"(%arg14) : (i32) -> index
      %20 = "memref.load"(%arg10, %19) : (memref<?xi32>, index) -> i32
      %21 = "arith.addi"(%arg14, %13) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
      %22 = "arith.index_cast"(%21) : (i32) -> index
      %23 = "memref.load"(%arg10, %22) : (memref<?xi32>, index) -> i32
      %24 = "arith.addi"(%20, %23) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
      %25 = "arith.addi"(%arg15, %24) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
      "memref.store"(%25, %arg11, %19) : (i32, memref<?xi32>, index) -> ()
      %26 = "arith.cmpi"(%21, %arg9) <{predicate = 2 : i64}> : (i32, i32) -> i1
      "scf.condition"(%26, %21, %25) : (i1, i32, i32) -> ()
    }, {
    ^bb0(%arg12: i32, %arg13: i32):
      %18 = "arith.index_cast"(%arg12) : (i32) -> index
      "memref.store"(%arg13, %arg11, %18) : (i32, memref<?xi32>, index) -> ()
      "scf.yield"(%arg12, %arg13) : (i32, i32) -> ()
    }) : (i32, i32) -> (i32, i32)
    %16 = "arith.index_cast"(%12) : (i32) -> index
    "memref.store"(%15#0, %arg11, %16) : (i32, memref<?xi32>, index) -> ()
    %17 = "arith.index_cast"(%13) : (i32) -> index
    "memref.store"(%15#1, %arg11, %17) : (i32, memref<?xi32>, index) -> ()
    "dataflow.graph.return"(%arg8) <{operandSegmentSizes = array<i32: 0, 0, 0, 1>}> : (none) -> ()
  }) : () -> ()
  "dataflow.graph"() <{function_type = (i32, memref<?xi32>, memref<?xi32>) -> (), input_segments = array<i32: 1, 0, 2>, result_segments = array<i32: 0, 0, 0>, sym_name = "while_case1", sym_visibility = "private"}> ({
  ^bb0(%arg0: none, %arg1: i32, %arg2: memref<?xi32>, %arg3: memref<?xi32>):
    %0 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %1 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %2 = "arith.constant"() <{value = 6 : i32}> : () -> i32
    %3:2 = "scf.while"(%0, %0) ({
    ^bb0(%arg6: i32, %arg7: i32):
      %7 = "arith.index_cast"(%arg6) : (i32) -> index
      %8 = "memref.load"(%arg2, %7) : (memref<?xi32>, index) -> i32
      %9 = "arith.addi"(%arg6, %1) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
      %10 = "arith.addi"(%arg7, %8) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
      %11 = "arith.cmpi"(%9, %2) <{predicate = 2 : i64}> : (i32, i32) -> i1
      "scf.condition"(%11, %9, %10) : (i1, i32, i32) -> ()
    }, {
    ^bb0(%arg4: i32, %arg5: i32):
      %6 = "arith.index_cast"(%arg4) : (i32) -> index
      "memref.store"(%arg5, %arg3, %6) : (i32, memref<?xi32>, index) -> ()
      "scf.yield"(%arg4, %arg5) : (i32, i32) -> ()
    }) : (i32, i32) -> (i32, i32)
    %4 = "arith.index_cast"(%0) : (i32) -> index
    "memref.store"(%3#0, %arg3, %4) : (i32, memref<?xi32>, index) -> ()
    %5 = "arith.index_cast"(%1) : (i32) -> index
    "memref.store"(%3#1, %arg3, %5) : (i32, memref<?xi32>, index) -> ()
    "dataflow.graph.return"(%arg0) <{operandSegmentSizes = array<i32: 0, 0, 0, 1>}> : (none) -> ()
  }) : () -> ()
}) : () -> ()