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