105 lines · plain
1; RUN: opt < %s -S -passes=inline -pass-remarks-output=%t -pass-remarks=inline \2; RUN: -pass-remarks-missed=inline -pass-remarks-analysis=inline \3; RUN: -pass-remarks-with-hotness 2>&1 | FileCheck %s4; RUN: cat %t | FileCheck -check-prefixes=YAML,YAML-NO-ANNOTATE %s5 6; RUN: opt < %s -S -passes=inline -pass-remarks-output=%t -pass-remarks=inline \7; RUN: -pass-remarks-missed=inline -pass-remarks-analysis=inline \8; RUN: -pass-remarks-with-hotness 2>&1 | FileCheck %s9; RUN: cat %t | FileCheck -check-prefixes=YAML,YAML-NO-ANNOTATE %s10 11; RUN: opt < %s -S -passes=inline -pass-remarks-output=%t.bitstream -pass-remarks=inline \12; RUN: -pass-remarks-missed=inline -pass-remarks-analysis=inline \13; RUN: -pass-remarks-with-hotness -pass-remarks-format=bitstream 2>&1 | FileCheck %s14; RUN: llvm-remarkutil bitstream2yaml %t.bitstream | FileCheck -check-prefixes=YAML,YAML-NO-ANNOTATE %s15 16; RUN: opt < %s -S -passes=inliner-wrapper -pass-remarks-output=%t -pass-remarks=inline \17; RUN: -pass-remarks-missed=inline -pass-remarks-analysis=inline \18; RUN: -annotate-inline-phase=false \19; RUN: -pass-remarks-with-hotness 2>&1 | FileCheck %s20; RUN: cat %t | FileCheck -check-prefixes=YAML,YAML-NO-ANNOTATE %s21 22; RUN: opt < %s -S -passes=inliner-wrapper -pass-remarks-output=%t -pass-remarks=inline \23; RUN: -pass-remarks-missed=inline -pass-remarks-analysis=inline \24; RUN: -annotate-inline-phase \25; RUN: -pass-remarks-with-hotness 2>&1 | FileCheck %s26; RUN: cat %t | FileCheck -check-prefixes=YAML,YAML-ANNOTATE %s27 28; Check the YAML file for inliner-generated passed and analysis remarks. This29; is the input:30 31; 1 int foo() { return 1; }32; 233; 3 int bar() {34; 4 return foo();35; 5 }36 37; CHECK: remark: /tmp/s.c:4:10: 'foo' inlined into 'bar' with (cost={{[0-9\-]+}}, threshold={{[0-9]+}}) at callsite bar:1:10; (hotness: 30)38 39; YAML: --- !Passed40; YAML-NO-ANNOTATE-NEXT: Pass: inline41; YAML-ANNOTATE-NEXT: Pass: main-always-inline42; YAML-NEXT: Name: Inlined43; YAML-NEXT: DebugLoc: { File: '/tmp/s.c', Line: 4, Column: 10 }44; YAML-NEXT: Function: bar45; YAML-NEXT: Hotness: 3046; YAML-NEXT: Args:47; YAML-NEXT: - String: ''''48; YAML-NEXT: - Callee: foo49; YAML-NEXT: DebugLoc: { File: '/tmp/s.c', Line: 1, Column: 0 }50; YAML-NEXT: - String: ''' inlined into '''51; YAML-NEXT: - Caller: bar52; YAML-NEXT: DebugLoc: { File: '/tmp/s.c', Line: 3, Column: 0 }53; YAML-NEXT: - String: ''''54; YAML-NEXT: - String: ' with '55; YAML-NEXT: - String: '(cost='56; YAML-NEXT: - Cost: '{{[0-9\-]+}}'57; YAML-NEXT: - String: ', threshold='58; YAML-NEXT: - Threshold: '{{[0-9]+}}'59; YAML-NEXT: - String: ')'60; YAML-NEXT: - String: ' at callsite '61; YAML-NEXT: - String: bar62; YAML-NEXT: - String: ':'63; YAML-NEXT: - Line: '1'64; YAML-NEXT: - String: ':'65; YAML-NEXT: - Column: '10'66; YAML-NEXT: - String: ';'67; YAML-NEXT: ...68 69; ModuleID = '/tmp/s.c'70source_filename = "/tmp/s.c"71target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"72target triple = "x86_64-apple-macosx10.11.0"73 74; Function Attrs: nounwind ssp uwtable75define i32 @foo() !dbg !7 {76entry:77 ret i32 1, !dbg !978}79 80; Function Attrs: nounwind ssp uwtable81define i32 @bar() !dbg !10 !prof !13 {82entry:83 %call = call i32 @foo(), !dbg !1184 ret i32 %call, !dbg !1285}86 87!llvm.dbg.cu = !{!0}88!llvm.module.flags = !{!3, !4, !5}89!llvm.ident = !{!6}90 91!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 282540) (llvm/trunk 282542)", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2)92!1 = !DIFile(filename: "/tmp/s.c", directory: "/tmp")93!2 = !{}94!3 = !{i32 2, !"Dwarf Version", i32 4}95!4 = !{i32 2, !"Debug Info Version", i32 3}96!5 = !{i32 1, !"PIC Level", i32 2}97!6 = !{!"clang version 4.0.0 (trunk 282540) (llvm/trunk 282542)"}98!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, retainedNodes: !2)99!8 = !DISubroutineType(types: !2)100!9 = !DILocation(line: 1, column: 13, scope: !7)101!10 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, retainedNodes: !2)102!11 = !DILocation(line: 4, column: 10, scope: !10)103!12 = !DILocation(line: 4, column: 3, scope: !10)104!13 = !{!"function_entry_count", i64 30}105