1 ; RUN: opt -passes=synthetic-counts-propagation -S < %s | FileCheck %s
3 ; CHECK-LABEL: define void @foo()
4 ; CHECK: !prof ![[COUNT1:[0-9]+]]
9 ; CHECK-LABEL: define void @foo_inline() #0
10 ; CHECK: !prof ![[COUNT2:[0-9]+]]
11 define void @foo_inline() #0 {
15 ; CHECK-LABEL: define void @foo_always_inline() #1
16 ; CHECK: !prof ![[COUNT2]]
17 define void @foo_always_inline() #1 {
21 ; CHECK-LABEL: define void @foo_cold() #2
22 ; CHECK: !prof ![[COUNT3:[0-9]+]]
23 define void @foo_cold() #2 {
27 ; CHECK-LABEL: define void @foo_noinline() #3
28 ; CHECK: !prof ![[COUNT3]]
29 define void @foo_noinline() #3 {
33 ; CHECK-LABEL: define internal void @foo_local()
34 ; CHECK: !prof ![[COUNT4:[0-9]+]]
35 define internal void @foo_local() {
39 ; CHECK-LABEL: define internal void @foo_local_escaped()
40 ; CHECK: !prof ![[COUNT1]]
41 define internal void @foo_local_escaped() {
45 declare void @ext(ptr)
48 call void @ext(ptr nonnull @foo_local_escaped)
52 ; CHECK-LABEL: define internal void @foo_local_inline() #0
53 ; CHECK: !prof ![[COUNT2]]
54 define internal void @foo_local_inline() #0 {
58 ; CHECK-LABEL: define internal void @foo_local_cold() #2
59 ; CHECK: !prof ![[COUNT4]]
60 define internal void @foo_local_cold() #2 {
64 ; CHECK-LABEL: define linkonce void @foo_linkonce()
65 ; CHECK: !prof ![[COUNT1]]
66 define linkonce void @foo_linkonce() {
70 ; CHECK: ![[COUNT1]] = !{!"synthetic_function_entry_count", i64 10}
71 ; CHECK: ![[COUNT2]] = !{!"synthetic_function_entry_count", i64 15}
72 ; CHECK: ![[COUNT3]] = !{!"synthetic_function_entry_count", i64 5}
73 ; CHECK: ![[COUNT4]] = !{!"synthetic_function_entry_count", i64 0}
75 attributes #0 = {inlinehint}
76 attributes #1 = {alwaysinline}
77 attributes #2 = {cold}
78 attributes #3 = {noinline}