Back to PBT run
input.mlir
#loop_ann = #llvm.loop_annotation<mustProgress = true>
llvm.func @sequential_diamonds_0(%first: i1, %second: i1, %a: i32, %b: i32) -> i32 {
%k = arith.constant 4 : i32
cf.cond_br %first, ^one_yes, ^one_no
^one_yes:
cf.br ^middle(%a : i32)
^one_no:
cf.br ^middle(%b : i32)
^middle(%seed: i32):
cf.cond_br %second, ^two_yes, ^two_no
^two_yes:
%sum = arith.addi %seed, %k : i32
cf.br ^exit(%sum : i32)
^two_no:
cf.br ^exit(%seed : i32)
^exit(%r: i32):
llvm.return %r : i32
}
llvm.func @plain_then_weighted_1(%plain: i1, %weighted: i1, %a: i32, %b: i32) -> i32 {
cf.cond_br %plain, ^plain_true, ^plain_false
^plain_true:
cf.br ^weighted_entry(%a : i32)
^plain_false:
cf.br ^weighted_entry(%b : i32)
^weighted_entry(%seed: i32):
cf.cond_br %weighted weights([5, 5]), ^weighted_true, ^weighted_false
^weighted_true:
cf.br ^exit(%seed : i32)
^weighted_false:
cf.br ^exit(%seed : i32)
^exit(%r: i32):
llvm.return %r : i32
}
llvm.func @counted_cycle_2(%limit: i32) -> i32 {
%zero = arith.constant 0 : i32
%step = arith.constant 3 : i32
cf.br ^header(%zero : i32)
^header(%iv: i32):
%done = arith.cmpi eq, %iv, %limit : i32
cf.cond_br %done, ^exit, ^latch
^latch:
%next = arith.addi %iv, %step : i32
cf.br ^header(%next : i32) {llvm.loop_annotation = #loop_ann}
^exit:
llvm.return %iv : i32
}