blob: 9376e8017659c4523fe83615e4ed0c5a205f83f5 [file] [log] [blame]
Piotr Padlewski3a0579f2016-09-07 23:46:50 +00001; 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 Padlewskid9830eb2016-09-26 20:37:32 +00004
Piotr Padlewski3a0579f2016-09-07 23:46:50 +00005; 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 Padlewskid9830eb2016-09-26 20:37:32 +00009; 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 Collingbournea0f371a2017-04-17 17:51:36 +000013; CHECK: <SOURCE_FILENAME
14; CHECK-NEXT: <FUNCTION
15; "func"
16; CHECK-NEXT: <FUNCTION op0=4 op1=4
Piotr Padlewski3a0579f2016-09-07 23:46:50 +000017; CHECK: <GLOBALVAL_SUMMARY_BLOCK
18; CHECK-NEXT: <VERSION
Peter Collingbournea0f371a2017-04-17 17:51:36 +000019; See if the call to func is registered, using the expected hotness type.
Charles Saternos75da10d2017-08-04 16:00:58 +000020; CHECK-NEXT: <PERMODULE_PROFILE {{.*}} op5=1 op6=2/>
Piotr Padlewski3a0579f2016-09-07 23:46:50 +000021; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
Peter Collingbournea0f371a2017-04-17 17:51:36 +000022; CHECK: <STRTAB_BLOCK
Peter Collingbourne92648c22017-06-27 23:50:11 +000023; CHECK-NEXT: blob data = 'mainfunc{{.*}}'
Piotr Padlewski3a0579f2016-09-07 23:46:50 +000024
25; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
26; COMBINED-NEXT: <VERSION
Peter Collingbournea0f371a2017-04-17 17:51:36 +000027; COMBINED-NEXT: <VALUE_GUID op0=[[FUNCID:[0-9]+]] op1=7289175272376759421/>
28; COMBINED-NEXT: <VALUE_GUID
Piotr Padlewski3a0579f2016-09-07 23:46:50 +000029; COMBINED-NEXT: <COMBINED
Peter Collingbournea0f371a2017-04-17 17:51:36 +000030; See if the call to func is registered, using the expected hotness type.
Piotr Padlewskid9830eb2016-09-26 20:37:32 +000031; op6=2 which is hotnessType::None.
Charles Saternos75da10d2017-08-04 16:00:58 +000032; COMBINED-NEXT: <COMBINED_PROFILE {{.*}} op6=[[FUNCID]] op7=2/>
Piotr Padlewski3a0579f2016-09-07 23:46:50 +000033; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
Piotr Padlewski3a0579f2016-09-07 23:46:50 +000034
35; ModuleID = 'thinlto-function-summary-callgraph.ll'
36target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
37target triple = "x86_64-unknown-linux-gnu"
38
39; Function Attrs: nounwind uwtable
40define i32 @main() #0 !prof !2 {
41entry:
42 call void (...) @func()
43 ret i32 0
44}
45
46declare void @func(...) #1
47
48!2 = !{!"function_entry_count", i64 1}
Piotr Padlewskid9830eb2016-09-26 20:37:32 +000049
50; OLD: Index {{.*}} contains 1 nodes (1 functions, 0 alias, 0 globals) and 1 edges (0 refs and 1 calls)
51; OLD-COMBINED: Index {{.*}} contains 2 nodes (2 functions, 0 alias, 0 globals) and 1 edges (0 refs and 1 calls)