Files
TheRock/compiler/amd-llvm/llvm/test/Analysis/ScalarEvolution/huge-trip-multiple.ll
T
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

143 lines
7.1 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2
; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
; Tests loops with huge trip counts. Trip count of >=2^32 are huge. Huge trip counts have a trip multiple
; of the greatest power of 2 less than 2^32.
declare void @foo(...)
define void @trip_count_4294967295() {
; CHECK-LABEL: 'trip_count_4294967295'
; CHECK-NEXT: Classifying expressions for: @trip_count_4294967295
; CHECK-NEXT: %i.02 = phi i64 [ 0, %entry ], [ %add, %for.body ]
; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%for.body> U: [0,4294967295) S: [0,4294967295) Exits: 4294967294 LoopDispositions: { %for.body: Computable }
; CHECK-NEXT: %add = add nuw nsw i64 %i.02, 1
; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%for.body> U: [1,4294967296) S: [1,4294967296) Exits: 4294967295 LoopDispositions: { %for.body: Computable }
; CHECK-NEXT: Determining loop execution counts for: @trip_count_4294967295
; CHECK-NEXT: Loop %for.body: backedge-taken count is i64 4294967294
; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is i64 4294967294
; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is i64 4294967294
; CHECK-NEXT: Loop %for.body: Trip multiple is 4294967295
;
entry:
br label %for.body
for.cond.cleanup: ; preds = %for.body
ret void
for.body: ; preds = %entry, %for.body
%i.02 = phi i64 [ 0, %entry ], [ %add, %for.body ]
tail call void (...) @foo() #2
%add = add nuw nsw i64 %i.02, 1
%exitcond.not = icmp eq i64 %add, 4294967295
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
define void @trip_count_4294967296() {
; CHECK-LABEL: 'trip_count_4294967296'
; CHECK-NEXT: Classifying expressions for: @trip_count_4294967296
; CHECK-NEXT: %i.02 = phi i64 [ 0, %entry ], [ %add, %for.body ]
; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%for.body> U: [0,4294967296) S: [0,4294967296) Exits: 4294967295 LoopDispositions: { %for.body: Computable }
; CHECK-NEXT: %add = add nuw nsw i64 %i.02, 1
; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%for.body> U: [1,4294967297) S: [1,4294967297) Exits: 4294967296 LoopDispositions: { %for.body: Computable }
; CHECK-NEXT: Determining loop execution counts for: @trip_count_4294967296
; CHECK-NEXT: Loop %for.body: backedge-taken count is i64 4294967295
; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is i64 4294967295
; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is i64 4294967295
; CHECK-NEXT: Loop %for.body: Trip multiple is 2147483648
;
entry:
br label %for.body
for.cond.cleanup: ; preds = %for.body
ret void
for.body: ; preds = %entry, %for.body
%i.02 = phi i64 [ 0, %entry ], [ %add, %for.body ]
tail call void (...) @foo() #2
%add = add nuw nsw i64 %i.02, 1
%exitcond.not = icmp eq i64 %add, 4294967296
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
define void @trip_count_8589935692() {
; CHECK-LABEL: 'trip_count_8589935692'
; CHECK-NEXT: Classifying expressions for: @trip_count_8589935692
; CHECK-NEXT: %i.02 = phi i64 [ 0, %entry ], [ %add, %for.body ]
; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%for.body> U: [0,8589934592) S: [0,8589934592) Exits: 8589934591 LoopDispositions: { %for.body: Computable }
; CHECK-NEXT: %add = add nuw nsw i64 %i.02, 1
; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%for.body> U: [1,8589934593) S: [1,8589934593) Exits: 8589934592 LoopDispositions: { %for.body: Computable }
; CHECK-NEXT: Determining loop execution counts for: @trip_count_8589935692
; CHECK-NEXT: Loop %for.body: backedge-taken count is i64 8589934591
; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is i64 8589934591
; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is i64 8589934591
; CHECK-NEXT: Loop %for.body: Trip multiple is 2147483648
;
entry:
br label %for.body
for.cond.cleanup: ; preds = %for.body
ret void
for.body: ; preds = %entry, %for.body
%i.02 = phi i64 [ 0, %entry ], [ %add, %for.body ]
tail call void (...) @foo() #2
%add = add nuw nsw i64 %i.02, 1
%exitcond.not = icmp eq i64 %add, 8589934592
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
define void @trip_count_9223372036854775808() {
; CHECK-LABEL: 'trip_count_9223372036854775808'
; CHECK-NEXT: Classifying expressions for: @trip_count_9223372036854775808
; CHECK-NEXT: %i.02 = phi i64 [ 0, %entry ], [ %add, %for.body ]
; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%for.body> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: 9223372036854775807 LoopDispositions: { %for.body: Computable }
; CHECK-NEXT: %add = add nuw nsw i64 %i.02, 1
; CHECK-NEXT: --> {1,+,1}<nuw><%for.body> U: [1,-9223372036854775807) S: [1,-9223372036854775807) Exits: -9223372036854775808 LoopDispositions: { %for.body: Computable }
; CHECK-NEXT: Determining loop execution counts for: @trip_count_9223372036854775808
; CHECK-NEXT: Loop %for.body: backedge-taken count is i64 9223372036854775807
; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is i64 9223372036854775807
; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is i64 9223372036854775807
; CHECK-NEXT: Loop %for.body: Trip multiple is 2147483648
;
entry:
br label %for.body
for.cond.cleanup: ; preds = %for.body
ret void
for.body: ; preds = %entry, %for.body
%i.02 = phi i64 [ 0, %entry ], [ %add, %for.body ]
tail call void (...) @foo() #2
%add = add nuw nsw i64 %i.02, 1
%exitcond.not = icmp eq i64 %add, 9223372036854775808
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}
define void @trip_count_18446744073709551615() {
; CHECK-LABEL: 'trip_count_18446744073709551615'
; CHECK-NEXT: Classifying expressions for: @trip_count_18446744073709551615
; CHECK-NEXT: %i.02 = phi i64 [ 0, %entry ], [ %add, %for.body ]
; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%for.body> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: -2 LoopDispositions: { %for.body: Computable }
; CHECK-NEXT: %add = add nuw nsw i64 %i.02, 1
; CHECK-NEXT: --> {1,+,1}<nuw><%for.body> U: [1,0) S: [1,0) Exits: -1 LoopDispositions: { %for.body: Computable }
; CHECK-NEXT: Determining loop execution counts for: @trip_count_18446744073709551615
; CHECK-NEXT: Loop %for.body: backedge-taken count is i64 -2
; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is i64 -2
; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is i64 -2
; CHECK-NEXT: Loop %for.body: Trip multiple is 1
;
entry:
br label %for.body
for.cond.cleanup: ; preds = %for.body
ret void
for.body: ; preds = %entry, %for.body
%i.02 = phi i64 [ 0, %entry ], [ %add, %for.body ]
tail call void (...) @foo() #2
%add = add nuw nsw i64 %i.02, 1
%exitcond.not = icmp eq i64 %add, 18446744073709551615
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
}