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(%arg10: i32):
    %15 = "llvm.mlir.undef"() : () -> i32
    %16 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %17 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %18 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %19 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %20:2 = "scf.while"(%18, %15) ({
    ^bb0(%arg13: i32, %arg14: i32):
      %21 = "arith.cmpi"(%arg13, %arg10) <{predicate = 0 : i64}> : (i32, i32) -> i1
      %22:3 = "scf.if"(%21) ({
        "scf.yield"(%15, %16, %17) : (i32, i32, i32) -> ()
      }, {
        %24 = "arith.addi"(%arg13, %19) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
        "scf.yield"(%24, %17, %16) : (i32, i32, i32) -> ()
      }) : (i1) -> (i32, i32, i32)
      %23 = "arith.trunci"(%22#2) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
      "scf.condition"(%23, %22#0, %arg13) : (i1, i32, i32) -> ()
    }, {
    ^bb0(%arg11: i32, %arg12: i32):
      "scf.yield"(%arg11, %arg12) : (i32, i32) -> ()
    }) : (i32, i32) -> (i32, i32)
    "llvm.return"(%20#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(%arg4: i1, %arg5: i32):
    %4 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %5 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    "cf.cond_br"(%arg4)[^bb1, ^bb2] <{branch_weights = array<i32: 6, 4>, operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
  ^bb1:  // pred: ^bb0
    "cf.br"(%4)[^bb3] : (i32) -> ()
  ^bb2:  // pred: ^bb0
    "cf.br"(%5)[^bb3] : (i32) -> ()
  ^bb3(%6: i32):  // 2 preds: ^bb1, ^bb2
    %7 = "llvm.mlir.undef"() : () -> i32
    %8 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %9 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %10:2 = "scf.while"(%6, %7) ({
    ^bb0(%arg8: i32, %arg9: i32):
      %11 = "arith.cmpi"(%arg8, %arg5) <{predicate = 0 : i64}> : (i32, i32) -> i1
      %12:4 = "scf.if"(%11) ({
        "scf.yield"(%7, %arg8, %8, %9) : (i32, i32, i32, i32) -> ()
      }, {
        %14 = "arith.addi"(%arg8, %5) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
        "scf.yield"(%14, %7, %9, %8) : (i32, i32, i32, i32) -> ()
      }) : (i1) -> (i32, i32, i32, i32)
      %13 = "arith.trunci"(%12#3) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
      "scf.condition"(%13, %12#0, %12#1) : (i1, i32, i32) -> ()
    }, {
    ^bb0(%arg6: i32, %arg7: i32):
      "scf.yield"(%arg6, %arg7) : (i32, i32) -> ()
    }) {llvm.loop_annotation = #loop_annotation} : (i32, i32) -> (i32, i32)
    "cf.br"()[^bb4] : () -> ()
  ^bb4:  // pred: ^bb3
    "llvm.return"(%10#1) : (i32) -> ()
  }) : () -> ()
  "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<i32 (i1, i1, i32, i32)>, linkage = #llvm.linkage<external>, sym_name = "plain_then_weighted_2", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
  ^bb0(%arg0: i1, %arg1: i1, %arg2: i32, %arg3: i32):
    %0 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %1 = "scf.if"(%arg0) ({
      "scf.yield"(%arg2) : (i32) -> ()
    }, {
      "scf.yield"(%arg3) : (i32) -> ()
    }) : (i1) -> i32
    "cf.br"(%1)[^bb1] : (i32) -> ()
  ^bb1(%2: i32):  // pred: ^bb0
    "cf.cond_br"(%arg1)[^bb2, ^bb3] <{branch_weights = array<i32: 3, 7>, operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
  ^bb2:  // pred: ^bb1
    "cf.br"(%2)[^bb4] : (i32) -> ()
  ^bb3:  // pred: ^bb1
    "cf.br"(%2)[^bb4] : (i32) -> ()
  ^bb4(%3: i32):  // 2 preds: ^bb2, ^bb3
    "llvm.return"(%3) : (i32) -> ()
  }) : () -> ()
}) : () -> ()