Piotr Padlewski | 6037ae7 | 2016-09-07 23:46:50 +0000 | [diff] [blame] | 1 | ; Test to check the callgraph in summary when there is PGO |
| 2 | ; RUN: opt -module-summary %s -o %t.o |
| 3 | ; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s |
Piotr Padlewski | fdf7354 | 2016-09-26 20:37:32 +0000 | [diff] [blame] | 4 | |
Piotr Padlewski | 6037ae7 | 2016-09-07 23:46:50 +0000 | [diff] [blame] | 5 | ; RUN: opt -module-summary %p/Inputs/thinlto-function-summary-callgraph.ll -o %t2.o |
| 6 | ; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o |
| 7 | ; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED |
| 8 | |
Piotr Padlewski | fdf7354 | 2016-09-26 20:37:32 +0000 | [diff] [blame] | 9 | ; Check parsing for old summary versions generated from this file. |
| 10 | ; RUN: llvm-lto -thinlto-index-stats %p/Inputs/thinlto-function-summary-callgraph-pgo.1.bc | FileCheck %s --check-prefix=OLD |
| 11 | ; RUN: llvm-lto -thinlto-index-stats %p/Inputs/thinlto-function-summary-callgraph-pgo-combined.1.bc | FileCheck %s --check-prefix=OLD-COMBINED |
| 12 | |
Peter Collingbourne | 6163b4a | 2017-04-17 17:51:36 +0000 | [diff] [blame] | 13 | ; CHECK: <SOURCE_FILENAME |
| 14 | ; CHECK-NEXT: <FUNCTION |
| 15 | ; "func" |
| 16 | ; CHECK-NEXT: <FUNCTION op0=4 op1=4 |
Piotr Padlewski | 6037ae7 | 2016-09-07 23:46:50 +0000 | [diff] [blame] | 17 | ; CHECK: <GLOBALVAL_SUMMARY_BLOCK |
| 18 | ; CHECK-NEXT: <VERSION |
Teresa Johnson | e393775 | 2019-01-11 18:31:57 +0000 | [diff] [blame] | 19 | ; CHECK-NEXT: <FLAGS |
Peter Collingbourne | 6163b4a | 2017-04-17 17:51:36 +0000 | [diff] [blame] | 20 | ; See if the call to func is registered, using the expected hotness type. |
Eugene Leviant | a3f1de9 | 2018-11-16 07:08:00 +0000 | [diff] [blame] | 21 | ; CHECK-NEXT: <PERMODULE_PROFILE {{.*}} op6=1 op7=2/> |
Piotr Padlewski | 6037ae7 | 2016-09-07 23:46:50 +0000 | [diff] [blame] | 22 | ; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK> |
Peter Collingbourne | 6163b4a | 2017-04-17 17:51:36 +0000 | [diff] [blame] | 23 | ; CHECK: <STRTAB_BLOCK |
Peter Collingbourne | fdc1250 | 2017-06-27 23:50:11 +0000 | [diff] [blame] | 24 | ; CHECK-NEXT: blob data = 'mainfunc{{.*}}' |
Piotr Padlewski | 6037ae7 | 2016-09-07 23:46:50 +0000 | [diff] [blame] | 25 | |
| 26 | ; COMBINED: <GLOBALVAL_SUMMARY_BLOCK |
| 27 | ; COMBINED-NEXT: <VERSION |
Teresa Johnson | d3f03a6 | 2018-02-07 04:05:59 +0000 | [diff] [blame] | 28 | ; COMBINED-NEXT: <FLAGS |
Peter Collingbourne | 6163b4a | 2017-04-17 17:51:36 +0000 | [diff] [blame] | 29 | ; COMBINED-NEXT: <VALUE_GUID op0=[[FUNCID:[0-9]+]] op1=7289175272376759421/> |
| 30 | ; COMBINED-NEXT: <VALUE_GUID |
Piotr Padlewski | 6037ae7 | 2016-09-07 23:46:50 +0000 | [diff] [blame] | 31 | ; COMBINED-NEXT: <COMBINED |
Peter Collingbourne | 6163b4a | 2017-04-17 17:51:36 +0000 | [diff] [blame] | 32 | ; See if the call to func is registered, using the expected hotness type. |
Piotr Padlewski | fdf7354 | 2016-09-26 20:37:32 +0000 | [diff] [blame] | 33 | ; op6=2 which is hotnessType::None. |
Easwaran Raman | f1f1adc | 2018-12-13 19:54:27 +0000 | [diff] [blame] | 34 | ; COMBINED-NEXT: <COMBINED_PROFILE {{.*}} op8=[[FUNCID]] op9=2/> |
Piotr Padlewski | 6037ae7 | 2016-09-07 23:46:50 +0000 | [diff] [blame] | 35 | ; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK> |
Piotr Padlewski | 6037ae7 | 2016-09-07 23:46:50 +0000 | [diff] [blame] | 36 | |
| 37 | ; ModuleID = 'thinlto-function-summary-callgraph.ll' |
| 38 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 39 | target triple = "x86_64-unknown-linux-gnu" |
| 40 | |
| 41 | ; Function Attrs: nounwind uwtable |
| 42 | define i32 @main() #0 !prof !2 { |
| 43 | entry: |
| 44 | call void (...) @func() |
| 45 | ret i32 0 |
| 46 | } |
| 47 | |
| 48 | declare void @func(...) #1 |
| 49 | |
| 50 | !2 = !{!"function_entry_count", i64 1} |
Piotr Padlewski | fdf7354 | 2016-09-26 20:37:32 +0000 | [diff] [blame] | 51 | |
| 52 | ; OLD: Index {{.*}} contains 1 nodes (1 functions, 0 alias, 0 globals) and 1 edges (0 refs and 1 calls) |
| 53 | ; OLD-COMBINED: Index {{.*}} contains 2 nodes (2 functions, 0 alias, 0 globals) and 1 edges (0 refs and 1 calls) |