Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/SCCP/pr45185-range-predinfo.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

60 lines
2.1 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=ipsccp -S %s | FileCheck %s
;Test for PR45185.
define void @spam(ptr %arg) {
; CHECK-LABEL: define void @spam(
; CHECK-SAME: ptr [[ARG:%.*]]) {
; CHECK-NEXT: [[BB:.*:]]
; CHECK-NEXT: call void @blam(i32 0, ptr nonnull [[ARG]])
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds nuw [4 x [24 x float]], ptr [[ARG]], i64 0, i64 1, i64 0
; CHECK-NEXT: call void @blam(i32 1, ptr nonnull [[TMP1]])
; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds nuw [4 x [24 x float]], ptr [[ARG]], i64 0, i64 2, i64 0
; CHECK-NEXT: call void @blam(i32 2, ptr nonnull [[TMP2]])
; CHECK-NEXT: ret void
;
bb:
call void @blam(i32 0, ptr nonnull %arg)
%tmp1 = getelementptr inbounds [4 x [24 x float]], ptr %arg, i64 0, i64 1, i64 0
call void @blam(i32 1, ptr nonnull %tmp1)
%tmp2 = getelementptr inbounds [4 x [24 x float]], ptr %arg, i64 0, i64 2, i64 0
call void @blam(i32 2, ptr nonnull %tmp2)
ret void
}
; Make sure we do not incorrectly eliminate the checks in @blam.
define internal void @blam(i32 %arg, ptr nocapture %arg1) {
; CHECK-LABEL: define internal void @blam(
; CHECK-SAME: i32 range(i32 0, 3) [[ARG:%.*]], ptr captures(none) [[ARG1:%.*]]) {
; CHECK-NEXT: [[BB:.*:]]
; CHECK-NEXT: [[TMP:%.*]] = icmp eq i32 [[ARG]], 0
; CHECK-NEXT: br i1 [[TMP]], label %[[BB2:.*]], label %[[BB3:.*]]
; CHECK: [[BB2]]:
; CHECK-NEXT: br label %[[BB5:.*]]
; CHECK: [[BB3]]:
; CHECK-NEXT: [[TMP4:%.*]] = icmp eq i32 [[ARG]], 2
; CHECK-NEXT: br i1 [[TMP4]], label %[[BB5]], label %[[BB6:.*]]
; CHECK: [[BB5]]:
; CHECK-NEXT: ret void
; CHECK: [[BB6]]:
; CHECK-NEXT: ret void
;
bb:
%tmp = icmp eq i32 %arg, 0
br i1 %tmp, label %bb2, label %bb3
bb2: ; preds = %bb
br label %bb5
bb3: ; preds = %bb
%tmp4 = icmp eq i32 %arg, 2
br i1 %tmp4, label %bb5, label %bb6
bb5: ; preds = %bb3, %bb2
ret void
bb6: ; preds = %bb3
ret void
}