1 ; RUN: opt -S -passes=hotcoldsplit -hotcoldsplit-threshold=0 < %s | FileCheck %s
5 ; __attribute__((cold)) extern void sink(int);
6 ; extern void sideeffect(int);
7 ; void foo(int cond1, int cond2) {
9 ; if (cond2) { // This is the first cold region we visit.
14 ; // There's a larger, overlapping cold region here. But we ignore it.
15 ; // This could be improved.
21 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
22 target triple = "x86_64-apple-macosx10.14.0"
24 ; CHECK-LABEL: define {{.*}}@_Z3fooii
25 ; CHECK: call {{.*}}@_Z3fooii.cold.1
26 ; CHECK-NOT: _Z3fooii.cold
27 define void @_Z3fooii(i32, i32) {
28 %3 = alloca i32, align 4
29 %4 = alloca i32, align 4
30 store i32 %0, ptr %3, align 4
31 store i32 %1, ptr %4, align 4
32 %5 = load i32, ptr %3, align 4
33 %6 = icmp ne i32 %5, 0
34 br i1 %6, label %7, label %12
36 ; <label>:7: ; preds = %2
37 %8 = load i32, ptr %4, align 4
38 %9 = icmp ne i32 %8, 0
39 br i1 %9, label %10, label %11
41 ; <label>:10: ; preds = %7
42 call void @_Z10sideeffecti(i32 0)
43 call void @_Z4sinki(i32 0) #3
46 ; <label>:11: ; preds = %10, %7
47 call void @_Z10sideeffecti(i32 1)
48 call void @_Z4sinki(i32 1) #3
51 ; <label>:12: ; preds = %11, %2
55 ; CHECK-LABEL: define internal {{.*}}@_Z3fooii.cold.1
56 ; CHECK: call void @_Z10sideeffecti(i32 0)
58 declare void @_Z10sideeffecti(i32)
60 declare void @_Z4sinki(i32) cold