1; Test that llvm-lto2 handles the -lto-sample-profile-file option and pass 2; down to the ICP correctly. 3; 4; RUN: opt -module-summary < %s -o %t.bc 5; RUN: llvm-lto2 run -o %t.out %t.bc -save-temps \ 6; RUN: -r %t.bc,test,px -r %t.bc,bar,x \ 7; RUN: -lto-sample-profile-file=%S/Inputs/load-sample-prof-icp.prof 8; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s 9; RUN: llvm-lto2 run -o %t.out %t.bc -save-temps \ 10; RUN: -r %t.bc,test,px -r %t.bc,bar,x -use-new-pm \ 11; RUN: -lto-sample-profile-file=%S/Inputs/load-sample-prof-icp.prof 12; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s 13 14target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 15target triple = "x86_64-unknown-linux-gnu" 16 17; CHECK-LABEL: @test 18; Checks that the call instruction is promoted to direct call and has 19; profile count annotated on the direct call. 20define void @test(void ()*) !dbg !7 { 21 %2 = alloca void ()* 22 store void ()* %0, void ()** %2 23 %3 = load void ()*, void ()** %2 24 ; CHECK: call void @bar(),{{.*}}!prof 25 call void %3(), !dbg !10 26 ret void 27} 28 29declare void @bar() local_unnamed_addr 30 31!llvm.dbg.cu = !{!0} 32!llvm.module.flags = !{!3, !4, !5} 33!llvm.ident = !{!6} 34 35!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) 36!1 = !DIFile(filename: "test.c", directory: "/tmp") 37!2 = !{} 38!3 = !{i32 2, !"Dwarf Version", i32 4} 39!4 = !{i32 2, !"Debug Info Version", i32 3} 40!5 = !{i32 1, !"wchar_size", i32 4} 41!6 = !{!"clang version 6.0.0 "} 42!7 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, retainedNodes: !2) 43!8 = !DISubroutineType(types: !9) 44!9 = !{null} 45!10 = !DILocation(line: 4, column: 5, scope: !7) 46!11 = !DILocation(line: 5, column: 1, scope: !7) 47