1; RUN: opt -module-summary %s -o %t1.bc 2; RUN: opt -module-summary %p/Inputs/diagnostic-handler-remarks.ll -o %t2.bc 3 4; Optimization records are collected regardless of the diagnostic handler 5; RUN: rm -f %t.yaml.thin.0.yaml %t.yaml.thin.1.yaml 6; RUN: llvm-lto -thinlto-action=run \ 7; RUN: -lto-pass-remarks-output=%t.yaml \ 8; RUN: -lto-pass-remarks-filter=inline \ 9; RUN: -lto-pass-remarks-format=yaml \ 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: 15 16 17; Verify that bar is imported 'and' inlined into 'foo' 18; RUN: cat %t.yaml.thin.0.yaml | FileCheck %s -check-prefixes=YAML1,YAML1-NO-ANNOTATE 19 20; Verify that bar is imported 'and' inlined into 'foo' 21; RUN: cat %t.yaml.thin.1.yaml | FileCheck %s -check-prefixes=YAML2,YAML2-NO-ANNOTATE 22 23; Try again with -annotate-inline-phase 24; RUN: rm -f %t.yaml.thin.0.yaml %t.yaml.thin.1.yaml 25; RUN: llvm-lto -thinlto-action=run \ 26; RUN: -annotate-inline-phase \ 27; RUN: -lto-pass-remarks-output=%t.yaml \ 28; RUN: -lto-pass-remarks-filter=inline \ 29; RUN: -lto-pass-remarks-format=yaml \ 30; RUN: -exported-symbol _func2 \ 31; RUN: -exported-symbol _main %t1.bc %t2.bc 2>&1 | \ 32; RUN: FileCheck %s -allow-empty 33; CHECK-NOT: remark: 34; CHECK-NOT: llvm-lto: 35 36; Verify thati inline happens the same way and pass name are annotated with LTO phase information. 37; RUN: cat %t.yaml.thin.0.yaml | FileCheck %s -check-prefixes=YAML1,YAML1-ANNOTATE 38 39; Verify that bar is imported 'and' inlined into 'foo' 40; RUN: cat %t.yaml.thin.1.yaml | FileCheck %s -check-prefixes=YAML2,YAML2-ANNOTATE 41 42; YAML1: --- !Passed 43; YAML1: --- !Passed 44; YAML1-NO-ANNOTATE: Pass: inline 45; YAML1-ANNOTATE-NEXT: Pass: postlink-cgscc-inline 46; YAML1-NEXT: Name: Inlined 47; YAML1-NEXT: Function: main 48; YAML1-NEXT: Args: 49; YAML1-NEXT: - String: '''' 50; YAML1-NEXT: - Callee: foo 51; YAML1-NEXT: - String: ''' inlined into ' 52; YAML1-NEXT: - Caller: main 53; YAML1-NEXT: - String: '''' 54; YAML1-NEXT: - String: ' with ' 55; YAML1-NEXT: - String: '(cost=' 56; YAML1-NEXT: - Cost: '-30' 57; YAML1-NEXT: - String: ', threshold=' 58; YAML1-NEXT: - Threshold: '375' 59; YAML1-NEXT: - String: ')' 60; YAML1-NEXT: ... 61 62; YAML2: --- !Passed 63; YAML2-NO-ANNOTATE: Pass: inline 64; YAML2-ANNOTATE-NEXT: Pass: postlink-cgscc-inline 65; YAML2-NEXT: Name: Inlined 66; YAML2-NEXT: Function: foo 67; YAML2-NEXT: Args: 68; YAML2-NEXT: - String: '''' 69; YAML2-NEXT: - Callee: bar 70; YAML2-NEXT: - String: ''' inlined into ' 71; YAML2-NEXT: - Caller: foo 72; YAML2-NEXT: - String: '''' 73; YAML2-NEXT: - String: ' with ' 74; YAML2-NEXT: - String: '(cost=' 75; YAML2-NEXT: - Cost: '-30' 76; YAML2-NEXT: - String: ', threshold=' 77; YAML2-NEXT: - Threshold: '375' 78; YAML2-NEXT: - String: ')' 79; YAML2-NEXT: ... 80 81; The file extension depends on the format of the remarks 82; RUN: rm -f %t.bitstream.thin.0.bitstream %t.bitstream.thin.1.bitstream 83; RUN: llvm-lto -thinlto-action=run \ 84; RUN: -lto-pass-remarks-output=%t.bitstream \ 85; RUN: -lto-pass-remarks-filter=inline \ 86; RUN: -lto-pass-remarks-format=bitstream \ 87; RUN: -exported-symbol _func2 \ 88; RUN: -exported-symbol _main %t1.bc %t2.bc 2>&1 | \ 89; RUN: FileCheck %s -allow-empty 90; RUN: llvm-bcanalyzer %t.bitstream.thin.0.bitstream 91; RUN: llvm-bcanalyzer %t.bitstream.thin.1.bitstream 92; CHECK-NOT: remark: 93; CHECK-NOT: llvm-lto: 94 95target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 96target triple = "x86_64-apple-macosx10.11.0" 97 98define i32 @bar() { 99 ret i32 42 100} 101declare i32 @foo() 102define i32 @main() { 103 %i = call i32 @foo() 104 ret i32 %i 105} 106 107