54 lines · plain
1; Test to check the callgraph in summary when there is PGO2; RUN: opt -module-summary %s -o %t.o3; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s4 5; RUN: opt -module-summary %p/Inputs/thinlto-function-summary-callgraph.ll -o %t2.o6; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o7; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED8 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=OLD11; RUN: llvm-lto -thinlto-index-stats %p/Inputs/thinlto-function-summary-callgraph-pgo-combined.1.bc | FileCheck %s --check-prefix=OLD-COMBINED12 13; CHECK: <SOURCE_FILENAME14; CHECK-NEXT: <FUNCTION15; "func"16; CHECK-NEXT: <FUNCTION op0=4 op1=417; CHECK: <GLOBALVAL_SUMMARY_BLOCK18; CHECK-NEXT: <VERSION19; CHECK-NEXT: <FLAGS20; See if the call to func is registered, using the expected hotness type.21; CHECK-NEXT: <PERMODULE_PROFILE {{.*}} op7=1 op8=2/>22; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK>23; CHECK: <STRTAB_BLOCK24; CHECK-NEXT: blob data = 'mainfunc{{.*}}'25 26; COMBINED: <GLOBALVAL_SUMMARY_BLOCK27; COMBINED-NEXT: <VERSION28; COMBINED-NEXT: <FLAGS29; COMBINED-NEXT: <VALUE_GUID {{.*}} op0=[[FUNCID:[0-9]+]] op1=1697143370 op2=1603531901/>30; COMBINED-NEXT: <VALUE_GUID31; COMBINED-NEXT: <COMBINED32; See if the call to func is registered, using the expected hotness type.33; op6=2 which is hotnessType::None.34; COMBINED-NEXT: <COMBINED_PROFILE {{.*}} op9=[[FUNCID]] op10=2/>35; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK>36 37; ModuleID = 'thinlto-function-summary-callgraph.ll'38target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"39target triple = "x86_64-unknown-linux-gnu"40 41; Function Attrs: nounwind uwtable42define i32 @main() #0 !prof !2 {43entry:44 call void (...) @func()45 ret i32 046}47 48declare void @func(...) #149 50!2 = !{!"function_entry_count", i64 1}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)54