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(%arg10: i1, %arg11: i32):
%15 = "arith.constant"() <{value = 0 : i32}> : () -> i32
%16 = "arith.constant"() <{value = 1 : i32}> : () -> i32
"cf.cond_br"(%arg10)[^bb1, ^bb2] <{branch_weights = array<i32: 5, 5>, operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
^bb1: // pred: ^bb0
"cf.br"(%15)[^bb3] : (i32) -> ()
^bb2: // pred: ^bb0
"cf.br"(%16)[^bb3] : (i32) -> ()
^bb3(%17: i32): // 2 preds: ^bb1, ^bb2
%18 = "llvm.mlir.undef"() : () -> i32
%19 = "arith.constant"() <{value = 1 : i32}> : () -> i32
%20 = "arith.constant"() <{value = 0 : i32}> : () -> i32
%21:2 = "scf.while"(%17, %18) ({
^bb0(%arg14: i32, %arg15: i32):
%22 = "arith.cmpi"(%arg14, %arg11) <{predicate = 0 : i64}> : (i32, i32) -> i1
%23:4 = "scf.if"(%22) ({
"scf.yield"(%18, %arg14, %19, %20) : (i32, i32, i32, i32) -> ()
}, {
%25 = "arith.addi"(%arg14, %16) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
"scf.yield"(%25, %18, %20, %19) : (i32, i32, i32, i32) -> ()
}) : (i1) -> (i32, i32, i32, i32)
%24 = "arith.trunci"(%23#3) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
"scf.condition"(%24, %23#0, %23#1) : (i1, i32, i32) -> ()
}, {
^bb0(%arg12: i32, %arg13: i32):
"scf.yield"(%arg12, %arg13) : (i32, i32) -> ()
}) : (i32, i32) -> (i32, i32)
"cf.br"()[^bb4] : () -> ()
^bb4: // pred: ^bb3
"llvm.return"(%21#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: 8, 2>, 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 = "weighted_then_plain_2", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
^bb0(%arg0: i1, %arg1: i1, %arg2: i32, %arg3: i32):
"cf.cond_br"(%arg0)[^bb1, ^bb2] <{branch_weights = array<i32: 8, 2>, operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
^bb1: // pred: ^bb0
"cf.br"(%arg2)[^bb3] : (i32) -> ()
^bb2: // pred: ^bb0
"cf.br"(%arg3)[^bb3] : (i32) -> ()
^bb3(%0: i32): // 2 preds: ^bb1, ^bb2
%1 = "arith.constant"() <{value = 0 : i32}> : () -> i32
%2 = "scf.if"(%arg1) ({
"scf.yield"(%0) : (i32) -> ()
}, {
"scf.yield"(%0) : (i32) -> ()
}) : (i1) -> i32
"cf.br"(%2)[^bb4] : (i32) -> ()
^bb4(%3: i32): // pred: ^bb3
"llvm.return"(%3) : (i32) -> ()
}) : () -> ()
}) : () -> ()