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