Back to PBT run
output.generic.mlir
"builtin.module"() ({
"func.func"() <{function_type = (i32) -> i32, sym_name = "helper_double"}> ({
^bb0(%arg27: i32):
%39 = "arith.addi"(%arg27, %arg27) <{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(%arg24: memref<4xi32>, %arg25: 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(%arg26: index):
"memref.store"(%arg25, %arg24, %arg26) : (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(%arg18: memref<4xi32>, %arg19: i32, %arg20: i1, %arg21: none):
%30 = "arith.constant"() <{value = 0 : index}> : () -> index
%31 = "arith.constant"() <{value = 2 : index}> : () -> index
%32 = "arith.constant"() <{value = 1 : index}> : () -> index
%33:2 = "dataflow.graph.launch"(%arg21, %arg19, %arg20) <{callee = @graph_0, operandSegmentSizes = array<i32: 1, 2, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32, i1) -> (i32, none)
%34 = "scf.for"(%30, %31, %32, %arg21) ({
^bb0(%arg22: index, %arg23: none):
%35:2 = "dataflow.graph.launch"(%arg23, %arg19, %arg20) <{callee = @graph_1, operandSegmentSizes = array<i32: 1, 2, 0, 0, 0>, resultSegmentSizes = array<i32: 1, 0, 1>, source_maps = []}> : (none, i32, i1) -> (i32, none)
"scf.yield"(%35#1) : (none) -> ()
}) : (index, index, index, none) -> none
"dataflow.thread.yield"(%33#1, %34) : (none, none) -> ()
}) : () -> ()
"dataflow.thread"() <{domain = #dataflow.thread_domain<dense>, function_type = (memref<4xi32>, i32, i1) -> (), sym_name = "thread_1", sym_visibility = "private"}> ({
^bb0(%arg12: memref<4xi32>, %arg13: i32, %arg14: i1, %arg15: none):
%23 = "arith.constant"() <{value = 0 : index}> : () -> index
%24 = "arith.constant"() <{value = 2 : index}> : () -> index
%25 = "arith.constant"() <{value = 1 : index}> : () -> index
%26 = "scf.for"(%23, %24, %25, %arg15) ({
^bb0(%arg16: index, %arg17: none):
%29:2 = "dataflow.graph.launch"(%arg17, %arg13, %arg14) <{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"(%29#1) : (none) -> ()
}) : (index, index, index, none) -> none
%27 = "scf.if"(%arg14) ({
%28 = "dataflow.graph.launch"(%arg15, %arg13, %arg12) <{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"(%28) : (none) -> ()
}, {
"scf.yield"(%arg15) : (none) -> ()
}) : (i1) -> none
"dataflow.thread.yield"(%26, %27) : (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(%arg9: none, %arg10: i32, %arg11: i1):
%16:2 = "dataflow.demux"(%arg11, %arg9) : (i1, none) -> (none, none)
%17:2 = "dataflow.demux"(%arg11, %arg10) : (i1, i32) -> (i32, i32)
%18 = "arith.muli"(%17#0, %17#0) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
%19 = "arith.addi"(%17#1, %17#1) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
%20 = "dataflow.mux"(%arg11, %18, %19) : (i1, i32, i32) -> i32
%21 = "dataflow.mux"(%arg11, %16#0, %16#1) : (i1, none, none) -> none
%22:2 = "dataflow.sync"(%21, %20) : (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, i1) -> i32, input_segments = array<i32: 2, 0, 0>, result_segments = array<i32: 1, 0, 0>, sym_name = "graph_1", sym_visibility = "private"}> ({
^bb0(%arg6: none, %arg7: i32, %arg8: i1):
%9:2 = "dataflow.demux"(%arg8, %arg6) : (i1, none) -> (none, none)
%10:2 = "dataflow.demux"(%arg8, %arg7) : (i1, i32) -> (i32, i32)
%11 = "arith.muli"(%10#0, %10#0) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
%12 = "arith.addi"(%10#1, %10#1) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
%13 = "dataflow.mux"(%arg8, %11, %12) : (i1, i32, i32) -> i32
%14 = "dataflow.mux"(%arg8, %9#0, %9#1) : (i1, none, none) -> none
%15:2 = "dataflow.sync"(%14, %13) : (none, i32) -> (none, i32)
"dataflow.graph.return"(%15#1, %15#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) -> ()
}) : () -> ()
}) : () -> ()