Files
TheRock/compiler/amd-llvm/llvm/test/Analysis/ScalarEvolution/scev-prestart-nowrap.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

83 lines
2.3 KiB
LLVM

; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
; An example run where SCEV(%postinc)->getStart() may overflow:
;
; %start = INT_SMAX
; %low.limit = INT_SMIN
; %high.limit = < not used >
;
; >> entry:
; %postinc.start = INT_SMIN
;
; >> loop:
; %idx = %start
; %postinc = INT_SMIN
; %postinc.inc = INT_SMIN + 1
; %postinc.sext = sext(INT_SMIN) = i64 INT32_SMIN
; %break.early = INT_SMIN `slt` INT_SMIN = false
; br i1 false, ___, %early.exit
;
; >> early.exit:
; ret i64 INT32_SMIN
define i64 @bad.0(i32 %start, i32 %low.limit, i32 %high.limit) {
; CHECK-LABEL: Classifying expressions for: @bad.0
entry:
%postinc.start = add i32 %start, 1
br label %loop
loop:
%idx = phi i32 [ %start, %entry ], [ %idx.inc, %continue ]
%postinc = phi i32 [ %postinc.start, %entry ], [ %postinc.inc, %continue ]
%postinc.inc = add nsw i32 %postinc, 1
%postinc.sext = sext i32 %postinc to i64
; CHECK: %postinc.sext = sext i32 %postinc to i64
; CHECK-NEXT: --> {(sext i32 (1 + %start) to i64),+,1}<nsw><%loop>
%break.early = icmp slt i32 %postinc, %low.limit
br i1 %break.early, label %continue, label %early.exit
continue:
%idx.inc = add nsw i32 %idx, 1
%cmp = icmp slt i32 %idx.inc, %high.limit
br i1 %cmp, label %loop, label %exit
exit:
ret i64 0
early.exit:
ret i64 %postinc.sext
}
define i64 @bad.1(i32 %start, i32 %low.limit, i32 %high.limit, ptr %unknown) {
; CHECK-LABEL: Classifying expressions for: @bad.1
entry:
%postinc.start = add i32 %start, 1
br label %loop
loop:
%idx = phi i32 [ %start, %entry ], [ %idx.inc, %continue ], [ %idx.inc, %continue.1 ]
%postinc = phi i32 [ %postinc.start, %entry ], [ %postinc.inc, %continue ], [ %postinc.inc, %continue.1 ]
%postinc.inc = add nsw i32 %postinc, 1
%postinc.sext = sext i32 %postinc to i64
; CHECK: %postinc.sext = sext i32 %postinc to i64
; CHECK-NEXT: --> {(sext i32 (1 + %start) to i64),+,1}<nsw><%loop>
%break.early = icmp slt i32 %postinc, %low.limit
br i1 %break.early, label %continue.1, label %early.exit
continue.1:
%cond = load volatile i1, ptr %unknown
%idx.inc = add nsw i32 %idx, 1
br i1 %cond, label %loop, label %continue
continue:
%cmp = icmp slt i32 %idx.inc, %high.limit
br i1 %cmp, label %loop, label %exit
exit:
ret i64 0
early.exit:
ret i64 %postinc.sext
}