Back to PBT run

output.generic.mlir

"builtin.module"() ({
  "func.func"() <{function_type = (i32) -> i32, sym_name = "helper_double"}> ({
  ^bb0(%arg21: i32):
    %34 = "arith.addi"(%arg21, %arg21) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    "func.return"(%34) : (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(%arg18: memref<4xi32>, %arg19: i32):
    %31 = "arith.constant"() <{value = 0 : index}> : () -> index
    %32 = "arith.constant"() <{value = 4 : index}> : () -> index
    %33 = "arith.constant"() <{value = 1 : index}> : () -> index
    "scf.for"(%31, %32, %33) ({
    ^bb0(%arg20: index):
      "memref.store"(%arg19, %arg18, %arg20) : (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(%arg14: memref<4xi32>, %arg15: i32, %arg16: i1, %arg17: none):
    %25 = "arith.constant"() <{value = 0 : index}> : () -> index
    %26 = "arith.constant"() <{value = 2 : index}> : () -> index
    %27 = "arith.constant"() <{value = 1 : index}> : () -> index
    %28 = "scf.if"(%arg16) ({
      %30:2 = "dataflow.graph.launch"(%arg17, %arg15, %arg16) <{callee = @graph_0, operandSegmentSizes = array<i32: 1, 2, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32, i1) -> (i32, none)
      "scf.yield"(%30#1) : (none) -> ()
    }, {
      "scf.yield"(%arg17) : (none) -> ()
    }) : (i1) -> none
    %29:2 = "dataflow.graph.launch"(%arg17, %arg15) <{callee = @graph_1, operandSegmentSizes = array<i32: 1, 1, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32) -> (i32, none)
    "dataflow.thread.yield"(%28, %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:2 = "dataflow.graph.launch"(%arg13, %arg11) <{callee = @graph_2, operandSegmentSizes = array<i32: 1, 1, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32) -> (i32, none)
    %23 = "scf.if"(%arg12) ({
      %24:2 = "dataflow.graph.launch"(%arg13, %arg11, %arg12) <{callee = @graph_3, operandSegmentSizes = array<i32: 1, 2, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32, i1) -> (i32, none)
      "scf.yield"(%24#1) : (none) -> ()
    }, {
      "scf.yield"(%arg13) : (none) -> ()
    }) : (i1) -> none
    "dataflow.thread.yield"(%22#1, %23) : (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) -> i32, input_segments = array<i32: 1, 0, 0>, result_segments = array<i32: 1, 0, 0>, sym_name = "graph_1", sym_visibility = "private"}> ({
  ^bb0(%arg5: none, %arg6: i32):
    %10 = "llvm.freeze"(%arg6) : (i32) -> i32
    %11:2 = "dataflow.sync"(%arg5, %10) : (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(%arg3: none, %arg4: i32):
    %7 = "arith.addi"(%arg4, %arg4) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    %8 = "arith.muli"(%7, %arg4) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    %9:2 = "dataflow.sync"(%arg3, %8) : (none, i32) -> (none, i32)
    "dataflow.graph.return"(%9#1, %9#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_3", sym_visibility = "private"}> ({
  ^bb0(%arg0: none, %arg1: i32, %arg2: i1):
    %0:2 = "dataflow.demux"(%arg2, %arg0) : (i1, none) -> (none, none)
    %1:2 = "dataflow.demux"(%arg2, %arg1) : (i1, i32) -> (i32, i32)
    %2 = "arith.muli"(%1#0, %1#0) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    %3 = "arith.addi"(%1#1, %1#1) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
    %4 = "dataflow.mux"(%arg2, %2, %3) : (i1, i32, i32) -> i32
    %5 = "dataflow.mux"(%arg2, %0#0, %0#1) : (i1, none, none) -> none
    %6:2 = "dataflow.sync"(%5, %4) : (none, i32) -> (none, i32)
    "dataflow.graph.return"(%6#1, %6#0) <{operandSegmentSizes = array<i32: 1, 0, 0, 1>}> : (i32, none) -> ()
  }) : () -> ()
}) : () -> ()