Home | History | Annotate | Download | only in Inline
      1 ; RUN: opt < %s -S -inline -pass-remarks=inline \
      2 ; RUN:    -pass-remarks-with-hotness 2>&1 | FileCheck %s
      3 
      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 %s
      7 
      8 ; Check that when any threshold is specified we ignore remarks with no
      9 ; hotness -- these are blocks that have not been executed during training.
     10 
     11 ;  1     int foo() { return 1; }
     12 ;  2
     13 ;  3     int bar() {
     14 ;  4       return foo();
     15 ;  5     }
     16 
     17 ; CHECK: remark: /tmp/s.c:4:10: foo inlined into bar with cost={{[0-9\-]+}} (threshold={{[0-9]+}})
     18 ; THRESHOLD-NOT: remark
     19 
     20 ; ModuleID = '/tmp/s.c'
     21 source_filename = "/tmp/s.c"
     22 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
     23 target triple = "x86_64-apple-macosx10.11.0"
     24 
     25 ; Function Attrs: nounwind ssp uwtable
     26 define i32 @foo() #0 !dbg !7 {
     27 entry:
     28   ret i32 1, !dbg !9
     29 }
     30 
     31 ; Function Attrs: nounwind ssp uwtable
     32 define i32 @bar() #0 !dbg !10 {
     33 entry:
     34   %call = call i32 @foo(), !dbg !11
     35   ret i32 %call, !dbg !12
     36 }
     37 
     38 attributes #0 = { nounwind ssp uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="core2" "target-features"="+cx16,+fxsr,+mmx,+sse,+sse2,+sse3,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
     39 
     40 !llvm.dbg.cu = !{!0}
     41 !llvm.module.flags = !{!3, !4, !5}
     42 !llvm.ident = !{!6}
     43 
     44 !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)
     45 !1 = !DIFile(filename: "/tmp/s.c", directory: "/tmp")
     46 !2 = !{}
     47 !3 = !{i32 2, !"Dwarf Version", i32 4}
     48 !4 = !{i32 2, !"Debug Info Version", i32 3}
     49 !5 = !{i32 1, !"PIC Level", i32 2}
     50 !6 = !{!"clang version 4.0.0 (trunk 282540) (llvm/trunk 282542)"}
     51 !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)
     52 !8 = !DISubroutineType(types: !2)
     53 !9 = !DILocation(line: 1, column: 13, scope: !7)
     54 !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)
     55 !11 = !DILocation(line: 4, column: 10, scope: !10)
     56 !12 = !DILocation(line: 4, column: 3, scope: !10)
     57