Back to PBT run
input.mlir
#loop_ann = #llvm.loop_annotation<mustProgress = true>
llvm.func @counted_cycle_0(%limit: i32) -> i32 {
%zero = arith.constant 0 : i32
%step = arith.constant 4 : 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
}
llvm.func @counted_cycle_1(%limit: i32) -> i32 {
%zero = arith.constant 0 : i32
%step = arith.constant 1 : 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
}
llvm.func @weighted_then_cycle_2(%weighted: i1, %limit: i32) -> i32 {
%zero = arith.constant 0 : i32
%one = arith.constant 1 : i32
cf.cond_br %weighted weights([4, 6]), ^left, ^right
^left:
cf.br ^header(%zero : i32)
^right:
cf.br ^header(%one : i32)
^header(%iv: i32):
%done = arith.cmpi eq, %iv, %limit : i32
cf.cond_br %done, ^exit, ^latch
^latch:
%next = arith.addi %iv, %one : i32
cf.br ^header(%next : i32)
^exit:
llvm.return %iv : i32
}
llvm.func @weighted_then_cycle_3(%weighted: i1, %limit: i32) -> i32 {
%zero = arith.constant 0 : i32
%one = arith.constant 1 : i32
cf.cond_br %weighted weights([5, 5]), ^left, ^right
^left:
cf.br ^header(%zero : i32)
^right:
cf.br ^header(%one : i32)
^header(%iv: i32):
%done = arith.cmpi eq, %iv, %limit : i32
cf.cond_br %done, ^exit, ^latch
^latch:
%next = arith.addi %iv, %one : i32
cf.br ^header(%next : i32) {llvm.loop_annotation = #loop_ann}
^exit:
llvm.return %iv : i32
}