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