brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.7 KiB · e512728 Raw
95 lines · plain
1;; Tests memprof undrifting when the leaf frame is missing in the profile.2;; This test case is taken from memprof_missing_leaf.ll with the profile3;; drifted.4 5; RUN: split-file %s %t6; RUN: llvm-profdata merge %t/memprof_missing_leaf.yaml -o %t/memprof_missing_leaf.memprofdata7; RUN: opt < %t/memprof_missing_leaf.ll -passes='memprof-use<profile-filename=%t/memprof_missing_leaf.memprofdata>' -memprof-salvage-stale-profile -S | FileCheck %s8 9;--- memprof_missing_leaf.yaml10---11HeapProfileRecords:12  - GUID:            main13    AllocSites:14      - Callstack:15          - { Function: main, LineOffset: 2, Column: 21, IsInlineFrame: false }16        MemInfoBlock:17          AllocCount:      118          TotalSize:       119          TotalLifetime:   120          TotalLifetimeAccessDensity: 021    CallSites:       []22...23;--- memprof_missing_leaf.ll24; CHECK: call {{.*}} @_Znam{{.*}} #[[ATTR:[0-9]+]]25; CHECK: attributes #[[ATTR]] = {{.*}} "memprof"="notcold"26 27; ModuleID = '<stdin>'28source_filename = "memprof_missing_leaf.cc"29target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"30target triple = "x86_64-unknown-linux-gnu"31 32; Function Attrs: nobuiltin allocsize(0)33declare noundef nonnull ptr @_Znam(i64 noundef) #034 35; Function Attrs: mustprogress norecurse uwtable36define dso_local noundef i32 @main() #1 !dbg !8 {37entry:38  %s.addr.i = alloca i64, align 839  %retval = alloca i32, align 440  %a = alloca ptr, align 841  store i32 0, ptr %retval, align 442  store i64 1, ptr %s.addr.i, align 8, !tbaa !1143  %0 = load i64, ptr %s.addr.i, align 8, !dbg !15, !tbaa !1144  %call.i = call noalias noundef nonnull ptr @_Znam(i64 noundef %0) #3, !dbg !1845  store ptr %call.i, ptr %a, align 8, !dbg !19, !tbaa !2046  %1 = load ptr, ptr %a, align 8, !dbg !22, !tbaa !2047  %isnull = icmp eq ptr %1, null, !dbg !2348  br i1 %isnull, label %delete.end, label %delete.notnull, !dbg !2349 50delete.notnull:                                   ; preds = %entry51  call void @_ZdlPv(ptr noundef %1) #4, !dbg !2352  br label %delete.end, !dbg !2353 54delete.end:                                       ; preds = %delete.notnull, %entry55  ret i32 0, !dbg !2456}57 58; Function Attrs: nobuiltin nounwind59declare void @_ZdlPv(ptr noundef) #260 61attributes #0 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }62attributes #1 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }63attributes #2 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }64attributes #3 = { builtin allocsize(0) }65attributes #4 = { builtin nounwind }66 67!llvm.dbg.cu = !{!0}68!llvm.module.flags = !{!2, !3, !4, !5, !6, !7}69 70!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 18.0.0 (git@github.com:llvm/llvm-project.git 71bf052ec90e77cb4aa66505d47cbc4b6016ac1d)", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, splitDebugInlining: false, debugInfoForProfiling: true, nameTableKind: None)71!1 = !DIFile(filename: "memprof_missing_leaf.cc", directory: ".", checksumkind: CSK_MD5, checksum: "f1445a8699406a6b826128704d257677")72!2 = !{i32 7, !"Dwarf Version", i32 5}73!3 = !{i32 2, !"Debug Info Version", i32 3}74!4 = !{i32 1, !"wchar_size", i32 4}75!5 = !{i32 8, !"PIC Level", i32 2}76!6 = !{i32 7, !"PIE Level", i32 2}77!7 = !{i32 7, !"uwtable", i32 2}78!8 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 15, type: !9, scopeLine: 15, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)79!9 = !DISubroutineType(types: !10)80!10 = !{}81!11 = !{!12, !12, i64 0}82!12 = !{!"long", !13, i64 0}83!13 = !{!"omnipotent char", !14, i64 0}84!14 = !{!"Simple C++ TBAA"}85!15 = !DILocation(line: 11, column: 19, scope: !16, inlinedAt: !17)86!16 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barm", scope: !1, file: !1, line: 7, type: !9, scopeLine: 7, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)87!17 = distinct !DILocation(line: 16, column: 21, scope: !8)88!18 = !DILocation(line: 11, column: 10, scope: !16, inlinedAt: !17)89!19 = !DILocation(line: 16, column: 9, scope: !8)90!20 = !{!21, !21, i64 0}91!21 = !{!"any pointer", !13, i64 0}92!22 = !DILocation(line: 17, column: 10, scope: !8)93!23 = !DILocation(line: 17, column: 3, scope: !8)94!24 = !DILocation(line: 18, column: 3, scope: !8)95