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