2019-04-17 12:52:47 +08:00
|
|
|
; For SamplePGO, if -profile-sample-accurate is specified, cold callsite
|
|
|
|
; heuristics should be honored if the caller has no profile.
|
|
|
|
|
|
|
|
; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.prof -inline -S -inline-cold-callsite-threshold=0 | FileCheck %s
|
|
|
|
; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.prof -profile-sample-accurate -inline -S -inline-cold-callsite-threshold=0 | FileCheck %s --check-prefix ACCURATE
|
|
|
|
|
|
|
|
declare void @extern()
|
2020-05-15 03:05:49 +08:00
|
|
|
define void @callee() #1 {
|
2019-04-17 12:52:47 +08:00
|
|
|
call void @extern()
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2020-05-15 03:05:49 +08:00
|
|
|
define void @caller(i32 %y1) #1 {
|
2019-04-17 12:52:47 +08:00
|
|
|
; CHECK-LABEL: @caller
|
|
|
|
; CHECK-NOT: call void @callee
|
|
|
|
; ACCURATE-LABEL: @caller
|
|
|
|
; ACCURATE: call void @callee
|
|
|
|
call void @callee()
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @caller_accurate(i32 %y1) #0 {
|
|
|
|
; CHECK-LABEL: @caller_accurate
|
|
|
|
; CHECK: call void @callee
|
|
|
|
; ACCURATE-LABEL: @caller_accurate
|
|
|
|
; ACCURATE: call void @callee
|
|
|
|
call void @callee()
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2020-05-15 03:05:49 +08:00
|
|
|
attributes #0 = { "profile-sample-accurate" "use-sample-profile" }
|
|
|
|
attributes #1 = { "use-sample-profile" }
|