1 ; COM: Emitting basic-block-address-map when machine function splitting is enabled.
2 ; RUN: llc < %s -mtriple=x86_64 -function-sections -split-machine-functions -basic-block-address-map | FileCheck %s --check-prefixes=CHECK,BASIC
4 ; COM: Emitting basic-block-address-map with PGO analysis with machine function splitting enabled.
5 ; RUN: llc < %s -mtriple=x86_64 -function-sections -split-machine-functions -basic-block-address-map -pgo-analysis-map=func-entry-count,bb-freq,br-prob | FileCheck %s --check-prefixes=CHECK,PGO
7 define void @foo(i1 zeroext %0) nounwind !prof !14 {
8 br i1 %0, label %2, label %4, !prof !15
19 %7 = tail call i32 @qux()
27 !llvm.module.flags = !{!0}
28 !0 = !{i32 1, !"ProfileSummary", !1}
29 !1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
30 !2 = !{!"ProfileFormat", !"InstrProf"}
31 !3 = !{!"TotalCount", i64 10000}
32 !4 = !{!"MaxCount", i64 10}
33 !5 = !{!"MaxInternalCount", i64 1}
34 !6 = !{!"MaxFunctionCount", i64 1000}
35 !7 = !{!"NumCounts", i64 3}
36 !8 = !{!"NumFunctions", i64 5}
37 !9 = !{!"DetailedSummary", !10}
38 !10 = !{!11, !12, !13}
39 !11 = !{i32 10000, i64 100, i32 1}
40 !12 = !{i32 999900, i64 100, i32 1}
41 !13 = !{i32 999999, i64 1, i32 2}
42 !14 = !{!"function_entry_count", i64 7000}
43 !15 = !{!"branch_weights", i32 7000, i32 0}
45 ; CHECK: .section .text.hot.foo,"ax",@progbits
47 ; CHECK-LABEL: .Lfunc_begin0:
48 ; CHECK-LABEL: .LBB_END0_0:
49 ; CHECK-LABEL: .LBB0_1:
50 ; CHECK-LABEL: .LBB_END0_1:
51 ; CHECK: .section .text.split.foo,"ax",@progbits
52 ; CHECK-LABEL: foo.cold:
53 ; CHECK-LABEL: .LBB_END0_2:
54 ; CHECK-LABEL: .Lfunc_end0:
56 ; CHECK: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text.hot.foo
57 ; CHECK-NEXT: .byte 2 # version
58 ; BASIC-NEXT: .byte 8 # feature
59 ; PGO-NEXT: .byte 15 # feature
60 ; CHECK-NEXT: .byte 2 # number of basic block ranges
61 ; CHECK-NEXT: .quad .Lfunc_begin0 # base address
62 ; CHECK-NEXT: .byte 2 # number of basic blocks
63 ; CHECK-NEXT: .byte 0 # BB id
64 ; CHECK-NEXT: .uleb128 .Lfunc_begin0-.Lfunc_begin0
65 ; CHECK-NEXT: .uleb128 .LBB_END0_0-.Lfunc_begin0
67 ; CHECK-NEXT: .byte 1 # BB id
68 ; CHECK-NEXT: .uleb128 .LBB0_1-.LBB_END0_0
69 ; CHECK-NEXT: .uleb128 .LBB_END0_1-.LBB0_1
71 ; CHECK-NEXT: .quad foo.cold # base address
72 ; CHECK-NEXT: .byte 1 # number of basic blocks
73 ; CHECK-NEXT: .byte 2 # BB id
74 ; CHECK-NEXT: .uleb128 foo.cold-foo.cold
75 ; CHECK-NEXT: .uleb128 .LBB_END0_2-foo.cold
79 ; PGO: .ascii "\3306" # function entry count
80 ; PGO-NEXT: .ascii "\200\200\200\200\200\200\200 " # basic block frequency
81 ; PGO-NEXT: .byte 2 # basic block successor count
82 ; PGO-NEXT: .byte 1 # successor BB ID
83 ; PGO-NEXT: .ascii "\200\200\200\200\b" # successor branch probability
84 ; PGO-NEXT: .byte 2 # successor BB ID
85 ; PGO-NEXT: .byte 0 # successor branch probability
86 ; PGO-NEXT: .ascii "\200\200\200\374\377\377\377\037" # basic block frequency
87 ; PGO-NEXT: .byte 0 # basic block successor count
88 ; PGO-NEXT: .ascii "\200\200\200\004" # basic block frequency
89 ; PGO-NEXT: .byte 0 # basic block successor count