brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.3 KiB · f547c37 Raw
96 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=inliner-wrapper -pass-remarks-output=%t -pass-remarks=inline \12; RUN:    -pass-remarks-missed=inline -pass-remarks-analysis=inline \13; RUN:    -annotate-inline-phase=false \14; RUN:    -pass-remarks-with-hotness 2>&1 | FileCheck %s15; RUN: cat %t | FileCheck -check-prefixes=YAML,YAML-NO-ANNOTATE %s16 17; RUN: opt < %s -S -passes=inliner-wrapper -pass-remarks-output=%t -pass-remarks=inline \18; RUN:    -pass-remarks-missed=inline -pass-remarks-analysis=inline \19; RUN:    -annotate-inline-phase \20; RUN:    -pass-remarks-with-hotness 2>&1 | FileCheck %s21; RUN: cat %t | FileCheck -check-prefixes=YAML,YAML-ANNOTATE %s22 23; Same as optimization-remarks-passed-yaml.ll, but here foo has internal linkage24; instead of external linkage. This exercises a different hook for reporting the inlining decision,25; because foo is deleted after it is inlined (due to internal linkage).26; Make sure that the Remark correctly emits the DebugLoc for foo before it is deleted.27 28; 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)29 30; YAML:      --- !Passed31; YAML-NO-ANNOTATE-NEXT: Pass:            inline32; YAML-ANNOTATE-NEXT: Pass:            main-always-inline33; YAML-NEXT: Name:            Inlined34; YAML-NEXT: DebugLoc:        { File: '/tmp/s.c', Line: 4, Column: 10 }35; YAML-NEXT: Function:        bar36; YAML-NEXT: Hotness:         3037; YAML-NEXT: Args:38; YAML-NEXT:   - String: ''''39; YAML-NEXT:   - Callee: foo40; YAML-NEXT:     DebugLoc:        { File: '/tmp/s.c', Line: 1, Column: 0 }41; YAML-NEXT:   - String: ''' inlined into '''42; YAML-NEXT:   - Caller: bar43; YAML-NEXT:     DebugLoc:        { File: '/tmp/s.c', Line: 3, Column: 0 }44; YAML-NEXT:   - String: ''''45; YAML-NEXT:   - String: ' with '46; YAML-NEXT:   - String: '(cost='47; YAML-NEXT:   - Cost: '{{[0-9\-]+}}'48; YAML-NEXT:   - String: ', threshold='49; YAML-NEXT:   - Threshold: '{{[0-9]+}}'50; YAML-NEXT:   - String: ')'51; YAML-NEXT:   - String:          ' at callsite '52; YAML-NEXT:   - String:          bar53; YAML-NEXT:   - String:          ':'54; YAML-NEXT:   - Line:            '1'55; YAML-NEXT:   - String:          ':'56; YAML-NEXT:   - Column:          '10'57; YAML-NEXT:   - String:          ';'58; YAML-NEXT: ...59 60; ModuleID = '/tmp/s.c'61source_filename = "/tmp/s.c"62target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"63target triple = "x86_64-apple-macosx10.11.0"64 65; Function Attrs: nounwind ssp uwtable66define internal i32 @foo() !dbg !7 {67entry:68  ret i32 1, !dbg !969}70 71; Function Attrs: nounwind ssp uwtable72define i32 @bar() !dbg !10 !prof !13 {73entry:74  %call = call i32 @foo(), !dbg !1175  ret i32 %call, !dbg !1276}77 78!llvm.dbg.cu = !{!0}79!llvm.module.flags = !{!3, !4, !5}80!llvm.ident = !{!6}81 82!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)83!1 = !DIFile(filename: "/tmp/s.c", directory: "/tmp")84!2 = !{}85!3 = !{i32 2, !"Dwarf Version", i32 4}86!4 = !{i32 2, !"Debug Info Version", i32 3}87!5 = !{i32 1, !"PIC Level", i32 2}88!6 = !{!"clang version 4.0.0 (trunk 282540) (llvm/trunk 282542)"}89!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)90!8 = !DISubroutineType(types: !2)91!9 = !DILocation(line: 1, column: 13, scope: !7)92!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)93!11 = !DILocation(line: 4, column: 10, scope: !10)94!12 = !DILocation(line: 4, column: 3, scope: !10)95!13 = !{!"function_entry_count", i64 30}96