Back to PBT run

input.generic.mlir

"builtin.module"() ({
  "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<i64 (i64)>, linkage = #llvm.linkage<external>, sym_name = "imported_callable", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
  }) : () -> ()
  "func.func"() <{function_type = (i32) -> i32, sym_name = "native_callable", sym_visibility = "private"}> ({
  ^bb0(%arg18: i32):
    "func.return"(%arg18) : (i32) -> ()
  }) : () -> ()
  "dataflow.thread"() <{domain = #dataflow.thread_domain<dense>, function_type = (index, memref<?xindex>) -> (), sym_name = "thread_0", sym_visibility = "private"}> ({
  ^bb0(%arg10: index, %arg11: memref<?xindex>, %arg12: none):
    "loom.spatial_region"(%arg10, %arg11) <{graph_name = "g_thread_0", operandSegmentSizes = array<i32: 1, 0, 1, 0>, resultSegmentSizes = array<i32: 0, 0>, source_maps = []}> ({
    ^bb0(%arg13: index, %arg14: memref<?xindex>):
      %14 = "arith.constant"() <{value = 0 : index}> : () -> index
      %15 = "arith.constant"() <{value = 1 : index}> : () -> index
      %16 = "arith.constant"() <{value = 2 : index}> : () -> index
      %17 = "arith.cmpi"(%14, %16) <{predicate = 6 : i64}> : (index, index) -> i1
      %18 = "scf.while"(%14) ({
      ^bb0(%arg17: index):
        %28 = "arith.cmpi"(%arg17, %16) <{predicate = 6 : i64}> : (index, index) -> i1
        "scf.condition"(%28, %arg17) : (i1, index) -> ()
      }, {
      ^bb0(%arg15: index):
        "scf.if"(%17) ({
          %26 = "memref.load"(%arg14, %14) : (memref<?xindex>, index) -> index
          %27 = "arith.addi"(%26, %15) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
          "memref.store"(%27, %arg14, %14) : (index, memref<?xindex>, index) -> ()
          "memref.store"(%15, %arg14, %14) : (index, memref<?xindex>, index) -> ()
          "scf.yield"() : () -> ()
        }, {
          %24 = "memref.load"(%arg14, %14) : (memref<?xindex>, index) -> index
          %25 = "arith.addi"(%24, %15) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
          "memref.store"(%25, %arg14, %14) : (index, memref<?xindex>, index) -> ()
          "memref.store"(%15, %arg14, %14) : (index, memref<?xindex>, index) -> ()
          "scf.yield"() : () -> ()
        }) : (i1) -> ()
        "scf.parallel"(%14, %16, %15) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>}> ({
        ^bb0(%arg16: index):
          %20 = "arith.muli"(%14, %16) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
          %21 = "arith.addi"(%20, %arg16) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
          %22 = "memref.load"(%arg14, %21) : (memref<?xindex>, index) -> index
          %23 = "arith.addi"(%22, %15) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
          "memref.store"(%23, %arg14, %21) : (index, memref<?xindex>, index) -> ()
          "scf.reduce"() : () -> ()
        }) : (index, index, index) -> ()
        %19 = "arith.addi"(%arg15, %15) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
        "scf.yield"(%19) : (index) -> ()
      }) : (index) -> index
      "loom.spatial_yield"() <{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
    }) : (index, memref<?xindex>) -> ()
    "dataflow.thread.yield"() : () -> ()
  }) : () -> ()
  "dataflow.thread"() <{domain = #dataflow.thread_domain<dense>, function_type = (index, memref<?xindex>) -> (), sym_name = "thread_1", sym_visibility = "private"}> ({
  ^bb0(%arg0: index, %arg1: memref<?xindex>, %arg2: none):
    "loom.spatial_region"(%arg0, %arg1) <{graph_name = "g_thread_1", operandSegmentSizes = array<i32: 1, 0, 1, 0>, resultSegmentSizes = array<i32: 0, 0>, source_maps = []}> ({
    ^bb0(%arg3: index, %arg4: memref<?xindex>):
      %0 = "arith.constant"() <{value = 0 : index}> : () -> index
      %1 = "arith.constant"() <{value = 1 : index}> : () -> index
      %2 = "arith.constant"() <{value = 2 : index}> : () -> index
      %3 = "arith.cmpi"(%0, %2) <{predicate = 6 : i64}> : (index, index) -> i1
      %4 = "scf.while"(%0) ({
      ^bb0(%arg9: index):
        %13 = "arith.cmpi"(%arg9, %2) <{predicate = 6 : i64}> : (index, index) -> i1
        "scf.condition"(%13, %arg9) : (i1, index) -> ()
      }, {
      ^bb0(%arg6: index):
        %7 = "scf.while"(%0) ({
        ^bb0(%arg8: index):
          %12 = "arith.cmpi"(%arg8, %2) <{predicate = 6 : i64}> : (index, index) -> i1
          "scf.condition"(%12, %arg8) : (i1, index) -> ()
        }, {
        ^bb0(%arg7: index):
          %9 = "memref.load"(%arg4, %0) : (memref<?xindex>, index) -> index
          %10 = "arith.addi"(%9, %1) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
          "memref.store"(%10, %arg4, %0) : (index, memref<?xindex>, index) -> ()
          %11 = "arith.addi"(%arg7, %1) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
          "scf.yield"(%11) : (index) -> ()
        }) : (index) -> index
        %8 = "arith.addi"(%arg6, %1) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
        "scf.yield"(%8) : (index) -> ()
      }) : (index) -> index
      "scf.parallel"(%0, %2, %1) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>}> ({
      ^bb0(%arg5: index):
        %5 = "arith.muli"(%0, %2) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
        %6 = "arith.addi"(%5, %arg5) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
        "memref.store"(%1, %arg4, %6) : (index, memref<?xindex>, index) -> ()
        "scf.reduce"() : () -> ()
      }) : (index, index, index) -> ()
      "loom.spatial_yield"() <{operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
    }) : (index, memref<?xindex>) -> ()
    "dataflow.thread.yield"() : () -> ()
  }) : () -> ()
}) : () -> ()