1 ; This code is virtually identical to last-call-bonus.ll, but the callsites
2 ; to the internal functions are cold, thereby preventing the last call to
3 ; static bonus from being applied.
5 ; RUN: opt < %s -passes='function(require<opt-remark-emit>,unroll),require<profile-summary>,cgscc(inline)' -unroll-threshold=15000 -inline-threshold=250 -S | FileCheck %s
7 ; CHECK-LABEL: define internal i32 @baz
8 define internal i32 @baz() {
13 %ind = phi i32 [ 0, %entry ], [ %inc, %bb1 ]
15 %inc = add nsw i32 %ind, 1
16 %cmp = icmp sgt i32 %inc, 510
17 br i1 %cmp, label %ret, label %bb1
23 ; CHECK-LABEL: define internal i32 @bar
24 define internal i32 @bar(i1 %b) {
29 %ind = phi i32 [ 0, %entry ], [ %inc, %bb1 ]
31 %inc = add nsw i32 %ind, 1
32 %cmp = icmp sgt i32 %inc, 510
33 br i1 %cmp, label %for.exit, label %bb1
36 br i1 %b, label %bb2, label %ret, !prof !0
38 ; CHECK: call i32 @baz
44 ; CHECK-LABEL: define i32 @foo
45 define i32 @foo(i1 %b) {
47 br i1 %b, label %bb1, label %ret, !prof !0
49 ; CHECK: call i32 @bar
56 declare void @extern()
58 !0 = !{!"branch_weights", i32 1, i32 2500}