brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 48d02e5 Raw
58 lines · plain
1; RUN: opt < %s -codegenprepare -S | FileCheck %s2 3target triple = "x86_64-pc-linux-gnu"4 5; This tests that hot/cold functions get correct section prefix assigned6 7; CHECK: hot_func{{.*}}!section_prefix ![[HOT_ID:[0-9]+]]8; The entry is hot9define void @hot_func() !prof !15 {10  ret void11}12 13; CHECK: hot_call_func{{.*}}!section_prefix ![[HOT_ID]]14; The sum of 2 callsites are hot15define void @hot_call_func() !prof !16 {16  call void @hot_func(), !prof !1717  call void @hot_func(), !prof !1718  ret void19}20 21; CHECK-NOT: normal_func{{.*}}!section_prefix22; The sum of all callsites are neither hot or cold23define void @normal_func() !prof !16 {24  call void @hot_func(), !prof !1725  call void @hot_func(), !prof !1826  call void @hot_func(), !prof !1827  ret void28}29 30; CHECK: cold_func{{.*}}!section_prefix ![[COLD_ID:[0-9]+]]31; The entry and the callsite are both cold32define void @cold_func() !prof !16 {33  call void @hot_func(), !prof !1834  ret void35}36 37; CHECK: ![[HOT_ID]] = !{!"section_prefix", !"hot"}38; CHECK: ![[COLD_ID]] = !{!"section_prefix", !"unlikely"}39!llvm.module.flags = !{!1}40!1 = !{i32 1, !"ProfileSummary", !2}41!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}42!3 = !{!"ProfileFormat", !"SampleProfile"}43!4 = !{!"TotalCount", i64 10000}44!5 = !{!"MaxCount", i64 1000}45!6 = !{!"MaxInternalCount", i64 1}46!7 = !{!"MaxFunctionCount", i64 1000}47!8 = !{!"NumCounts", i64 3}48!9 = !{!"NumFunctions", i64 3}49!10 = !{!"DetailedSummary", !11}50!11 = !{!12, !13, !14}51!12 = !{i32 10000, i64 100, i32 1}52!13 = !{i32 999000, i64 100, i32 1}53!14 = !{i32 999999, i64 1, i32 2}54!15 = !{!"function_entry_count", i64 1000}55!16 = !{!"function_entry_count", i64 1}56!17 = !{!"branch_weights", i32 80}57!18 = !{!"branch_weights", i32 1}58