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