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