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
67 lines
2.5 KiB
LLVM
67 lines
2.5 KiB
LLVM
; Test branch weight metadata, estimated trip count metadata, and block
|
|
; frequencies after partial loop unrolling without -unroll-runtime and without
|
|
; converting any iteration's latch to an unconditional branch.
|
|
|
|
; ------------------------------------------------------------------------------
|
|
; RUN: opt < %s -S -passes='print<block-freq>' 2>&1 | \
|
|
; RUN: FileCheck -check-prefix=CHECK %s
|
|
;
|
|
; Verify that the test code produces the original loop body frequency we expect.
|
|
; CHECK: - do.body: float = 10.0,
|
|
|
|
; ------------------------------------------------------------------------------
|
|
; RUN: opt < %s -S -passes='loop-unroll,print<block-freq>' \
|
|
; RUN: -unroll-count=4 2>&1 | \
|
|
; RUN: FileCheck %s -check-prefix=CHECK-UR \
|
|
; RUN: -implicit-check-not='llvm.loop.estimated_trip_count' \
|
|
; RUN: -implicit-check-not='!prof' \
|
|
; RUN: -implicit-check-not='branch_weights' \
|
|
; RUN: -implicit-check-not='call void @f'
|
|
;
|
|
; The sum is approximately the original loop body frequency, 10.
|
|
; CHECK-UR: - do.body: float = 2.9078,
|
|
; CHECK-UR: - do.body.1: float = 2.617,
|
|
; CHECK-UR: - do.body.2: float = 2.3553,
|
|
; CHECK-UR: - do.body.3: float = 2.1198,
|
|
;
|
|
; The original branch weights are preserved across all unrolled iterations and
|
|
; the remaining loop, and there is one original loop body (represented by a call
|
|
; to @f) within each unrolled iteration.
|
|
; CHECK-UR: call void @f
|
|
; CHECK-UR: br i1 %{{.*}}, label %do.end, label %do.body.1, !prof !0
|
|
; CHECK-UR: call void @f
|
|
; CHECK-UR: br i1 %{{.*}}, label %do.end, label %do.body.2, !prof !0
|
|
; CHECK-UR: call void @f
|
|
; CHECK-UR: br i1 %{{.*}}, label %do.end, label %do.body.3, !prof !0
|
|
; CHECK-UR: call void @f
|
|
; CHECK-UR: br i1 %{{.*}}, label %do.end, label %do.body, !prof !0, !llvm.loop !1
|
|
; CHECK-UR: !0 = !{!"branch_weights", i32 1, i32 9}
|
|
;
|
|
; llvm.loop.estimated_trip_count is the original estimated trip count (which is
|
|
; the original loop body frequency, 10, because there is no prior
|
|
; llvm.loop.estimated_trip_count) divided by the unroll count, 4, rounded up to
|
|
; the next integer.
|
|
; CHECK-UR: !1 = distinct !{!1, !2, !3}
|
|
; CHECK-UR: !2 = !{!"llvm.loop.estimated_trip_count", i32 3}
|
|
; CHECK-UR: !3 = !{!"llvm.loop.unroll.disable"}
|
|
|
|
declare void @f(i32)
|
|
|
|
define void @test(i32 %n) {
|
|
|
|
entry:
|
|
br label %do.body
|
|
|
|
do.body:
|
|
%i = phi i32 [ 0, %entry ], [ %inc, %do.body ]
|
|
%inc = add i32 %i, 1
|
|
call void @f(i32 %i)
|
|
%c = icmp sge i32 %inc, %n
|
|
br i1 %c, label %do.end, label %do.body, !prof !0
|
|
|
|
do.end:
|
|
ret void
|
|
}
|
|
|
|
!0 = !{!"branch_weights", i32 1, i32 9}
|