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
46 lines
1.6 KiB
LLVM
46 lines
1.6 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals --version 2
|
|
; Test that hoisting conditional branches copies the debug and profiling info
|
|
; metadata from the branch being hoisted.
|
|
; RUN: opt -S -passes=licm %s -o - | FileCheck %s
|
|
|
|
declare i32 @foo()
|
|
|
|
; to_hoist should get hoisted, and that should not result
|
|
; in a loss of profiling info
|
|
define i32 @hoist_select(i1 %cond, i32 %a, i32 %b) nounwind {
|
|
; CHECK-LABEL: define i32 @hoist_select
|
|
; CHECK-SAME: (i1 [[COND:%.*]], i32 [[A:%.*]], i32 [[B:%.*]]) #[[ATTR0:[0-9]+]] {
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[TO_HOIST:%.*]] = select i1 [[COND]], i32 [[A]], i32 [[B]], !prof [[PROF0:![0-9]+]]
|
|
; CHECK-NEXT: br label [[L0:%.*]]
|
|
; CHECK: L0:
|
|
; CHECK-NEXT: [[G:%.*]] = call i32 @foo()
|
|
; CHECK-NEXT: [[SUM:%.*]] = add i32 [[G]], [[TO_HOIST]]
|
|
; CHECK-NEXT: [[C:%.*]] = icmp eq i32 [[SUM]], 0
|
|
; CHECK-NEXT: br i1 [[C]], label [[L0]], label [[EXIT:%.*]], !prof [[PROF1:![0-9]+]]
|
|
; CHECK: exit:
|
|
; CHECK-NEXT: [[SUM_LCSSA:%.*]] = phi i32 [ [[SUM]], [[L0]] ]
|
|
; CHECK-NEXT: ret i32 [[SUM_LCSSA]]
|
|
;
|
|
entry:
|
|
br label %L0
|
|
L0:
|
|
%g = call i32 @foo()
|
|
%to_hoist = select i1 %cond, i32 %a, i32 %b, !prof !0
|
|
%sum = add i32 %g, %to_hoist
|
|
%c = icmp eq i32 %sum, 0
|
|
br i1 %c, label %L0, label %exit, !prof !1
|
|
|
|
exit:
|
|
ret i32 %sum
|
|
}
|
|
|
|
!0 = !{!"branch_weights", i32 2, i32 5}
|
|
!1 = !{!"branch_weights", i32 101, i32 189}
|
|
;.
|
|
; CHECK: attributes #[[ATTR0]] = { nounwind }
|
|
;.
|
|
; CHECK: [[PROF0]] = !{!"branch_weights", i32 2, i32 5}
|
|
; CHECK: [[PROF1]] = !{!"branch_weights", i32 101, i32 189}
|
|
;.
|