brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · ccfe2f0 Raw
57 lines · plain
1; RUN: opt < %s -passes='require<profile-summary>,cgscc(inline)' -inline-threshold=0 -inlinehint-threshold=0 -hot-callsite-threshold=100 -S | FileCheck %s2 3; This tests that a callsite which is determined to be hot based on the caller's4; entry count and the callsite block frequency gets the hot-callsite-threshold.5; Another callsite with the same callee that is not hot does not get inlined6; because cost exceeds the inline-threshold. inlinthint-threshold is set to 07; to ensure callee's hotness is not used to boost the threshold.8 9define i32 @callee1(i32 %x) !prof !21 {10  %x1 = add i32 %x, 111  %x2 = add i32 %x1, 112  %x3 = add i32 %x2, 113  call void @extern()14  ret i32 %x315}16 17define i32 @caller(i32 %n) !prof !22 {18; CHECK-LABEL: @caller(19  %cond = icmp sle i32 %n, 10020  br i1 %cond, label %cond_true, label %cond_false, !prof !021 22cond_true:23; CHECK-LABEL: cond_true:24; CHECK-NOT: call i32 @callee125; CHECK: ret i32 %x3.i26  %i = call i32 @callee1(i32 %n)27  ret i32 %i28cond_false:29; CHECK-LABEL: cond_false:30; CHECK: call i32 @callee131; CHECK: ret i32 %j32  %j = call i32 @callee1(i32 %n)33  ret i32 %j34}35declare void @extern()36 37!0 = !{!"branch_weights", i32 64, i32 4}38 39!llvm.module.flags = !{!1}40!21 = !{!"function_entry_count", i64 200}41!22 = !{!"function_entry_count", i64 200}42 43!1 = !{i32 1, !"ProfileSummary", !2}44!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}45!3 = !{!"ProfileFormat", !"InstrProf"}46!4 = !{!"TotalCount", i64 10000}47!5 = !{!"MaxCount", i64 1000}48!6 = !{!"MaxInternalCount", i64 1}49!7 = !{!"MaxFunctionCount", i64 1000}50!8 = !{!"NumCounts", i64 3}51!9 = !{!"NumFunctions", i64 3}52!10 = !{!"DetailedSummary", !11}53!11 = !{!12, !13, !14}54!12 = !{i32 10000, i64 100, i32 1}55!13 = !{i32 999000, i64 100, i32 1}56!14 = !{i32 999999, i64 1, i32 2}57