Back to PBT run
output.generic.mlir
"builtin.module"() ({
"func.func"() <{function_type = (i32) -> i32, sym_name = "helper_double"}> ({
^bb0(%arg20: i32):
%43 = "arith.addi"(%arg20, %arg20) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
"func.return"(%43) : (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):
%40 = "arith.constant"() <{value = 0 : index}> : () -> index
%41 = "arith.constant"() <{value = 4 : index}> : () -> index
%42 = "arith.constant"() <{value = 1 : index}> : () -> index
"scf.for"(%40, %41, %42) ({
^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(%arg13: memref<4xi32>, %arg14: i32, %arg15: i1, %arg16: none):
%34 = "arith.constant"() <{value = 0 : index}> : () -> index
%35 = "arith.constant"() <{value = 2 : index}> : () -> index
%36 = "arith.constant"() <{value = 1 : index}> : () -> index
%37 = "func.call"(%arg14) <{callee = @helper_double}> : (i32) -> i32
%38 = "dataflow.graph.launch"(%arg16, %arg14, %arg13) <{callee = @graph_0, operandSegmentSizes = array<i32: 1, 1, 0, 1, 0>, resultSegmentSizes = array<i32: 0, 0, 1>, source_maps = []}> : (none, i32, memref<4xi32>) -> none
%39:2 = "dataflow.graph.launch"(%arg16, %arg14) <{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"(%38, %39#1) : (none, none) -> ()
}) : () -> ()
"dataflow.thread"() <{domain = #dataflow.thread_domain<dense>, function_type = (memref<4xi32>, i32, i1) -> (), sym_name = "thread_1", sym_visibility = "private"}> ({
^bb0(%arg9: memref<4xi32>, %arg10: i32, %arg11: i1, %arg12: 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"(%arg12, %arg10) <{callee = @graph_2, operandSegmentSizes = array<i32: 1, 1, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32) -> (i32, none)
%32 = "scf.if"(%arg11) ({
%33:2 = "dataflow.graph.launch"(%arg12, %arg10) <{callee = @graph_3, operandSegmentSizes = array<i32: 1, 1, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32) -> (i32, none)
"scf.yield"(%33#1) : (none) -> ()
}, {
"scf.yield"(%arg12) : (none) -> ()
}) : (i1) -> none
"dataflow.thread.yield"(%31#1, %32) : (none, 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_0", sym_visibility = "private"}> ({
^bb0(%arg6: none, %arg7: i32, %arg8: memref<4xi32>):
%26 = "dataflow.constant"(%arg6) <{const_value = 0 : index}> : (none) -> index
%27 = "dataflow.store"(%arg8, %26, %arg7, %arg6) : (memref<4xi32>, index, i32, none) -> none
"dataflow.graph.return"(%27) <{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_1", sym_visibility = "private"}> ({
^bb0(%arg4: none, %arg5: i32):
%6 = "dataflow.constant"(%arg4) <{const_value = 0 : index}> : (none) -> index
%7 = "dataflow.constant"(%arg4) <{const_value = 2 : index}> : (none) -> index
%8 = "dataflow.constant"(%arg4) <{const_value = 1 : index}> : (none) -> index
%9 = "arith.index_cast"(%6) : (index) -> i32
%10 = "arith.index_cast"(%7) : (index) -> i32
%11 = "arith.index_cast"(%8) : (index) -> i32
%12:2 = "dataflow.stream"(%9, %10, %11) <{predicate = 2 : i64, step_kind = 0 : i32}> : (i32, i32, i32) -> (i32, i1)
%13 = "dataflow.carry"(%12#1, %arg4, %14#1) : (i1, none, none) -> none
%14:2 = "dataflow.demux"(%12#1, %13) : (i1, none) -> (none, none)
%15 = "dataflow.carry"(%12#1, %arg5, %20) : (i1, i32, i32) -> i32
%16:2 = "dataflow.demux"(%12#1, %15) : (i1, i32) -> (i32, i32)
%17 = "dataflow.invariant"(%12#1, %arg5) : (i1, i32) -> i32
%18:2 = "dataflow.gate"(%12#1, %17) : (i1, i32) -> (i1, i32)
%19:2 = "dataflow.demux"(%18#0, %18#1) : (i1, i32) -> (i32, i32)
%20 = "arith.addi"(%16#1, %18#1) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
%21 = "arith.cmpi"(%9, %10) <{predicate = 2 : i64}> : (i32, i32) -> i1
%22:2 = "dataflow.demux"(%21, %14#0) : (i1, none) -> (none, none)
%23:2 = "dataflow.sync"(%22#1, %19#0) : (none, i32) -> (none, i32)
%24 = "dataflow.mux"(%21, %22#0, %23#0) : (i1, none, none) -> none
%25:2 = "dataflow.sync"(%24, %16#0) : (none, i32) -> (none, i32)
"dataflow.graph.return"(%25#1, %25#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):
%3 = "arith.addi"(%arg3, %arg3) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
%4 = "arith.muli"(%3, %arg3) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
%5:2 = "dataflow.sync"(%arg2, %4) : (none, i32) -> (none, i32)
"dataflow.graph.return"(%5#1, %5#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 = "arith.addi"(%arg1, %arg1) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
%1 = "arith.muli"(%0, %arg1) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
%2:2 = "dataflow.sync"(%arg0, %1) : (none, i32) -> (none, i32)
"dataflow.graph.return"(%2#1, %2#0) <{operandSegmentSizes = array<i32: 1, 0, 0, 1>}> : (i32, none) -> ()
}) : () -> ()
}) : () -> ()