blob: 9932f527dc602a485a5ca923b149ba5d2d410592 [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 Bolvanskyc0aa4b72018-08-05 14:53:08 +000028; YAML-NEXT: - String: ' with '
29; YAML-NEXT: - String: '(cost='
Sam Elliotte604b562017-08-21 16:45:47 +000030; YAML-NEXT: - Cost: '-15000'
David Bolvanskyc0aa4b72018-08-05 14:53:08 +000031; YAML-NEXT: - String: ', threshold='
Sam Elliotte604b562017-08-21 16:45:47 +000032; YAML-NEXT: - Threshold: '337'
33; YAML-NEXT: - String: ')'
Davide Italiano6cb6f992017-02-12 05:05:35 +000034; YAML-NEXT: ...
35
David Bolvanskyc0aa4b72018-08-05 14:53:08 +000036; CHECK: tinkywinky inlined into main with (cost=-15000, threshold=337) (hotness: 300)
Teresa Johnsonb77ab092018-05-04 23:59:34 +000037
Davide Italiano6cb6f992017-02-12 05:05:35 +000038target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
39target triple = "x86_64-scei-ps4"
40
41declare i32 @patatino()
42
43define i32 @tinkywinky() {
44 %a = call i32 @patatino()
45 ret i32 %a
46}
47
48define i32 @main() !prof !0 {
49 %i = call i32 @tinkywinky()
50 ret i32 %i
51}
52
53!0 = !{!"function_entry_count", i64 300}