brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 32b47bc Raw
65 lines · plain
1; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/indirect-call-csspgo.prof -sample-profile-icp-relative-hotness=1  -pass-remarks=sample-profile -S -o /dev/null 2>&1 | FileCheck -check-prefix=ICP-ALL %s2; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/indirect-call-csspgo.prof -sample-profile-icp-relative-hotness=1  -pass-remarks=sample-profile -sample-profile-inline-size=0 -S -o /dev/null 2>&1 | FileCheck -check-prefix=ICP-HOT %s3; RUN: llvm-profdata merge --sample --extbinary --use-md5 %S/Inputs/indirect-call-csspgo.prof -o %t.md54; RUN: opt < %s -passes=sample-profile -sample-profile-file=%t.md5 -sample-profile-icp-relative-hotness=1  -pass-remarks=sample-profile -sample-profile-inline-size=0 -S -o /dev/null 2>&1 | FileCheck -check-prefix=ICP-HOT %s5 6 7define void @test(ptr) #0 !dbg !3 {8;; Add two direct call to force top-down order for sample profile loader9  call void @_Z3foov(), !dbg !710  call void @_Z3barv(), !dbg !711  call void @_Z3bazv(), !dbg !712  %2 = alloca ptr13  store ptr %0, ptr %214  %3 = load ptr, ptr %215  call void %3(), !dbg !416  %4 = alloca ptr17  store ptr %0, ptr %418  %5 = load ptr, ptr %419  call void %5(), !dbg !520  ret void21}22 23define void @_Z3foov() #0 !dbg !8 {24  ret void25}26 27define void @_Z3barv() #0 !dbg !9 {28  ret void29}30 31define void @_Z3bazv() #0 !dbg !10 {32  ret void33}34 35define void @_Z3zoov() #0 !dbg !11 {36  ret void37}38 39attributes #0 = {"use-sample-profile"}40 41!llvm.dbg.cu = !{!0}42!llvm.module.flags = !{!2}43 44!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1)45!1 = !DIFile(filename: "test.cc", directory: "/")46!2 = !{i32 2, !"Debug Info Version", i32 3}47!3 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 3, unit: !0)48!4 = !DILocation(line: 4, scope: !3)49!5 = !DILocation(line: 5, scope: !3)50!6 = !DILocation(line: 6, scope: !3)51!7 = !DILocation(line: 7, scope: !3)52!8 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 29, unit: !0)53!9 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !1, file: !1, line: 32, unit: !0)54!10 = distinct !DISubprogram(name: "baz", linkageName: "_Z3bazv", scope: !1, file: !1, line: 24, unit: !0)55!11 = distinct !DISubprogram(name: "zoo", linkageName: "_Z3zoov", scope: !1, file: !1, line: 24, unit: !0)56 57 58; ICP-ALL:      remark: test.cc:4:0: '_Z3foov' inlined into 'test'59; ICP-ALL-NEXT: remark: test.cc:4:0: '_Z3barv' inlined into 'test'60; ICP-ALL-NEXT: remark: test.cc:5:0: '_Z3bazv' inlined into 'test'61; ICP-ALL-NOT: remark62 63; ICP-HOT: remark: test.cc:4:0: '_Z3foov' inlined into 'test'64; ICP-HOT-NOT: remark65