1*cee313d2SEric Christopher; Do setup work for all below tests: generate bitcode and combined index 2*cee313d2SEric Christopher; RUN: opt -module-summary %s -o %t.bc 3*cee313d2SEric Christopher; RUN: opt -module-summary %p/Inputs/thinlto_samplepgo_icp.ll -o %t2.bc 4*cee313d2SEric Christopher; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc 5*cee313d2SEric Christopher 6*cee313d2SEric Christopher; Checks if calls to static target functions are properly imported and promoted 7*cee313d2SEric Christopher; by ICP. Note that the GUID in the profile is from the oroginal name. 8*cee313d2SEric Christopher; RUN: opt -function-import -summary-file %t3.thinlto.bc %t.bc -o %t4.bc -print-imports 2>&1 | FileCheck %s --check-prefix=IMPORTS 9*cee313d2SEric Christopher; IMPORTS: Import _ZL3foov.llvm.0 10*cee313d2SEric Christopher; RUN: opt %t4.bc -icp-lto -pgo-icall-prom -S | FileCheck %s --check-prefix=ICALL-PROM 11*cee313d2SEric Christopher 12*cee313d2SEric Christophertarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 13*cee313d2SEric Christophertarget triple = "x86_64-unknown-linux-gnu" 14*cee313d2SEric Christopher 15*cee313d2SEric Christopher@fptr = local_unnamed_addr global void ()* null, align 8 16*cee313d2SEric Christopher 17*cee313d2SEric Christopher; Function Attrs: norecurse uwtable 18*cee313d2SEric Christopherdefine i32 @main() local_unnamed_addr #0 !prof !34 { 19*cee313d2SEric Christopherentry: 20*cee313d2SEric Christopher %0 = load void ()*, void ()** @fptr, align 8 21*cee313d2SEric Christopher; ICALL-PROM: br i1 %{{[0-9]+}}, label %if.true.direct_targ, label %if.false.orig_indirect 22*cee313d2SEric Christopher tail call void %0(), !prof !40 23*cee313d2SEric Christopher ret i32 0 24*cee313d2SEric Christopher} 25*cee313d2SEric Christopher 26*cee313d2SEric Christopher!llvm.dbg.cu = !{!0} 27*cee313d2SEric Christopher!llvm.module.flags = !{!3,!4} 28*cee313d2SEric Christopher!llvm.ident = !{!31} 29*cee313d2SEric Christopher 30*cee313d2SEric Christopher!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 297016)", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2) 31*cee313d2SEric Christopher!1 = !DIFile(filename: "main.cc", directory: ".") 32*cee313d2SEric Christopher!2 = !{} 33*cee313d2SEric Christopher!3 = !{i32 2, !"Debug Info Version", i32 3} 34*cee313d2SEric Christopher!4 = !{i32 1, !"ProfileSummary", !5} 35*cee313d2SEric Christopher!5 = !{!6, !7, !8, !9, !10, !11, !12, !13} 36*cee313d2SEric Christopher!6 = !{!"ProfileFormat", !"SampleProfile"} 37*cee313d2SEric Christopher!7 = !{!"TotalCount", i64 3003} 38*cee313d2SEric Christopher!8 = !{!"MaxCount", i64 3000} 39*cee313d2SEric Christopher!9 = !{!"MaxInternalCount", i64 0} 40*cee313d2SEric Christopher!10 = !{!"MaxFunctionCount", i64 0} 41*cee313d2SEric Christopher!11 = !{!"NumCounts", i64 3} 42*cee313d2SEric Christopher!12 = !{!"NumFunctions", i64 1} 43*cee313d2SEric Christopher!13 = !{!"DetailedSummary", !14} 44*cee313d2SEric Christopher!14 = !{!15, !16, !17, !18, !19, !20, !20, !21, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30} 45*cee313d2SEric Christopher!15 = !{i32 10000, i64 3000, i32 1} 46*cee313d2SEric Christopher!16 = !{i32 100000, i64 3000, i32 1} 47*cee313d2SEric Christopher!17 = !{i32 200000, i64 3000, i32 1} 48*cee313d2SEric Christopher!18 = !{i32 300000, i64 3000, i32 1} 49*cee313d2SEric Christopher!19 = !{i32 400000, i64 3000, i32 1} 50*cee313d2SEric Christopher!20 = !{i32 500000, i64 3000, i32 1} 51*cee313d2SEric Christopher!21 = !{i32 600000, i64 3000, i32 1} 52*cee313d2SEric Christopher!22 = !{i32 700000, i64 3000, i32 1} 53*cee313d2SEric Christopher!23 = !{i32 800000, i64 3000, i32 1} 54*cee313d2SEric Christopher!24 = !{i32 900000, i64 3000, i32 1} 55*cee313d2SEric Christopher!25 = !{i32 950000, i64 3000, i32 1} 56*cee313d2SEric Christopher!26 = !{i32 990000, i64 3000, i32 1} 57*cee313d2SEric Christopher!27 = !{i32 999000, i64 3000, i32 1} 58*cee313d2SEric Christopher!28 = !{i32 999900, i64 2, i32 2} 59*cee313d2SEric Christopher!29 = !{i32 999990, i64 2, i32 2} 60*cee313d2SEric Christopher!30 = !{i32 999999, i64 2, i32 2} 61*cee313d2SEric Christopher!31 = !{!"clang version 5.0.0 (trunk 297016)"} 62*cee313d2SEric Christopher!34 = !{!"function_entry_count", i64 1} 63*cee313d2SEric Christopher!40 = !{!"VP", i32 0, i64 3000, i64 -8789629626369651636, i64 3000} 64