This PR implements the emitting of the post-link CFG information in PGO analysis map, as explained in the [RFC](https://discourse.llvm.org/t/rfc-extending-the-pgo-analysis-map-with-propeller-cfg-frequencies/88617). This is enabled by a flag `pgo-analysis-map-emit-bb-sections-cfg`. This PR bumps the SHT_LLVM_BB_ADDR_MAP version to 5. Also includes some refactoring changes related to storing the CFG in the Basic block sections profile reader.
26 lines
791 B
LLVM
26 lines
791 B
LLVM
;; Verify that the BB address map is not emitted for empty functions.
|
|
; RUN: llc < %s -mtriple=x86_64 -basic-block-address-map | FileCheck %s --check-prefixes=CHECK,BASIC
|
|
; RUN: llc < %s -mtriple=x86_64 -basic-block-address-map -pgo-analysis-map=func-entry-count,bb-freq | FileCheck %s --check-prefixes=CHECK,PGO
|
|
|
|
define void @empty_func() {
|
|
entry:
|
|
unreachable
|
|
}
|
|
; CHECK: {{^ *}}.text{{$}}
|
|
; CHECK: empty_func:
|
|
; CHECK: .Lfunc_begin0:
|
|
; CHECK-NOT: .section .llvm_bb_addr_map
|
|
|
|
define void @func() {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
; CHECK: func:
|
|
; CHECK: .Lfunc_begin1:
|
|
; CHECK: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text{{$}}
|
|
; CHECK-NEXT: .byte 5 # version
|
|
; BASIC-NEXT: .short 0 # feature
|
|
; PGO-NEXT: .short 3 # feature
|
|
; CHECK-NEXT: .quad .Lfunc_begin1 # function address
|