1; REQUIRES: x86 2; RUN: llvm-as %s -o %t.o 3 4; RUN: rm -f %t.yaml %t1.yaml %t.hot.yaml %t.t300.yaml %t.t301.yaml 5; RUN: ld.lld --opt-remarks-filename %t.yaml %t.o -o %t -shared -save-temps 6; RUN: llvm-dis %t.0.4.opt.bc -o - | FileCheck %s 7; RUN: ld.lld --opt-remarks-with-hotness --opt-remarks-filename %t.hot.yaml \ 8; RUN: %t.o -o %t -shared 9; RUN: ld.lld --opt-remarks-with-hotness --opt-remarks-hotness-threshold=300 \ 10; RUN: --opt-remarks-filename %t.t300.yaml %t.o -o %t -shared 11; RUN: ld.lld --opt-remarks-with-hotness --opt-remarks-hotness-threshold=301 \ 12; RUN: --opt-remarks-filename %t.t301.yaml %t.o -o %t -shared 13; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML 14; RUN: cat %t.hot.yaml | FileCheck %s -check-prefix=YAML-HOT 15; RUN: FileCheck %s -check-prefix=YAML-HOT < %t.t300.yaml 16; RUN: count 0 < %t.t301.yaml 17; RUN: ld.lld --opt-remarks-filename %t1.yaml --opt-remarks-passes inline %t.o \ 18; RUN: -o /dev/null -shared 19; RUN: cat %t1.yaml | FileCheck %s -check-prefix=YAML-PASSES 20; RUN: ld.lld --opt-remarks-filename %t1.yaml --opt-remarks-format yaml %t.o \ 21; RUN: -o /dev/null -shared 22; RUN: FileCheck %s -check-prefix=YAML < %t1.yaml 23 24; Check that @tinkywinky is inlined after optimizations. 25; CHECK-LABEL: define i32 @main 26; CHECK-NEXT: %a.i = {{.*}}call i32 @patatino() 27; CHECK-NEXT: ret i32 %a.i 28; CHECK-NEXT: } 29 30; YAML: --- !Passed 31; YAML-NEXT: Pass: inline 32; YAML-NEXT: Name: Inlined 33; YAML-NEXT: Function: main 34; YAML-NEXT: Args: 35; YAML-NEXT: - Callee: tinkywinky 36; YAML-NEXT: - String: ' inlined into ' 37; YAML-NEXT: - Caller: main 38; YAML-NEXT: - String: ' with ' 39; YAML-NEXT: - String: '(cost=' 40; YAML-NEXT: - Cost: '0' 41; YAML-NEXT: - String: ', threshold=' 42; YAML-NEXT: - Threshold: '337' 43; YAML-NEXT: - String: ')' 44; YAML-NEXT: ... 45 46; YAML-HOT: --- !Passed 47; YAML-HOT-NEXT: Pass: inline 48; YAML-HOT-NEXT: Name: Inlined 49; YAML-HOT-NEXT: Function: main 50; YAML-HOT-NEXT: Hotness: 300 51; YAML-HOT-NEXT: Args: 52; YAML-HOT-NEXT: - Callee: tinkywinky 53; YAML-HOT-NEXT: - String: ' inlined into ' 54; YAML-HOT-NEXT: - Caller: main 55; YAML-HOT-NEXT: - String: ' with ' 56; YAML-HOT-NEXT: - String: '(cost=' 57; YAML-HOT-NEXT: - Cost: '0' 58; YAML-HOT-NEXT: - String: ', threshold=' 59; YAML-HOT-NEXT: - Threshold: '337' 60; YAML-HOT-NEXT: - String: ')' 61; YAML-HOT-NEXT: ... 62 63; YAML-PASSES: Pass: inline 64 65target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 66target triple = "x86_64-scei-ps4" 67 68declare i32 @patatino() 69 70define i32 @tinkywinky() { 71 %a = call i32 @patatino() 72 ret i32 %a 73} 74 75define i32 @main() !prof !0 { 76 %i = call i32 @tinkywinky() 77 ret i32 %i 78} 79 80!0 = !{!"function_entry_count", i64 300} 81