brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · b5a4648 Raw
54 lines · plain
1; Verifies that a call site gets annotated even when a call site matches an2; allocation call stack but does not call one of the memory allocation3; functions.4 5; REQUIRES: x86_64-linux6; RUN: split-file %s %t7; RUN: llvm-profdata merge %t/memprof-call-site-at-alloc-site.yaml -o %t/memprof-call-site-at-alloc-site.memprofdata8; RUN: opt < %t/memprof-call-site-at-alloc-site.ll -passes='memprof-use<profile-filename=%t/memprof-call-site-at-alloc-site.memprofdata>' -memprof-print-match-info -S 2>&1 | FileCheck %s9 10;--- memprof-call-site-at-alloc-site.yaml11---12HeapProfileRecords:13  - GUID:            _Z3foov14    AllocSites:15      - Callstack:16          - { Function: _Z3foov, LineOffset: 6, Column: 12, IsInlineFrame: false }17        MemInfoBlock:18          AllocCount:      119          TotalSize:       89870927020          TotalLifetime:   100000021          TotalLifetimeAccessDensity: 122    CallSites:23      - Frames:24        - { Function: _Z3foov, LineOffset: 6, Column: 12, IsInlineFrame: false }25...26 27;--- memprof-call-site-at-alloc-site.ll28; CHECK: MemProf callsite match for inline call stack 77429459497456874129 30target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"31target triple = "x86_64-grtev4-linux-gnu"32 33declare void @_ZN9SomethingC1Ev()34 35define void @_Z3foov() {36  %1 = call ptr @_Znam(), !dbg !337  call void @_ZN9SomethingC1Ev(), !dbg !338  ret void39}40 41declare ptr @_Znam()42 43!llvm.dbg.cu = !{!0}44!llvm.module.flags = !{!2}45 46!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1)47!1 = !DIFile(filename: "something.cc", directory: "/")48!2 = !{i32 2, !"Debug Info Version", i32 3}49!3 = !DILocation(line: 106, column: 12, scope: !4)50!4 = distinct !DISubprogram(name: "Init", linkageName: "_Z3foov", scope: !5, file: !1, line: 100, type: !7, scopeLine: 100, spFlags: DISPFlagDefinition, unit: !0)51!5 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "Something", file: !1)52!6 = !{}53!7 = distinct !DISubroutineType(types: !6)54