2 ; RUN: opt -passes=hotcoldsplit -debug-only=hotcoldsplit -hotcoldsplit-threshold=2 -hotcoldsplit-max-params=2 -S < %s -o /dev/null 2>&1 | FileCheck %s
4 declare void @sink(ptr, i32, i32) cold
8 define void @foo(i32 %arg, i1 %arg2) {
9 %local = load i32, ptr @g
10 br i1 %arg2, label %cold, label %exit
13 ; CHECK: Applying penalty for splitting: 2
14 ; CHECK-NEXT: Applying penalty for: 2 params
15 ; CHECK-NEXT: Applying penalty for: 0 outputs/split phis
16 ; CHECK-NEXT: penalty = 6
17 call void @sink(ptr @g, i32 %arg, i32 %local)
24 define void @bar(ptr %p1, i32 %p2, i32 %p3, i1 %arg) {
25 br i1 %arg, label %cold, label %exit
28 ; CHECK: Applying penalty for splitting: 2
29 ; CHECK-NEXT: 3 inputs and 0 outputs exceeds parameter limit (2)
30 ; CHECK-NEXT: penalty = 2147483647
31 call void @sink(ptr %p1, i32 %p2, i32 %p3)