blob: c45dd4bcd0e53af85ebd754ea084aa8f738239e4 [file] [log] [blame]
Davide Italiano6cb6f992017-02-12 05:05:35 +00001; RUN: llvm-as < %s >%t.bc
2
Teresa Johnsonb77ab092018-05-04 23:59:34 +00003; Check pass remarks emitted to YAML file
Davide Italiano6cb6f992017-02-12 05:05:35 +00004; RUN: rm -f %t.yaml
Peter Collingbourne7faa60c2017-04-11 18:12:00 +00005; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \
Davide Italiano6cb6f992017-02-12 05:05:35 +00006; 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
Teresa Johnsonb77ab092018-05-04 23:59:34 +000012; 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
Davide Italiano6cb6f992017-02-12 05:05:35 +000019; 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
David Bolvanskyfbbb83c2018-08-01 08:02:40 +000028; YAML-NEXT: - String: ' with cost='
Sam Elliotte604b562017-08-21 16:45:47 +000029; YAML-NEXT: - Cost: '-15000'
David Bolvanskyfbbb83c2018-08-01 08:02:40 +000030; YAML-NEXT: - String: ' (threshold='
Sam Elliotte604b562017-08-21 16:45:47 +000031; YAML-NEXT: - Threshold: '337'
32; YAML-NEXT: - String: ')'
Davide Italiano6cb6f992017-02-12 05:05:35 +000033; YAML-NEXT: ...
34
David Bolvanskyfbbb83c2018-08-01 08:02:40 +000035; CHECK: tinkywinky inlined into main with cost=-15000 (threshold=337) (hotness: 300)
Teresa Johnsonb77ab092018-05-04 23:59:34 +000036
Davide Italiano6cb6f992017-02-12 05:05:35 +000037target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
38target triple = "x86_64-scei-ps4"
39
40declare i32 @patatino()
41
42define i32 @tinkywinky() {
43 %a = call i32 @patatino()
44 ret i32 %a
45}
46
47define i32 @main() !prof !0 {
48 %i = call i32 @tinkywinky()
49 ret i32 %i
50}
51
52!0 = !{!"function_entry_count", i64 300}