Back to PBT run

output.generic.mlir

"builtin.module"() ({
  "func.func"() <{function_type = (i32) -> i32, sym_name = "helper_double"}> ({
  ^bb0(%arg20: i32):
    %37 = "arith.addi"(%arg20, %arg20) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    "func.return"(%37) : (i32) -> ()
  }) : () -> ()
  "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<i32 (i32)>, linkage = #llvm.linkage<external>, sym_name = "extern_scale", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
  }) : () -> ()
  "func.func"() <{function_type = (memref<4xi32>, i32) -> (), sym_name = "host_container"}> ({
  ^bb0(%arg17: memref<4xi32>, %arg18: i32):
    %34 = "arith.constant"() <{value = 0 : index}> : () -> index
    %35 = "arith.constant"() <{value = 4 : index}> : () -> index
    %36 = "arith.constant"() <{value = 1 : index}> : () -> index
    "scf.for"(%34, %35, %36) ({
    ^bb0(%arg19: index):
      "memref.store"(%arg18, %arg17, %arg19) : (i32, memref<4xi32>, index) -> ()
      "scf.yield"() : () -> ()
    }) : (index, index, index) -> ()
    "func.return"() : () -> ()
  }) : () -> ()
  "dataflow.thread"() <{domain = #dataflow.thread_domain<dense>, function_type = (memref<4xi32>, i32, i1) -> (), sym_name = "thread_0", sym_visibility = "private"}> ({
  ^bb0(%arg11: memref<4xi32>, %arg12: i32, %arg13: i1, %arg14: none):
    %28 = "arith.constant"() <{value = 0 : index}> : () -> index
    %29 = "arith.constant"() <{value = 2 : index}> : () -> index
    %30 = "arith.constant"() <{value = 1 : index}> : () -> index
    %31:2 = "dataflow.graph.launch"(%arg14, %arg12) <{callee = @graph_0, operandSegmentSizes = array<i32: 1, 1, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32) -> (i32, none)
    %32 = "scf.for"(%28, %29, %30, %arg14) ({
    ^bb0(%arg15: index, %arg16: none):
      %33 = "dataflow.graph.launch"(%arg16, %arg12, %arg11) <{callee = @graph_1, operandSegmentSizes = array<i32: 1, 1, 0, 1, 0>, resultSegmentSizes = array<i32: 0, 0, 1>, source_maps = []}> : (none, i32, memref<4xi32>) -> none
      "scf.yield"(%33) : (none) -> ()
    }) : (index, index, index, none) -> none
    "dataflow.thread.yield"(%31#1, %32) : (none, none) -> ()
  }) : () -> ()
  "dataflow.thread"() <{domain = #dataflow.thread_domain<dense>, function_type = (memref<4xi32>, i32, i1) -> (), sym_name = "thread_1", sym_visibility = "private"}> ({
  ^bb0(%arg7: memref<4xi32>, %arg8: i32, %arg9: i1, %arg10: none):
    %24 = "arith.constant"() <{value = 0 : index}> : () -> index
    %25 = "arith.constant"() <{value = 2 : index}> : () -> index
    %26 = "arith.constant"() <{value = 1 : index}> : () -> index
    %27:2 = "dataflow.graph.launch"(%arg10, %arg8) <{callee = @graph_2, operandSegmentSizes = array<i32: 1, 1, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32) -> (i32, none)
    "dataflow.thread.yield"(%27#1) : (none) -> ()
  }) : () -> ()
  "dataflow.graph"() <{function_type = (i32) -> i32, input_segments = array<i32: 1, 0, 0>, result_segments = array<i32: 1, 0, 0>, sym_name = "graph_0", sym_visibility = "private"}> ({
  ^bb0(%arg5: none, %arg6: i32):
    %4 = "dataflow.constant"(%arg5) <{const_value = 0 : index}> : (none) -> index
    %5 = "dataflow.constant"(%arg5) <{const_value = 2 : index}> : (none) -> index
    %6 = "dataflow.constant"(%arg5) <{const_value = 1 : index}> : (none) -> index
    %7 = "arith.index_cast"(%4) : (index) -> i32
    %8 = "arith.index_cast"(%5) : (index) -> i32
    %9 = "arith.index_cast"(%6) : (index) -> i32
    %10:2 = "dataflow.stream"(%7, %8, %9) <{predicate = 2 : i64, step_kind = 0 : i32}> : (i32, i32, i32) -> (i32, i1)
    %11 = "dataflow.carry"(%10#1, %arg5, %12#1) : (i1, none, none) -> none
    %12:2 = "dataflow.demux"(%10#1, %11) : (i1, none) -> (none, none)
    %13 = "dataflow.carry"(%10#1, %arg6, %18) : (i1, i32, i32) -> i32
    %14:2 = "dataflow.demux"(%10#1, %13) : (i1, i32) -> (i32, i32)
    %15 = "dataflow.invariant"(%10#1, %arg6) : (i1, i32) -> i32
    %16:2 = "dataflow.gate"(%10#1, %15) : (i1, i32) -> (i1, i32)
    %17:2 = "dataflow.demux"(%16#0, %16#1) : (i1, i32) -> (i32, i32)
    %18 = "arith.addi"(%14#1, %16#1) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    %19 = "arith.cmpi"(%7, %8) <{predicate = 2 : i64}> : (i32, i32) -> i1
    %20:2 = "dataflow.demux"(%19, %12#0) : (i1, none) -> (none, none)
    %21:2 = "dataflow.sync"(%20#1, %17#0) : (none, i32) -> (none, i32)
    %22 = "dataflow.mux"(%19, %20#0, %21#0) : (i1, none, none) -> none
    %23:2 = "dataflow.sync"(%22, %14#0) : (none, i32) -> (none, i32)
    "dataflow.graph.return"(%23#1, %23#0) <{operandSegmentSizes = array<i32: 1, 0, 0, 1>}> : (i32, none) -> ()
  }) : () -> ()
  "dataflow.graph"() <{arg_attrs = [{}, {llvm.noalias}], function_type = (i32, memref<4xi32>) -> (), input_segments = array<i32: 1, 0, 1>, result_segments = array<i32: 0, 0, 0>, sym_name = "graph_1", sym_visibility = "private"}> ({
  ^bb0(%arg2: none, %arg3: i32, %arg4: memref<4xi32>):
    %2 = "dataflow.constant"(%arg2) <{const_value = 0 : index}> : (none) -> index
    %3 = "dataflow.store"(%arg4, %2, %arg3, %arg2) : (memref<4xi32>, index, i32, none) -> none
    "dataflow.graph.return"(%3) <{operandSegmentSizes = array<i32: 0, 0, 0, 1>}> : (none) -> ()
  }) : () -> ()
  "dataflow.graph"() <{function_type = (i32) -> i32, input_segments = array<i32: 1, 0, 0>, result_segments = array<i32: 1, 0, 0>, sym_name = "graph_2", sym_visibility = "private"}> ({
  ^bb0(%arg0: none, %arg1: i32):
    %0 = "llvm.freeze"(%arg1) : (i32) -> i32
    %1:2 = "dataflow.sync"(%arg0, %0) : (none, i32) -> (none, i32)
    "dataflow.graph.return"(%1#1, %1#0) <{operandSegmentSizes = array<i32: 1, 0, 0, 1>}> : (i32, none) -> ()
  }) : () -> ()
}) : () -> ()