Files
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

121 lines
2.0 KiB
LLVM

; RUN: llc -mtriple=i686-linux < %s | FileCheck %s
; Don't rotate the loop if the number of fall through to exit is not larger
; than the number of fall through to header.
define void @no_rotate() {
; CHECK-LABEL: no_rotate
; CHECK: %entry
; CHECK: %header
; CHECK: %middle
; CHECK: %latch1
; CHECK: %latch2
; CHECK: %end
entry:
br label %header
header:
%val1 = call i1 @foo()
br i1 %val1, label %middle, label %end
middle:
%val2 = call i1 @foo()
br i1 %val2, label %latch1, label %end
latch1:
%val3 = call i1 @foo()
br i1 %val3, label %latch2, label %header
latch2:
%val4 = call i1 @foo()
br label %header
end:
ret void
}
define void @do_rotate() {
; CHECK-LABEL: do_rotate
; CHECK: %entry
; CHECK: %then
; CHECK: %else
; CHECK: %latch1
; CHECK: %latch2
; CHECK: %header
; CHECK: %end
entry:
%val0 = call i1 @foo()
br i1 %val0, label %then, label %else
then:
call void @a()
br label %header
else:
call void @b()
br label %header
header:
%val1 = call i1 @foo()
br i1 %val1, label %latch1, label %end
latch1:
%val3 = call i1 @foo()
br i1 %val3, label %latch2, label %header
latch2:
%val4 = call i1 @foo()
br label %header
end:
ret void
}
; The loop structure is same as in @no_rotate, but the loop header's predecessor
; doesn't fall through to it, so it should be rotated to get exit fall through.
define void @do_rotate2() {
; CHECK-LABEL: do_rotate2
; CHECK: %entry
; CHECK: %then
; CHECK: %middle
; CHECK: %latch1
; CHECK: %latch2
; CHECK: %header
; CHECK: %exit
entry:
%val0 = call i1 @foo()
br i1 %val0, label %then, label %header, !prof !1
then:
call void @a()
br label %end
header:
%val1 = call i1 @foo()
br i1 %val1, label %middle, label %exit
middle:
%val2 = call i1 @foo()
br i1 %val2, label %latch1, label %exit
latch1:
%val3 = call i1 @foo()
br i1 %val3, label %latch2, label %header
latch2:
%val4 = call i1 @foo()
br label %header
exit:
call void @b()
br label %end
end:
ret void
}
declare i1 @foo()
declare void @a()
declare void @b()
!1 = !{!"branch_weights", i32 10, i32 1}