OSDN Git Service

Emit only A Single Opt Remark When Inlining
[android-x86/external-llvm.git] / test / LTO / Resolution / X86 / diagnostic-handler-remarks-with-hotness.ll
1 ; RUN: llvm-as < %s >%t.bc
2
3 ; RUN: rm -f %t.yaml
4 ; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \
5 ; RUN:           -pass-remarks-with-hotness \
6 ; RUN:           -r %t.bc,tinkywinky,p \
7 ; RUN:           -r %t.bc,patatino,px \
8 ; RUN:           -r %t.bc,main,px -o %t.o %t.bc
9 ; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML
10
11 ; YAML: --- !Passed
12 ; YAML-NEXT: Pass:            inline
13 ; YAML-NEXT: Name:            Inlined
14 ; YAML-NEXT: Function:        main
15 ; YAML-NEXT: Hotness:         300
16 ; YAML-NEXT: Args:
17 ; YAML-NEXT:   - Callee:          tinkywinky
18 ; YAML-NEXT:   - String:          ' inlined into '
19 ; YAML-NEXT:   - Caller:          main
20 ; YAML-NEXT:   - String:          ' with cost='
21 ; YAML-NEXT:   - Cost:            '-15000'
22 ; YAML-NEXT:   - String:          ' (threshold='
23 ; YAML-NEXT:   - Threshold:       '337'
24 ; YAML-NEXT:   - String:          ')'
25 ; YAML-NEXT: ...
26
27 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
28 target triple = "x86_64-scei-ps4"
29
30 declare i32 @patatino()
31
32 define i32 @tinkywinky() {
33   %a = call i32 @patatino()
34   ret i32 %a
35 }
36
37 define i32 @main() !prof !0 {
38   %i = call i32 @tinkywinky()
39   ret i32 %i
40 }
41
42 !0 = !{!"function_entry_count", i64 300}