2 ; RUN: opt -passes=hotcoldsplit -debug-only=hotcoldsplit -hotcoldsplit-threshold=2 -S < %s -o /dev/null 2>&1 | FileCheck %s
4 declare void @sink() cold
6 ; CHECK-LABEL: Outlining in one_non_region_successor
7 define void @one_non_region_successor(i32 %arg) {
9 br i1 undef, label %cold1, label %exit
12 ; CHECK: Applying penalty for splitting: 2
13 ; CHECK-NEXT: Applying penalty for: 0 params
14 ; CHECK-NEXT: Applying penalty for: 0 outputs/split phis
15 ; CHECK-NEXT: penalty = 2
17 br i1 undef, label %cold2, label %cold3
20 br i1 undef, label %cold4, label %exit
23 br i1 undef, label %cold4, label %exit
32 ; CHECK-LABEL: Outlining in two_non_region_successor
33 define void @two_non_region_successors(i32 %arg) {
35 br i1 undef, label %cold1, label %exit1
38 ; CHECK: Applying penalty for splitting: 2
39 ; CHECK-NEXT: Applying penalty for: 0 params
40 ; CHECK-NEXT: Applying penalty for: 0 outputs/split phis
41 ; CHECK-NEXT: Applying penalty for: 2 non-region successors
42 ; CHECK-NEXT: penalty = 3
44 br i1 undef, label %cold2, label %cold3
47 br i1 undef, label %cold4, label %exit1
50 br i1 undef, label %cold4, label %exit2