Back to PBT run

output.generic.mlir

"builtin.module"() ({
  "func.func"() <{function_type = (i32) -> i32, sym_name = "helper_double"}> ({
  ^bb0(%arg23: i32):
    %33 = "arith.addi"(%arg23, %arg23) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    "func.return"(%33) : (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(%arg20: memref<4xi32>, %arg21: i32):
    %30 = "arith.constant"() <{value = 0 : index}> : () -> index
    %31 = "arith.constant"() <{value = 4 : index}> : () -> index
    %32 = "arith.constant"() <{value = 1 : index}> : () -> index
    "scf.for"(%30, %31, %32) ({
    ^bb0(%arg22: index):
      "memref.store"(%arg21, %arg20, %arg22) : (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(%arg16: memref<4xi32>, %arg17: i32, %arg18: i1, %arg19: none):
    %25 = "arith.constant"() <{value = 0 : index}> : () -> index
    %26 = "arith.constant"() <{value = 2 : index}> : () -> index
    %27 = "arith.constant"() <{value = 1 : index}> : () -> index
    %28:2 = "dataflow.graph.launch"(%arg19, %arg17, %arg18) <{callee = @graph_0, operandSegmentSizes = array<i32: 1, 2, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32, i1) -> (i32, none)
    %29:2 = "dataflow.graph.launch"(%arg19, %arg17, %arg18) <{callee = @graph_1, operandSegmentSizes = array<i32: 1, 2, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32, i1) -> (i32, none)
    "dataflow.thread.yield"(%28#1, %29#1) : (none, none) -> ()
  }) : () -> ()
  "dataflow.thread"() <{domain = #dataflow.thread_domain<dense>, function_type = (memref<4xi32>, i32, i1) -> (), sym_name = "thread_1", sym_visibility = "private"}> ({
  ^bb0(%arg10: memref<4xi32>, %arg11: i32, %arg12: i1, %arg13: none):
    %19 = "arith.constant"() <{value = 0 : index}> : () -> index
    %20 = "arith.constant"() <{value = 2 : index}> : () -> index
    %21 = "arith.constant"() <{value = 1 : index}> : () -> index
    %22 = "scf.for"(%19, %20, %21, %arg13) ({
    ^bb0(%arg14: index, %arg15: none):
      %24:2 = "dataflow.graph.launch"(%arg15, %arg11) <{callee = @graph_2, operandSegmentSizes = array<i32: 1, 1, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32) -> (i32, none)
      "scf.yield"(%24#1) : (none) -> ()
    }) : (index, index, index, none) -> none
    %23:2 = "dataflow.graph.launch"(%arg13, %arg11) <{callee = @graph_3, operandSegmentSizes = array<i32: 1, 1, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32) -> (i32, none)
    "dataflow.thread.yield"(%22, %23#1) : (none, none) -> ()
  }) : () -> ()
  "dataflow.graph"() <{function_type = (i32, i1) -> i32, input_segments = array<i32: 2, 0, 0>, result_segments = array<i32: 1, 0, 0>, sym_name = "graph_0", sym_visibility = "private"}> ({
  ^bb0(%arg7: none, %arg8: i32, %arg9: i1):
    %12:2 = "dataflow.demux"(%arg9, %arg7) : (i1, none) -> (none, none)
    %13:2 = "dataflow.demux"(%arg9, %arg8) : (i1, i32) -> (i32, i32)
    %14 = "arith.muli"(%13#0, %13#0) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    %15 = "arith.addi"(%13#1, %13#1) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    %16 = "dataflow.mux"(%arg9, %14, %15) : (i1, i32, i32) -> i32
    %17 = "dataflow.mux"(%arg9, %12#0, %12#1) : (i1, none, none) -> none
    %18:2 = "dataflow.sync"(%17, %16) : (none, i32) -> (none, i32)
    "dataflow.graph.return"(%18#1, %18#0) <{operandSegmentSizes = array<i32: 1, 0, 0, 1>}> : (i32, none) -> ()
  }) : () -> ()
  "dataflow.graph"() <{function_type = (i32, i1) -> i32, input_segments = array<i32: 2, 0, 0>, result_segments = array<i32: 1, 0, 0>, sym_name = "graph_1", sym_visibility = "private"}> ({
  ^bb0(%arg4: none, %arg5: i32, %arg6: i1):
    %5:2 = "dataflow.demux"(%arg6, %arg4) : (i1, none) -> (none, none)
    %6:2 = "dataflow.demux"(%arg6, %arg5) : (i1, i32) -> (i32, i32)
    %7 = "arith.muli"(%6#0, %6#0) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    %8 = "arith.addi"(%6#1, %6#1) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    %9 = "dataflow.mux"(%arg6, %7, %8) : (i1, i32, i32) -> i32
    %10 = "dataflow.mux"(%arg6, %5#0, %5#1) : (i1, none, none) -> none
    %11:2 = "dataflow.sync"(%10, %9) : (none, i32) -> (none, i32)
    "dataflow.graph.return"(%11#1, %11#0) <{operandSegmentSizes = array<i32: 1, 0, 0, 1>}> : (i32, 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(%arg2: none, %arg3: i32):
    %2 = "arith.addi"(%arg3, %arg3) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    %3 = "arith.muli"(%2, %arg3) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    %4:2 = "dataflow.sync"(%arg2, %3) : (none, i32) -> (none, i32)
    "dataflow.graph.return"(%4#1, %4#0) <{operandSegmentSizes = array<i32: 1, 0, 0, 1>}> : (i32, none) -> ()
  }) : () -> ()
  "dataflow.graph"() <{function_type = (i32) -> i32, input_segments = array<i32: 1, 0, 0>, result_segments = array<i32: 1, 0, 0>, sym_name = "graph_3", 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) -> ()
  }) : () -> ()
}) : () -> ()