[flang][cuda] Do not register global constants (#118582)
[llvm-project.git] / llvm / test / ThinLTO / X86 / diagnostic-handler-remarks-with-hotness.ll
blob63f073779b451a53b32ae0e12051fbb37531dc30
1 ; RUN: opt -module-summary %s -o %t1.bc
2 ; RUN: opt -module-summary %p/Inputs/diagnostic-handler-remarks.ll -o %t2.bc
4 ; Check that the hotness attribute is included in the optimization record file
5 ; with -lto-pass-remarks-with-hotness.
7 ; RUN: llvm-lto -thinlto-action=run \
8 ; RUN:          -lto-pass-remarks-output=%t.yaml \
9 ; RUN:          -lto-pass-remarks-with-hotness \
10 ; RUN:          -exported-symbol _func2 \
11 ; RUN:          -exported-symbol _main %t1.bc %t2.bc 2>&1 | \
12 ; RUN:     FileCheck %s -allow-empty
13 ; CHECK-NOT: remark:
14 ; CHECK-NOT: llvm-lto:
16 ; Verify that bar is imported 'and' inlined into 'foo'
17 ; RUN: cat %t.yaml.thin.0.yaml | FileCheck %s -check-prefixes=YAML1,YAML1-NO-ANNOTATE
19 ; Verify that bar is imported 'and' inlined into 'foo'
20 ; RUN: cat %t.yaml.thin.1.yaml | FileCheck %s -check-prefixes=YAML2,YAML2-NO-ANNOTATE
22 ; Run again with -annotate-inline-phase
24 ; RUN: llvm-lto -thinlto-action=run \
25 ; RUN:          -lto-pass-remarks-output=%t.yaml \
26 ; RUN:          -annotate-inline-phase \
27 ; RUN:          -lto-pass-remarks-with-hotness \
28 ; RUN:          -exported-symbol _func2 \
29 ; RUN:          -exported-symbol _main %t1.bc %t2.bc 2>&1 | \
30 ; RUN:     FileCheck %s -allow-empty
31 ; CHECK-NOT: remark:
32 ; CHECK-NOT: llvm-lto:
34 ; Verify that pass name is annotated with LTO phase information.
35 ; RUN: cat %t.yaml.thin.0.yaml | FileCheck %s -check-prefixes=YAML1,YAML1-ANNOTATE
37 ; YAML1:      --- !Passed
38 ; YAML1:      --- !Passed
39 ; YAML1-NO-ANNOTATE-NEXT: Pass: inline
40 ; YAML1-ANNOTATE-NEXT: Pass:   postlink-cgscc-inline
41 ; YAML1-NEXT: Name:            Inlined
42 ; YAML1-NEXT: Function:        main
43 ; YAML1-NEXT: Hotness:         50
44 ; YAML1-NEXT: Args:
45 ; YAML1-NEXT:   - String:          ''''
46 ; YAML1-NEXT:   - Callee:          foo
47 ; YAML1-NEXT:   - String:          ''' inlined into '
48 ; YAML1-NEXT:   - Caller:          main
49 ; YAML1-NEXT:   - String:          ''''
50 ; YAML1-NEXT:   - String:          ' with '
51 ; YAML1-NEXT:   - String:          '(cost='
52 ; YAML1-NEXT:   - Cost:            '-30'
53 ; YAML1-NEXT:   - String:          ', threshold='
54 ; YAML1-NEXT:   - Threshold:       '375'
55 ; YAML1-NEXT:   - String:          ')'
56 ; YAML1-NEXT: ...
59 ; Verify that bar is imported 'and' inlined into 'foo'
60 ; RUN: cat %t.yaml.thin.1.yaml | FileCheck %s -check-prefixes=YAML2,YAML2-ANNOTATE
61 ; YAML2:      --- !Passed
62 ; YAML2-NO-ANNOTATE-NEXT: Pass:            inline
63 ; YAML2-ANNOTATE-NEXT: Pass:            postlink-cgscc-inline
64 ; YAML2-NEXT: Name:            Inlined
65 ; YAML2-NEXT: Function:        foo
66 ; YAML2-NEXT: Args:
67 ; YAML2-NEXT:   - String:          ''''
68 ; YAML2-NEXT:   - Callee:          bar
69 ; YAML2-NEXT:   - String:          ''' inlined into '
70 ; YAML2-NEXT:   - Caller:          foo
71 ; YAML2-NEXT:   - String:          ''''
72 ; YAML2-NEXT:   - String:          ' with '
73 ; YAML2-NEXT:   - String:          '(cost='
74 ; YAML2-NEXT:   - Cost:            '-30'
75 ; YAML2-NEXT:   - String:          ', threshold='
76 ; YAML2-NEXT:   - Threshold:       '375'
77 ; YAML2-NEXT:   - String:          ')'
78 ; YAML2-NEXT: ...
81 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
82 target triple = "x86_64-apple-macosx10.11.0"
84 define i32 @bar() {
85         ret i32 42
87 declare i32 @foo()
88 define i32 @main() !prof !0 {
89   %i = call i32 @foo()
90   ret i32 %i
93 !0 = !{!"function_entry_count", i64 50}