Diego Novillo | ffc84e3 | 2015-05-13 17:04:29 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/entry_counts.prof -S | FileCheck %s |
Xinliang David Li | d38392e | 2016-05-27 23:20:16 +0000 | [diff] [blame^] | 2 | ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/entry_counts.prof -S | FileCheck %s |
Diego Novillo | ffc84e3 | 2015-05-13 17:04:29 +0000 | [diff] [blame] | 3 | |
| 4 | ; According to the profile, function empty() was called 13,293 times. |
| 5 | ; CHECK: {{.*}} = !{!"function_entry_count", i64 13293} |
| 6 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 7 | define void @empty() !dbg !4 { |
Diego Novillo | ffc84e3 | 2015-05-13 17:04:29 +0000 | [diff] [blame] | 8 | entry: |
| 9 | ret void, !dbg !9 |
| 10 | } |
| 11 | |
Dehao Chen | 6c73b49 | 2016-02-22 22:46:21 +0000 | [diff] [blame] | 12 | ; This function does not have profile, check if function_entry_count is 0 |
| 13 | ; CHECK: {{.*}} = !{!"function_entry_count", i64 0} |
| 14 | define void @no_profile() { |
| 15 | entry: |
| 16 | ret void |
| 17 | } |
| 18 | |
Diego Novillo | ffc84e3 | 2015-05-13 17:04:29 +0000 | [diff] [blame] | 19 | !llvm.dbg.cu = !{!0} |
| 20 | !llvm.module.flags = !{!6, !7} |
| 21 | !llvm.ident = !{!8} |
| 22 | |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 23 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 237249) (llvm/trunk 237261)", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2, retainedTypes: !2, globals: !2, imports: !2) |
Diego Novillo | 5eb5ad0 | 2015-10-26 18:14:44 +0000 | [diff] [blame] | 24 | !1 = !DIFile(filename: "entry_counts.c", directory: ".") |
Diego Novillo | ffc84e3 | 2015-05-13 17:04:29 +0000 | [diff] [blame] | 25 | !2 = !{} |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 26 | !4 = distinct !DISubprogram(name: "empty", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, variables: !2) |
Diego Novillo | ffc84e3 | 2015-05-13 17:04:29 +0000 | [diff] [blame] | 27 | !5 = !DISubroutineType(types: !2) |
| 28 | !6 = !{i32 2, !"Dwarf Version", i32 4} |
| 29 | !7 = !{i32 2, !"Debug Info Version", i32 3} |
| 30 | !8 = !{!"clang version 3.7.0 (trunk 237249) (llvm/trunk 237261)"} |
| 31 | !9 = !DILocation(line: 1, column: 15, scope: !4) |