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 -inline -S -inline-cold-callsite-threshold=0 | FileCheck %s 5 6define i32 @callee(i32 %x) { 7 %x1 = add i32 %x, 1 8 %x2 = add i32 %x1, 1 9 %x3 = add i32 %x2, 1 10 call void @extern() 11 call void @extern() 12 ret i32 %x3 13} 14 15define i32 @caller(i32 %y1) { 16; CHECK-LABEL: @caller 17; CHECK-NOT: call i32 @callee 18 %y2 = call i32 @callee(i32 %y1) 19 ret i32 %y2 20} 21 22define i32 @caller_accurate(i32 %y1) #0 { 23; CHECK-LABEL: @caller_accurate 24; CHECK: call i32 @callee 25 %y2 = call i32 @callee(i32 %y1) 26 ret i32 %y2 27} 28 29declare void @extern() 30 31attributes #0 = { "profile-sample-accurate" } 32 33!llvm.module.flags = !{!1} 34!1 = !{i32 1, !"ProfileSummary", !2} 35!2 = !{!3, !4, !5, !6, !7, !8, !9, !10} 36!3 = !{!"ProfileFormat", !"SampleProfile"} 37!4 = !{!"TotalCount", i64 10000} 38!5 = !{!"MaxCount", i64 1000} 39!6 = !{!"MaxInternalCount", i64 1} 40!7 = !{!"MaxFunctionCount", i64 1000} 41!8 = !{!"NumCounts", i64 3} 42!9 = !{!"NumFunctions", i64 3} 43!10 = !{!"DetailedSummary", !11} 44!11 = !{!12, !13, !14} 45!12 = !{i32 10000, i64 100, i32 1} 46!13 = !{i32 999000, i64 100, i32 1} 47!14 = !{i32 999999, i64 1, i32 2} 48