mirror of
https://github.com/RPCSX/llvm.git
synced 2026-01-31 01:05:23 +01:00
This patch provides the following infrastructure for PGO enhancements in inliner: Enable the use of block level profile information in inliner Incremental update of block frequency information during inlining Update the function entry counts of callees when they get inlined into callers. Differential Revision: http://reviews.llvm.org/D16381 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262636 91177308-0d34-0410-b5e6-96231b3b80d8
28 lines
658 B
LLVM
28 lines
658 B
LLVM
; RUN: opt < %s -inline -S | FileCheck %s
|
|
|
|
; This tests that the function count of a callee gets correctly updated after it
|
|
; has been inlined into a two callsites.
|
|
|
|
; CHECK: @callee() !prof [[COUNT:![0-9]+]]
|
|
define i32 @callee() !prof !1 {
|
|
ret i32 0
|
|
}
|
|
|
|
define i32 @caller1() !prof !2 {
|
|
%i = call i32 @callee()
|
|
ret i32 %i
|
|
}
|
|
|
|
define i32 @caller2() !prof !3 {
|
|
%i = call i32 @callee()
|
|
ret i32 %i
|
|
}
|
|
|
|
!llvm.module.flags = !{!0}
|
|
; CHECK: [[COUNT]] = !{!"function_entry_count", i64 0}
|
|
!0 = !{i32 1, !"MaxFunctionCount", i32 1000}
|
|
!1 = !{!"function_entry_count", i64 1000}
|
|
!2 = !{!"function_entry_count", i64 600}
|
|
!3 = !{!"function_entry_count", i64 400}
|
|
|