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