Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/SampleProfile/pseudo-probe-stale-profile-unused-probe-desc.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

77 lines
3.6 KiB
LLVM

; REQUIRES: asserts && x86-registered-target
; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/pseudo-probe-stale-profile-unused-probe-desc.prof --salvage-stale-profile --salvage-unused-profile -S --debug-only=sample-profile,sample-profile-matcher,sample-profile-impl --min-call-count-for-cg-matching=0 --min-func-count-for-cg-matching=0 2>&1 | FileCheck %s
;; Test scenario (post-link):
;;
;; int main() {
;; // optimized away in pre-link
;; foo_hot();
;; if (false)
;; foo_cold();
;; return 0;
;; }
;;
;; - Profile: main calls foo_hot, but never calls foo_cold.
;; - Post-link IR: foo_hot was optimized away in pre-link and its probe descriptor persists
;; in !llvm.pseudo_probe_desc.
;; - Expected result: foo_cold is not matched to foo_hot's profile.
; CHECK: Function foo_cold is not in profile or profile symbol list.
; CHECK: Run stale profile matching for main
; CHECK-NOT: Function:foo_cold matches profile:foo_hot
define dso_local void @foo_cold() #0 !dbg !11 {
entry:
call void @llvm.pseudoprobe(i64 5929568435854063828, i64 1, i32 0, i64 -1), !dbg !13
ret void, !dbg !14
}
define dso_local i32 @main() #0 !dbg !15 {
entry:
call void @llvm.pseudoprobe(i64 -2624081020897602054, i64 1, i32 0, i64 -1), !dbg !18
br i1 false, label %if.then, label %if.end, !dbg !23
if.then:
call void @llvm.pseudoprobe(i64 -2624081020897602054, i64 2, i32 0, i64 -1), !dbg !24
call void @foo_cold(), !dbg !19
br label %if.end
if.end:
call void @llvm.pseudoprobe(i64 -2624081020897602054, i64 4, i32 0, i64 -1), !dbg !25
ret i32 0, !dbg !21
}
declare void @llvm.pseudoprobe(i64, i64, i32, i64)
attributes #0 = { nounwind uwtable "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "use-sample-profile" }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!llvm.pseudo_probe_desc = !{!6, !7, !8}
!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
!1 = !DIFile(filename: "test.c", directory: "/tmp")
!2 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!3 = !{i32 7, !"Dwarf Version", i32 5}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 7, !"uwtable", i32 2}
!6 = !{i64 5929568435854063828, i64 844429225099263, !"foo_cold"}
!7 = !{i64 -2624081020897602054, i64 1126003093360596, !"main"}
!8 = !{i64 -2908166055299645123, i64 844429225099263, !"foo_hot"}
!9 = !DISubroutineType(types: !10)
!10 = !{null}
!11 = distinct !DISubprogram(name: "foo_cold", scope: !1, file: !1, line: 2, type: !9, scopeLine: 2, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
!12 = !DISubroutineType(types: !22)
!13 = !DILocation(line: 3, column: 1, scope: !11)
!14 = !DILocation(line: 4, column: 1, scope: !11)
!15 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 10, type: !12, scopeLine: 10, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
!18 = !DILocation(line: 11, column: 1, scope: !15)
!19 = !DILocation(line: 13, column: 5, scope: !20)
!20 = !DILexicalBlockFile(scope: !15, file: !1, discriminator: 186646559)
!21 = !DILocation(line: 16, column: 1, scope: !15)
!22 = !{!2}
!23 = !DILocation(line: 12, column: 3, scope: !15)
!24 = !DILocation(line: 13, column: 3, scope: !15)
!25 = !DILocation(line: 15, column: 1, scope: !15)
!26 = distinct !DISubprogram(name: "foo_hot", scope: !1, file: !1, line: 5, type: !9, scopeLine: 5, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)