1 ; Test plugin options for opt-remarks.
2 ; RUN: llvm-as %s -o %t.o
3 ; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext -shared \
4 ; RUN: -plugin-opt=save-temps \
5 ; RUN: -plugin-opt=opt-remarks-passes=inline \
6 ; RUN: -plugin-opt=opt-remarks-format=yaml \
7 ; RUN: -plugin-opt=opt-remarks-filename=%t.yaml %t.o -o %t2.o 2>&1
8 ; RUN: llvm-dis %t2.o.0.4.opt.bc -o - | FileCheck %s
9 ; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext -shared \
10 ; RUN: -plugin-opt=opt-remarks-passes=inline \
11 ; RUN: -plugin-opt=opt-remarks-format=yaml \
12 ; RUN: -plugin-opt=opt-remarks-with-hotness \
13 ; RUN: -plugin-opt=opt-remarks-filename=%t.hot.yaml %t.o -o %t2.o 2>&1
14 ; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML
15 ; RUN: cat %t.hot.yaml | FileCheck %s -check-prefix=YAML-HOT
17 ; Check that @f is inlined after optimizations.
18 ; CHECK-LABEL: define i32 @_start
19 ; CHECK-NEXT: %a.i = tail call i32 @bar()
20 ; CHECK-NEXT: ret i32 %a.i
24 ; YAML-NEXT: Pass: inline
25 ; YAML-NEXT: Name: NoDefinition
26 ; YAML-NEXT: Function: f
28 ; YAML-NEXT: - Callee: bar
29 ; YAML-NEXT: - String: ' will not be inlined into '
30 ; YAML-NEXT: - Caller: f
31 ; YAML-NEXT: - String: ' because its definition is unavailable'
33 ; YAML-NEXT: --- !Passed
34 ; YAML-NEXT: Pass: inline
35 ; YAML-NEXT: Name: Inlined
36 ; YAML-NEXT: Function: _start
38 ; YAML-NEXT: - Callee: f
39 ; YAML-NEXT: - String: ' inlined into '
40 ; YAML-NEXT: - Caller: _start
41 ; YAML-NEXT: - String: ' with '
42 ; YAML-NEXT: - String: '(cost='
43 ; YAML-NEXT: - Cost: '0'
44 ; YAML-NEXT: - String: ', threshold='
45 ; YAML-NEXT: - Threshold: '337'
46 ; YAML-NEXT: - String: ')'
50 ; YAML-HOT: --- !Passed
51 ; YAML-HOT: Pass: inline
52 ; YAML-HOT-NEXT: Name: Inlined
53 ; YAML-HOT-NEXT: Function: _start
54 ; YAML-HOT-NEXT: Hotness: 300
55 ; YAML-HOT-NEXT: Args:
56 ; YAML-HOT-NEXT: - Callee: f
57 ; YAML-HOT-NEXT: - String: ' inlined into '
58 ; YAML-HOT-NEXT: - Caller: _start
59 ; YAML-HOT-NEXT: - String: ' with '
60 ; YAML-HOT-NEXT: - String: '(cost='
61 ; YAML-HOT-NEXT: - Cost: '0'
62 ; YAML-HOT-NEXT: - String: ', threshold='
63 ; YAML-HOT-NEXT: - Threshold: '337'
64 ; YAML-HOT-NEXT: - String: ')'
67 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
68 target triple = "x86_64-unknown-linux-gnu"
77 define i32 @_start() !prof !0 {
82 !0 = !{!"function_entry_count", i64 300}