brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.4 KiB · ad83da2 Raw
89 lines · plain
1; RUN: split-file %s %t2 3;; Basic functionality with flag toggle4; RUN: llvm-profdata merge --memprof-version=4 %t/basic.yaml -o %t/basic.memprofdata5; RUN: opt < %t/basic.ll -passes='memprof-use<profile-filename=%t/basic.memprofdata>' -memprof-attach-calleeguids=false -S 2>&1 | FileCheck %s --check-prefix=CHECK-DISABLE6; RUN: opt < %t/basic.ll -passes='memprof-use<profile-filename=%t/basic.memprofdata>' -memprof-attach-calleeguids=true -S 2>&1 | FileCheck %s --check-prefix=CHECK-ENABLE7 8;; FDO conflict handling9; RUN: llvm-profdata merge --memprof-version=4 %t/fdo_conflict.yaml -o %t/fdo_conflict.memprofdata10; RUN: opt < %t/fdo_conflict.ll -passes='memprof-use<profile-filename=%t/fdo_conflict.memprofdata>' -memprof-attach-calleeguids=true -S 2>&1 | FileCheck %s --check-prefix=CHECK-FDO11 12;--- basic.yaml13---14HeapProfileRecords:15  - GUID:            _Z3barv16    AllocSites:      []17    CallSites:18      - Frames:19          - { Function: _Z3barv, LineOffset: 3, Column: 5, IsInlineFrame: false }20        CalleeGuids:   [0x123456789abcdef0, 0x23456789abcdef01]21...22 23;--- basic.ll24define dso_local void @_Z3barv() !dbg !4 {25entry:26  %fp = alloca ptr, align 827  %0 = load ptr, ptr %fp, align 828  call void %0(), !dbg !529; CHECK-ENABLE: call void %0(), {{.*}} !prof !630; CHECK-DISABLE-NOT: !prof31  ret void32}33 34; CHECK-ENABLE: !6 = !{!"VP", i32 0, i64 2, i64 1311768467463790320, i64 1, i64 2541551405711093505, i64 1}35 36!llvm.module.flags = !{!2, !3}37 38!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1)39!1 = !DIFile(filename: "t", directory: "/")40!2 = !{i32 7, !"Dwarf Version", i32 5}41!3 = !{i32 2, !"Debug Info Version", i32 3}42!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !1, file: !1, line: 1, unit: !0)43!5 = !DILocation(line: 4, column: 5, scope: !4)44 45;--- fdo_conflict.yaml46---47HeapProfileRecords:48  - GUID:            _Z3foov49    AllocSites:      []50    CallSites:51      - Frames:52          - { Function: _Z3foov, LineOffset: 3, Column: 5, IsInlineFrame: false }53        CalleeGuids:   [0x123456789abcdef0, 0x23456789abcdef01]54      - Frames:55          - { Function: _Z3foov, LineOffset: 5, Column: 5, IsInlineFrame: false }56        CalleeGuids:   [0x555556789abcdef0, 0x666656789abcdef1]57...58 59;--- fdo_conflict.ll60define dso_local void @_Z3foov() !dbg !14 {61entry:62  %fp = alloca ptr, align 863  %0 = load ptr, ptr %fp, align 864  ; This call already has FDO value profile metadata - should NOT be modified65  ; CHECK-FDO: call void %0(), {{.*}} !prof !666  call void %0(), !dbg !15, !prof !1667 68  %1 = load ptr, ptr %fp, align 869  ; This call does NOT have existing metadata - should get MemProf annotation70  ; CHECK-FDO: call void %1(), {{.*}} !prof !971  call void %1(), !dbg !1772  ret void73}74 75!16 = !{!"VP", i32 0, i64 100, i64 9191153033785521275, i64 80, i64 -1069303473483922844, i64 20}76 77; CHECK-FDO: !6 = !{!"VP", i32 0, i64 100, i64 9191153033785521275, i64 80, i64 -1069303473483922844, i64 20}78; CHECK-FDO: !9 = !{!"VP", i32 0, i64 2, i64 6148915942236413680, i64 1, i64 7378680115485269745, i64 1}79 80!llvm.module.flags = !{!12, !13}81 82!10 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !11)83!11 = !DIFile(filename: "t", directory: "/")84!12 = !{i32 7, !"Dwarf Version", i32 5}85!13 = !{i32 2, !"Debug Info Version", i32 3}86!14 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !11, file: !11, line: 1, unit: !10)87!15 = !DILocation(line: 4, column: 5, scope: !14)88!17 = !DILocation(line: 6, column: 5, scope: !14)89