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
55 lines
1.9 KiB
LLVM
55 lines
1.9 KiB
LLVM
; RUN: opt < %s -passes=pseudo-probe,sample-profile -sample-profile-file=%S/Inputs/pseudo-probe-profile-metadata.prof -sample-profile-use-profi=0 -S | FileCheck %s
|
|
|
|
; The test verifies the presence of prof metadata for BranchInst, SwitchInst,
|
|
; and IndirectBrInst
|
|
|
|
@yydebug = dso_local global i32 0, align 4
|
|
|
|
define dso_local i32 @foo() #0 {
|
|
entry:
|
|
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 1, i32 0, i64 -1)
|
|
%0 = load i32, ptr @yydebug, align 4
|
|
%cmp = icmp ne i32 %0, 0
|
|
br i1 %cmp, label %b1, label %exit
|
|
; CHECK: br i1 %cmp, label %b1, label %exit, !prof ![[ENTRY_PROF:[0-9]+]]
|
|
|
|
b1:
|
|
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 2, i32 0, i64 -1)
|
|
%1 = load i32, ptr @yydebug, align 4
|
|
switch i32 %1, label %b3 [
|
|
i32 124, label %indirectgoto
|
|
i32 92, label %b2
|
|
]
|
|
; CHECK: ], !prof ![[SWITCH_PROF:[0-9]+]]
|
|
|
|
b2:
|
|
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 3, i32 0, i64 -1)
|
|
br label %indirectgoto
|
|
|
|
b3:
|
|
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 4, i32 0, i64 -1)
|
|
%2 = load i32, ptr @yydebug, align 4
|
|
ret i32 %2
|
|
|
|
indirectgoto:
|
|
%indirect.goto.dest = alloca i8, align 4
|
|
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 5, i32 0, i64 -1)
|
|
indirectbr ptr %indirect.goto.dest, [label %b1, label %b3, label %b2]
|
|
; CHECK: indirectbr ptr %indirect.goto.dest, [label %b1, label %b3, label %b2], !prof ![[GOTO_PROF:[0-9]+]]
|
|
|
|
exit:
|
|
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 6, i32 0, i64 -1)
|
|
%3 = load i32, ptr @yydebug, align 4
|
|
ret i32 %3
|
|
|
|
}
|
|
|
|
attributes #0 = {"use-sample-profile"}
|
|
declare void @llvm.pseudoprobe(i64, i64, i32, i64) #1
|
|
!llvm.pseudo_probe_desc = !{!4496}
|
|
!4496 = !{i64 6699318081062747564, i64 158517001042, !"foo", null}
|
|
|
|
; CHECK: ![[ENTRY_PROF]] = !{!"branch_weights", i32 10, i32 6}
|
|
; CHECK: ![[SWITCH_PROF]] = !{!"branch_weights", i32 1, i32 9536, i32 1}
|
|
; CHECK: ![[GOTO_PROF]] = !{!"branch_weights", i32 17739, i32 1, i32 1}
|