Back to PBT run

output.generic.mlir

"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(%arg5: i1, %arg6: i32):
    %10 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %11 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    "cf.cond_br"(%arg5)[^bb1, ^bb2] <{branch_weights = array<i32: 8, 2>, operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
  ^bb1:  // pred: ^bb0
    "cf.br"(%10)[^bb3] : (i32) -> ()
  ^bb2:  // pred: ^bb0
    "cf.br"(%11)[^bb3] : (i32) -> ()
  ^bb3(%12: i32):  // 2 preds: ^bb1, ^bb2
    %13 = "llvm.mlir.undef"() : () -> i32
    %14 = "arith.constant"() <{value = 1 : i32}> : () -> i32
    %15 = "arith.constant"() <{value = 0 : i32}> : () -> i32
    %16:2 = "scf.while"(%12, %13) ({
    ^bb0(%arg9: i32, %arg10: i32):
      %17 = "arith.cmpi"(%arg9, %arg6) <{predicate = 0 : i64}> : (i32, i32) -> i1
      %18:4 = "scf.if"(%17) ({
        "scf.yield"(%13, %arg9, %14, %15) : (i32, i32, i32, i32) -> ()
      }, {
        %20 = "arith.addi"(%arg9, %11) <{overflowFlags = #arith.overflow<none>}> : (i32, i32) -> i32
        "scf.yield"(%20, %13, %15, %14) : (i32, i32, i32, i32) -> ()
      }) : (i1) -> (i32, i32, i32, i32)
      %19 = "arith.trunci"(%18#3) <{overflowFlags = #arith.overflow<none>}> : (i32) -> i1
      "scf.condition"(%19, %18#0, %18#1) : (i1, i32, i32) -> ()
    }, {
    ^bb0(%arg7: i32, %arg8: i32):
      "scf.yield"(%arg7, %arg8) : (i32, i32) -> ()
    }) : (i32, i32) -> (i32, i32)
    "cf.br"()[^bb4] : () -> ()
  ^bb4:  // pred: ^bb3
    "llvm.return"(%16#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(%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 = 4 : 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) -> ()
  }) : () -> ()
}) : () -> ()