1 ; RUN: llvm-as < %s >%t.bc 2 3 ; Check pass remarks emitted to YAML file 4 ; RUN: rm -f %t.yaml 5 ; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \ 6 ; RUN: -pass-remarks-with-hotness \ 7 ; RUN: -r %t.bc,tinkywinky,p \ 8 ; RUN: -r %t.bc,patatino,px \ 9 ; RUN: -r %t.bc,main,px -o %t.o %t.bc 10 ; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML 11 12 ; Check pass remarks emitted to stderr 13 ; RUN: llvm-lto2 run -pass-remarks=inline \ 14 ; RUN: -pass-remarks-with-hotness \ 15 ; RUN: -r %t.bc,tinkywinky,p \ 16 ; RUN: -r %t.bc,patatino,px \ 17 ; RUN: -r %t.bc,main,px -o %t.o %t.bc 2>&1 | FileCheck %s 18 19 ; YAML: --- !Passed 20 ; YAML-NEXT: Pass: inline 21 ; YAML-NEXT: Name: Inlined 22 ; YAML-NEXT: Function: main 23 ; YAML-NEXT: Hotness: 300 24 ; YAML-NEXT: Args: 25 ; YAML-NEXT: - Callee: tinkywinky 26 ; YAML-NEXT: - String: ' inlined into ' 27 ; YAML-NEXT: - Caller: main 28 ; YAML-NEXT: - String: ' with cost=' 29 ; YAML-NEXT: - Cost: '-15000' 30 ; YAML-NEXT: - String: ' (threshold=' 31 ; YAML-NEXT: - Threshold: '337' 32 ; YAML-NEXT: - String: ')' 33 ; YAML-NEXT: ... 34 35 ; CHECK: tinkywinky inlined into main with cost=-15000 (threshold=337) (hotness: 300) 36 37 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 38 target triple = "x86_64-scei-ps4" 39 40 declare i32 @patatino() 41 42 define i32 @tinkywinky() { 43 %a = call i32 @patatino() 44 ret i32 %a 45 } 46 47 define i32 @main() !prof !0 { 48 %i = call i32 @tinkywinky() 49 ret i32 %i 50 } 51 52 !0 = !{!"function_entry_count", i64 300} 53