annotate test/ThinLTO/X86/diagnostic-handler-remarks-with-hotness.ll @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents
children c2174574ed3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; RUN: opt -module-summary %s -o %t1.bc
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ; RUN: opt -module-summary %p/Inputs/diagnostic-handler-remarks.ll -o %t2.bc
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 ; Check that the hotness attribute is included in the optimization record file
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 ; with -lto-pass-remarks-with-hotness.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 ; RUN: llvm-lto -thinlto-action=run \
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 ; RUN: -lto-pass-remarks-output=%t.yaml \
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 ; RUN: -lto-pass-remarks-with-hotness \
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 ; RUN: -exported-symbol _func2 \
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 ; RUN: -exported-symbol _main %t1.bc %t2.bc 2>&1 | \
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 ; RUN: FileCheck %s -allow-empty
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 ; CHECK-NOT: remark:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 ; CHECK-NOT: llvm-lto:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 ; Verify that bar is imported and inlined into foo
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 ; RUN: cat %t.yaml.thin.0.yaml | FileCheck %s -check-prefix=YAML1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 ; YAML1: --- !Passed
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 ; YAML1-NEXT: Pass: inline
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 ; YAML1-NEXT: Name: Inlined
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 ; YAML1-NEXT: Function: main
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 ; YAML1-NEXT: Hotness: 50
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 ; YAML1-NEXT: Args:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 ; YAML1-NEXT: - Callee: foo
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 ; YAML1-NEXT: - String: ' inlined into '
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 ; YAML1-NEXT: - Caller: main
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 ; YAML1-NEXT: - String: ' with cost='
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 ; YAML1-NEXT: - Cost: '-30'
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 ; YAML1-NEXT: - String: ' (threshold='
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 ; YAML1-NEXT: - Threshold: '337'
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 ; YAML1-NEXT: - String: ')'
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 ; YAML1-NEXT: ...
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 ; Verify that bar is imported and inlined into foo
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 ; RUN: cat %t.yaml.thin.1.yaml | FileCheck %s -check-prefix=YAML2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 ; YAML2: --- !Passed
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 ; YAML2-NEXT: Pass: inline
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 ; YAML2-NEXT: Name: Inlined
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 ; YAML2-NEXT: Function: foo
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 ; YAML2-NEXT: Args:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 ; YAML2-NEXT: - Callee: bar
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 ; YAML2-NEXT: - String: ' inlined into '
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 ; YAML2-NEXT: - Caller: foo
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 ; YAML2-NEXT: - String: ' with cost='
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 ; YAML2-NEXT: - Cost: '-30'
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 ; YAML2-NEXT: - String: ' (threshold='
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 ; YAML2-NEXT: - Threshold: '337'
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 ; YAML2-NEXT: - String: ')'
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 ; YAML2-NEXT: ...
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 target triple = "x86_64-apple-macosx10.11.0"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 define i32 @bar() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 ret i32 42
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 declare i32 @foo()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 define i32 @main() !prof !0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 %i = call i32 @foo()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 ret i32 %i
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 !0 = !{!"function_entry_count", i64 50}