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(%arg17: i1, %arg18: i32):
%32 = "arith.constant"() <{value = 0 : i32}> : () -> i32
%33 = "arith.constant"() <{value = 1 : i32}> : () -> i32
"cf.cond_br"(%arg17)[^bb1, ^bb2] <{branch_weights = array<i32: 1, 9>, operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
^bb1: // pred: ^bb0
"cf.br"(%32)[^bb3] : (i32) -> ()
^bb2: // pred: ^bb0
"cf.br"(%33)[^bb3] : (i32) -> ()
^bb3(%34: i32): // 2 preds: ^bb1, ^bb2
%35 = "llvm.mlir.undef"() : () -> i32
%36 = "arith.constant"() <{value = 1 : i32}> : () -> i32
%37 = "arith.constant"() <{value = 0 : i32}> : () -> i32
%38:2 = "scf.while"(%34, %35) ({
^bb0(%arg21: i32, %arg22: i32):
%39 = "arith.cmpi"(%arg21, %arg18) <{predicate = 0 : i64}> : (i32, i32) -> i1
%40:4 = "scf.if"(%39) ({
"scf.yield"(%35, %arg21, %36, %37) : (i32, i32, i32, i32) -> ()
}, {
%42 = "arith.addi"(%arg21, %33) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
"scf.yield"(%42, %35, %37, %36) : (i32, i32, i32, i32) -> ()
}) : (i1) -> (i32, i32, i32, i32)
%41 = "arith.trunci"(%40#3) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
"scf.condition"(%41, %40#0, %40#1) : (i1, i32, i32) -> ()
}, {
^bb0(%arg19: i32, %arg20: i32):
"scf.yield"(%arg19, %arg20) : (i32, i32) -> ()
}) {llvm.loop_annotation = #loop_annotation} : (i32, i32) -> (i32, i32)
"cf.br"()[^bb4] : () -> ()
^bb4: // pred: ^bb3
"llvm.return"(%38#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(%arg11: i1, %arg12: i32):
%21 = "arith.constant"() <{value = 0 : i32}> : () -> i32
%22 = "arith.constant"() <{value = 1 : i32}> : () -> i32
"cf.cond_br"(%arg11)[^bb1, ^bb2] <{branch_weights = array<i32: 2, 8>, operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
^bb1: // pred: ^bb0
"cf.br"(%21)[^bb3] : (i32) -> ()
^bb2: // pred: ^bb0
"cf.br"(%22)[^bb3] : (i32) -> ()
^bb3(%23: i32): // 2 preds: ^bb1, ^bb2
%24 = "llvm.mlir.undef"() : () -> i32
%25 = "arith.constant"() <{value = 1 : i32}> : () -> i32
%26 = "arith.constant"() <{value = 0 : i32}> : () -> i32
%27:2 = "scf.while"(%23, %24) ({
^bb0(%arg15: i32, %arg16: i32):
%28 = "arith.cmpi"(%arg15, %arg12) <{predicate = 0 : i64}> : (i32, i32) -> i1
%29:4 = "scf.if"(%28) ({
"scf.yield"(%24, %arg15, %25, %26) : (i32, i32, i32, i32) -> ()
}, {
%31 = "arith.addi"(%arg15, %22) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
"scf.yield"(%31, %24, %26, %25) : (i32, i32, i32, i32) -> ()
}) : (i1) -> (i32, i32, i32, i32)
%30 = "arith.trunci"(%29#3) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
"scf.condition"(%30, %29#0, %29#1) : (i1, i32, i32) -> ()
}, {
^bb0(%arg13: i32, %arg14: i32):
"scf.yield"(%arg13, %arg14) : (i32, i32) -> ()
}) {llvm.loop_annotation = #loop_annotation} : (i32, i32) -> (i32, i32)
"cf.br"()[^bb4] : () -> ()
^bb4: // pred: ^bb3
"llvm.return"(%27#1) : (i32) -> ()
}) : () -> ()
"llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<i32 (i32)>, linkage = #llvm.linkage<external>, sym_name = "counted_cycle_2", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
^bb0(%arg6: i32):
%11 = "llvm.mlir.undef"() : () -> i32
%12 = "arith.constant"() <{value = 1 : i32}> : () -> i32
%13 = "arith.constant"() <{value = 0 : i32}> : () -> i32
%14 = "arith.constant"() <{value = 0 : i32}> : () -> i32
%15 = "arith.constant"() <{value = 4 : i32}> : () -> i32
%16:2 = "scf.while"(%14, %11) ({
^bb0(%arg9: i32, %arg10: i32):
%17 = "arith.cmpi"(%arg9, %arg6) <{predicate = 0 : i64}> : (i32, i32) -> i1
%18:3 = "scf.if"(%17) ({
"scf.yield"(%11, %12, %13) : (i32, i32, i32) -> ()
}, {
%20 = "arith.addi"(%arg9, %15) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
"scf.yield"(%20, %13, %12) : (i32, i32, i32) -> ()
}) : (i1) -> (i32, i32, i32)
%19 = "arith.trunci"(%18#2) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
"scf.condition"(%19, %18#0, %arg9) : (i1, i32, i32) -> ()
}, {
^bb0(%arg7: i32, %arg8: i32):
"scf.yield"(%arg7, %arg8) : (i32, i32) -> ()
}) {llvm.loop_annotation = #loop_annotation} : (i32, i32) -> (i32, i32)
"llvm.return"(%16#1) : (i32) -> ()
}) : () -> ()
"llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<i32 (i1, i32)>, linkage = #llvm.linkage<external>, sym_name = "weighted_then_cycle_3", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
^bb0(%arg0: i1, %arg1: i32):
%0 = "arith.constant"() <{value = 0 : i32}> : () -> i32
%1 = "arith.constant"() <{value = 1 : i32}> : () -> i32
"cf.cond_br"(%arg0)[^bb1, ^bb2] <{branch_weights = array<i32: 4, 6>, operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
^bb1: // pred: ^bb0
"cf.br"(%0)[^bb3] : (i32) -> ()
^bb2: // pred: ^bb0
"cf.br"(%1)[^bb3] : (i32) -> ()
^bb3(%2: i32): // 2 preds: ^bb1, ^bb2
%3 = "llvm.mlir.undef"() : () -> i32
%4 = "arith.constant"() <{value = 1 : i32}> : () -> i32
%5 = "arith.constant"() <{value = 0 : i32}> : () -> i32
%6:2 = "scf.while"(%2, %3) ({
^bb0(%arg4: i32, %arg5: i32):
%7 = "arith.cmpi"(%arg4, %arg1) <{predicate = 0 : i64}> : (i32, i32) -> i1
%8:4 = "scf.if"(%7) ({
"scf.yield"(%3, %arg4, %4, %5) : (i32, i32, i32, i32) -> ()
}, {
%10 = "arith.addi"(%arg4, %1) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
"scf.yield"(%10, %3, %5, %4) : (i32, i32, i32, i32) -> ()
}) : (i1) -> (i32, i32, i32, i32)
%9 = "arith.trunci"(%8#3) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
"scf.condition"(%9, %8#0, %8#1) : (i1, i32, i32) -> ()
}, {
^bb0(%arg2: i32, %arg3: i32):
"scf.yield"(%arg2, %arg3) : (i32, i32) -> ()
}) : (i32, i32) -> (i32, i32)
"cf.br"()[^bb4] : () -> ()
^bb4: // pred: ^bb3
"llvm.return"(%6#1) : (i32) -> ()
}) : () -> ()
}) : () -> ()