| 1 |
; For SamplePGO, if -profile-sample-accurate is specified, cold callsite |
| 2 |
; heuristics should be honored if the caller has no profile. |
| 3 |
|
| 4 |
; RUN: opt -S %s -passes='sample-profile,cgscc(inline)' -sample-profile-file=%S/Inputs/inline.prof -inline-cold-callsite-threshold=0 | FileCheck %s |
| 5 |
; RUN: opt -S %s -passes='sample-profile,cgscc(inline)' -sample-profile-file=%S/Inputs/inline.prof -profile-sample-accurate -inline-cold-callsite-threshold=0 | FileCheck %s --check-prefix ACCURATE |
| 6 |
|
| 7 |
declare void @extern() |
| 8 |
define void @callee() #1 { |
| 9 |
call void @extern() |
| 10 |
ret void |
| 11 |
} |
| 12 |
|
| 13 |
define void @caller(i32 %y1) #1 { |
| 14 |
; CHECK-LABEL: @caller |
| 15 |
; CHECK-NOT: call void @callee |
| 16 |
; ACCURATE-LABEL: @caller |
| 17 |
; ACCURATE: call void @callee |
| 18 |
call void @callee() |
| 19 |
ret void |
| 20 |
} |
| 21 |
|
| 22 |
define void @caller_accurate(i32 %y1) #0 { |
| 23 |
; CHECK-LABEL: @caller_accurate |
| 24 |
; CHECK: call void @callee |
| 25 |
; ACCURATE-LABEL: @caller_accurate |
| 26 |
; ACCURATE: call void @callee |
| 27 |
call void @callee() |
| 28 |
ret void |
| 29 |
} |
| 30 |
|
| 31 |
attributes #0 = { "profile-sample-accurate" "use-sample-profile" } |
| 32 |
attributes #1 = { "use-sample-profile" } |