brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 2b4aedd Raw
59 lines · plain
1; RUN: opt < %s -S -passes=inline -pass-remarks=inline \2; RUN:    -pass-remarks-with-hotness 2>&1 | FileCheck %s3 4; RUN: opt < %s -S -passes=inline -pass-remarks-output=%t -pass-remarks=inline \5; RUN:    -pass-remarks-with-hotness -pass-remarks-hotness-threshold=1 2>&1 | \6; RUN:    FileCheck -allow-empty -check-prefix=THRESHOLD %s7 8; RUN: opt < %s -S -passes=inliner-wrapper -pass-remarks-output=%t -pass-remarks=inline \9; RUN:    -pass-remarks-with-hotness -pass-remarks-hotness-threshold=1 2>&1 | \10; RUN:    FileCheck -allow-empty -check-prefix=THRESHOLD %s11 12; Check that when any threshold is specified we ignore remarks with no13; hotness -- these are blocks that have not been executed during training.14 15;  1     int foo() { return 1; }16;  217;  3     int bar() {18;  4       return foo();19;  5     }20 21; CHECK: remark: /tmp/s.c:4:10: 'foo' inlined into 'bar' with (cost={{[0-9\-]+}}, threshold={{[0-9]+}})22; THRESHOLD-NOT: remark23 24; ModuleID = '/tmp/s.c'25source_filename = "/tmp/s.c"26target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"27target triple = "x86_64-apple-macosx10.11.0"28 29; Function Attrs: nounwind ssp uwtable30define i32 @foo() !dbg !7 {31entry:32  ret i32 1, !dbg !933}34 35; Function Attrs: nounwind ssp uwtable36define i32 @bar() !dbg !10 {37entry:38  %call = call i32 @foo(), !dbg !1139  ret i32 %call, !dbg !1240}41 42!llvm.dbg.cu = !{!0}43!llvm.module.flags = !{!3, !4, !5}44!llvm.ident = !{!6}45 46!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)47!1 = !DIFile(filename: "/tmp/s.c", directory: "/tmp")48!2 = !{}49!3 = !{i32 2, !"Dwarf Version", i32 4}50!4 = !{i32 2, !"Debug Info Version", i32 3}51!5 = !{i32 1, !"PIC Level", i32 2}52!6 = !{!"clang version 4.0.0 (trunk 282540) (llvm/trunk 282542)"}53!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)54!8 = !DISubroutineType(types: !2)55!9 = !DILocation(line: 1, column: 13, scope: !7)56!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)57!11 = !DILocation(line: 4, column: 10, scope: !10)58!12 = !DILocation(line: 4, column: 3, scope: !10)59