Back to PBT run

output.generic.mlir

#loop_annotation = #llvm.loop_annotation<mustProgress = true>
"builtin.module"() ({
  "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<i32 (i32)>, linkage = #llvm.linkage<external>, sym_name = "counted_cycle_0", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
  ^bb0(%arg16: i32):
    %31 = "llvm.mlir.undef"() : () -> i32
    %32 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %33 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %34 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %35 = "arith.constant"() <{value = 2 : i32}> : () -> i32
    %36:2 = "scf.while"(%34, %31) ({
    ^bb0(%arg19: i32, %arg20: i32):
      %37 = "arith.cmpi"(%arg19, %arg16) <{predicate = 0 : i64}> : (i32, i32) -> i1
      %38:3 = "scf.if"(%37) ({
        "scf.yield"(%31, %32, %33) : (i32, i32, i32) -> ()
      }, {
        %40 = "arith.addi"(%arg19, %35) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
        "scf.yield"(%40, %33, %32) : (i32, i32, i32) -> ()
      }) : (i1) -> (i32, i32, i32)
      %39 = "arith.trunci"(%38#2) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
      "scf.condition"(%39, %38#0, %arg19) : (i1, i32, i32) -> ()
    }, {
    ^bb0(%arg17: i32, %arg18: i32):
      "scf.yield"(%arg17, %arg18) : (i32, i32) -> ()
    }) : (i32, i32) -> (i32, i32)
    "llvm.return"(%36#1) : (i32) -> ()
  }) : () -> ()
  "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<i32 (i1, i32)>, linkage = #llvm.linkage<external>, sym_name = "weighted_then_cycle_1", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
  ^bb0(%arg10: i1, %arg11: i32):
    %20 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %21 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    "cf.cond_br"(%arg10)[^bb1, ^bb2] <{branch_weights = array<i32: 6, 4>, operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
  ^bb1:  // pred: ^bb0
    "cf.br"(%20)[^bb3] : (i32) -> ()
  ^bb2:  // pred: ^bb0
    "cf.br"(%21)[^bb3] : (i32) -> ()
  ^bb3(%22: i32):  // 2 preds: ^bb1, ^bb2
    %23 = "llvm.mlir.undef"() : () -> i32
    %24 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %25 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %26:2 = "scf.while"(%22, %23) ({
    ^bb0(%arg14: i32, %arg15: i32):
      %27 = "arith.cmpi"(%arg14, %arg11) <{predicate = 0 : i64}> : (i32, i32) -> i1
      %28:4 = "scf.if"(%27) ({
        "scf.yield"(%23, %arg14, %24, %25) : (i32, i32, i32, i32) -> ()
      }, {
        %30 = "arith.addi"(%arg14, %21) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
        "scf.yield"(%30, %23, %25, %24) : (i32, i32, i32, i32) -> ()
      }) : (i1) -> (i32, i32, i32, i32)
      %29 = "arith.trunci"(%28#3) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
      "scf.condition"(%29, %28#0, %28#1) : (i1, i32, i32) -> ()
    }, {
    ^bb0(%arg12: i32, %arg13: i32):
      "scf.yield"(%arg12, %arg13) : (i32, i32) -> ()
    }) {llvm.loop_annotation = #loop_annotation} : (i32, i32) -> (i32, i32)
    "cf.br"()[^bb4] : () -> ()
  ^bb4:  // pred: ^bb3
    "llvm.return"(%26#1) : (i32) -> ()
  }) : () -> ()
  "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<i32 (i32)>, linkage = #llvm.linkage<external>, sym_name = "counted_cycle_2", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
  ^bb0(%arg5: i32):
    %10 = "llvm.mlir.undef"() : () -> i32
    %11 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %12 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %13 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %14 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %15:2 = "scf.while"(%13, %10) ({
    ^bb0(%arg8: i32, %arg9: i32):
      %16 = "arith.cmpi"(%arg8, %arg5) <{predicate = 0 : i64}> : (i32, i32) -> i1
      %17:3 = "scf.if"(%16) ({
        "scf.yield"(%10, %11, %12) : (i32, i32, i32) -> ()
      }, {
        %19 = "arith.addi"(%arg8, %14) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
        "scf.yield"(%19, %12, %11) : (i32, i32, i32) -> ()
      }) : (i1) -> (i32, i32, i32)
      %18 = "arith.trunci"(%17#2) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
      "scf.condition"(%18, %17#0, %arg8) : (i1, i32, i32) -> ()
    }, {
    ^bb0(%arg6: i32, %arg7: i32):
      "scf.yield"(%arg6, %arg7) : (i32, i32) -> ()
    }) {llvm.loop_annotation = #loop_annotation} : (i32, i32) -> (i32, i32)
    "llvm.return"(%15#1) : (i32) -> ()
  }) : () -> ()
  "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<i32 (i32)>, linkage = #llvm.linkage<external>, sym_name = "counted_cycle_3", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
  ^bb0(%arg0: i32):
    %0 = "llvm.mlir.undef"() : () -> i32
    %1 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %2 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %3 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %4 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %5:2 = "scf.while"(%3, %0) ({
    ^bb0(%arg3: i32, %arg4: i32):
      %6 = "arith.cmpi"(%arg3, %arg0) <{predicate = 0 : i64}> : (i32, i32) -> i1
      %7:3 = "scf.if"(%6) ({
        "scf.yield"(%0, %1, %2) : (i32, i32, i32) -> ()
      }, {
        %9 = "arith.addi"(%arg3, %4) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
        "scf.yield"(%9, %2, %1) : (i32, i32, i32) -> ()
      }) : (i1) -> (i32, i32, i32)
      %8 = "arith.trunci"(%7#2) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
      "scf.condition"(%8, %7#0, %arg3) : (i1, i32, i32) -> ()
    }, {
    ^bb0(%arg1: i32, %arg2: i32):
      "scf.yield"(%arg1, %arg2) : (i32, i32) -> ()
    }) : (i32, i32) -> (i32, i32)
    "llvm.return"(%5#1) : (i32) -> ()
  }) : () -> ()
}) : () -> ()