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
110 lines
4.6 KiB
LLVM
110 lines
4.6 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
|
|
; RUN: opt -passes='print<scalar-evolution>' -scalar-evolution-classify-expressions=0 -disable-output %s 2>&1 | FileCheck %s
|
|
|
|
; The UDiv in the latch may never be executed. The backedge-taken-count
|
|
; expressions must account for the fact that evaluating the UDiv
|
|
; unconditionally may trigger UB.
|
|
define i64 @multi_exit_exit_count_with_udiv_by_value_in_latch(ptr %dst, i64 %N) {
|
|
; CHECK-LABEL: 'multi_exit_exit_count_with_udiv_by_value_in_latch'
|
|
; CHECK-NEXT: Determining loop execution counts for: @multi_exit_exit_count_with_udiv_by_value_in_latch
|
|
; CHECK-NEXT: Loop %loop.header: <multiple exits> backedge-taken count is ((0 smax %N) umin_seq (42 /u %N))
|
|
; CHECK-NEXT: exit count for loop.header: (0 smax %N)
|
|
; CHECK-NEXT: exit count for loop.latch: (42 /u %N)
|
|
; CHECK-NEXT: Loop %loop.header: constant max backedge-taken count is i64 42
|
|
; CHECK-NEXT: Loop %loop.header: symbolic max backedge-taken count is ((0 smax %N) umin_seq (42 /u %N))
|
|
; CHECK-NEXT: symbolic max exit count for loop.header: (0 smax %N)
|
|
; CHECK-NEXT: symbolic max exit count for loop.latch: (42 /u %N)
|
|
; CHECK-NEXT: Loop %loop.header: Trip multiple is 1
|
|
;
|
|
entry:
|
|
br label %loop.header
|
|
|
|
loop.header:
|
|
%iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
|
|
%gep = getelementptr inbounds i32, ptr %dst, i64 %iv
|
|
store i32 1, ptr %gep
|
|
%c.0 = icmp slt i64 %iv, %N
|
|
br i1 %c.0, label %loop.latch, label %exit
|
|
|
|
loop.latch:
|
|
%iv.next = add i64 %iv, 1
|
|
%d = udiv i64 42, %N
|
|
%c.1 = icmp slt i64 %iv, %d
|
|
br i1 %c.1, label %loop.header, label %exit
|
|
|
|
exit:
|
|
%p = phi i64 [ 1, %loop.header ], [ 0, %loop.latch]
|
|
ret i64 %p
|
|
}
|
|
|
|
; The UDiv in the latch may never be executed. The backedge-taken-count
|
|
; expressions must account for the fact that evaluating the UDiv
|
|
; unconditionally may trigger UB.
|
|
define i64 @multi_exit_exit_count_with_udiv_by_value_in_latch_different_bounds(ptr %dst, i64 %N, i64 %M) {
|
|
; CHECK-LABEL: 'multi_exit_exit_count_with_udiv_by_value_in_latch_different_bounds'
|
|
; CHECK-NEXT: Determining loop execution counts for: @multi_exit_exit_count_with_udiv_by_value_in_latch_different_bounds
|
|
; CHECK-NEXT: Loop %loop.header: <multiple exits> backedge-taken count is ((0 smax %N) umin_seq (42 /u %M))
|
|
; CHECK-NEXT: exit count for loop.header: (0 smax %N)
|
|
; CHECK-NEXT: exit count for loop.latch: (42 /u %M)
|
|
; CHECK-NEXT: Loop %loop.header: constant max backedge-taken count is i64 42
|
|
; CHECK-NEXT: Loop %loop.header: symbolic max backedge-taken count is ((0 smax %N) umin_seq (42 /u %M))
|
|
; CHECK-NEXT: symbolic max exit count for loop.header: (0 smax %N)
|
|
; CHECK-NEXT: symbolic max exit count for loop.latch: (42 /u %M)
|
|
; CHECK-NEXT: Loop %loop.header: Trip multiple is 1
|
|
;
|
|
entry:
|
|
br label %loop.header
|
|
|
|
loop.header:
|
|
%iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
|
|
%gep = getelementptr inbounds i32, ptr %dst, i64 %iv
|
|
store i32 1, ptr %gep
|
|
%c.0 = icmp slt i64 %iv, %N
|
|
br i1 %c.0, label %loop.latch, label %exit
|
|
|
|
loop.latch:
|
|
%iv.next = add i64 %iv, 1
|
|
%d = udiv i64 42, %M
|
|
%c.1 = icmp slt i64 %iv, %d
|
|
br i1 %c.1, label %loop.header, label %exit
|
|
|
|
exit:
|
|
%p = phi i64 [ 1, %loop.header ], [ 0, %loop.latch]
|
|
ret i64 %p
|
|
}
|
|
|
|
; The UDiv in the latch cannot trigger UB, evaluating it unconditionally in the
|
|
; trip count expression is fine.
|
|
define i64 @multi_exit_exit_count_with_udiv_by_constant_in_latch(ptr %dst, i64 %N) {
|
|
; CHECK-LABEL: 'multi_exit_exit_count_with_udiv_by_constant_in_latch'
|
|
; CHECK-NEXT: Determining loop execution counts for: @multi_exit_exit_count_with_udiv_by_constant_in_latch
|
|
; CHECK-NEXT: Loop %loop.header: <multiple exits> backedge-taken count is ((%N /u 42) umin (0 smax %N))
|
|
; CHECK-NEXT: exit count for loop.header: (0 smax %N)
|
|
; CHECK-NEXT: exit count for loop.latch: (%N /u 42)
|
|
; CHECK-NEXT: Loop %loop.header: constant max backedge-taken count is i64 439208192231179800
|
|
; CHECK-NEXT: Loop %loop.header: symbolic max backedge-taken count is ((%N /u 42) umin (0 smax %N))
|
|
; CHECK-NEXT: symbolic max exit count for loop.header: (0 smax %N)
|
|
; CHECK-NEXT: symbolic max exit count for loop.latch: (%N /u 42)
|
|
; CHECK-NEXT: Loop %loop.header: Trip multiple is 1
|
|
;
|
|
entry:
|
|
br label %loop.header
|
|
|
|
loop.header:
|
|
%iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
|
|
%gep = getelementptr inbounds i32, ptr %dst, i64 %iv
|
|
store i32 1, ptr %gep
|
|
%c.0 = icmp slt i64 %iv, %N
|
|
br i1 %c.0, label %loop.latch, label %exit
|
|
|
|
loop.latch:
|
|
%iv.next = add i64 %iv, 1
|
|
%d = udiv i64 %N, 42
|
|
%c.1 = icmp slt i64 %iv, %d
|
|
br i1 %c.1, label %loop.header, label %exit
|
|
|
|
exit:
|
|
%p = phi i64 [ 1, %loop.header ], [ 0, %loop.latch]
|
|
ret i64 %p
|
|
}
|