Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/GVN/PRE/load-pre-num-unavailable-preds-crash.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

61 lines
2.6 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt -S -passes=gvn < %s | FileCheck %s
; Regression test for a GVN PRE assertion crash in PerformLoadPRE.
@b = external global [1 x i32]
define void @e() {
; CHECK-LABEL: define void @e() {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br i1 true, label %[[FOR_END4:.*]], label %[[ENTRY_C_CRIT_EDGE:.*]]
; CHECK: [[ENTRY_C_CRIT_EDGE]]:
; CHECK-NEXT: [[DOTPRE1:%.*]] = load i32, ptr null, align 4
; CHECK-NEXT: br label %[[C:.*]]
; CHECK: [[FOR_END4]]:
; CHECK-NEXT: store i32 0, ptr getelementptr inbounds nuw (i8, ptr @b, i64 4), align 4
; CHECK-NEXT: [[DOTPRE:%.*]] = load i32, ptr null, align 4
; CHECK-NEXT: br label %[[FOR_COND5:.*]]
; CHECK: [[FOR_COND5]]:
; CHECK-NEXT: [[TMP0:%.*]] = phi i32 [ [[TMP1:%.*]], %[[C]] ], [ [[DOTPRE]], %[[FOR_END4]] ]
; CHECK-NEXT: [[CMP6:%.*]] = icmp eq i32 [[TMP0]], 0
; CHECK-NEXT: br i1 [[CMP6]], label %[[FOR_COND5_C_CRIT_EDGE:.*]], label %[[FOR_END8:.*]]
; CHECK: [[FOR_COND5_C_CRIT_EDGE]]:
; CHECK-NEXT: [[DOTPRE2:%.*]] = load i32, ptr getelementptr inbounds nuw (i8, ptr @b, i64 4), align 4
; CHECK-NEXT: br label %[[C]]
; CHECK: [[C]]:
; CHECK-NEXT: [[TMP1]] = phi i32 [ poison, %[[ENTRY_C_CRIT_EDGE]] ], [ [[DOTPRE2]], %[[FOR_COND5_C_CRIT_EDGE]] ]
; CHECK-NEXT: [[TMP2:%.*]] = phi i32 [ [[DOTPRE1]], %[[ENTRY_C_CRIT_EDGE]] ], [ 0, %[[FOR_COND5_C_CRIT_EDGE]] ]
; CHECK-NEXT: [[ADD:%.*]] = add i32 [[TMP2]], 1
; CHECK-NEXT: [[IDXPROM:%.*]] = zext i32 [[ADD]] to i64
; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr [4 x i8], ptr @b, i64 [[IDXPROM]]
; CHECK-NEXT: store i32 [[TMP1]], ptr null, align 4
; CHECK-NEXT: br label %[[FOR_COND5]]
; CHECK: [[FOR_END8]]:
; CHECK-NEXT: ret void
;
entry:
br i1 true, label %for.end4, label %c
for.end4: ; preds = %entry
store i32 0, ptr getelementptr inbounds nuw (i8, ptr @b, i64 4), align 4
br label %for.cond5
for.cond5: ; preds = %c, %for.end4
%0 = load i32, ptr null, align 4
%cmp6 = icmp eq i32 %0, 0
br i1 %cmp6, label %c, label %for.end8
c: ; preds = %for.cond5, %entry
%1 = load i32, ptr null, align 4
%add = add i32 %1, 1
%idxprom = zext i32 %add to i64
%arrayidx = getelementptr [4 x i8], ptr @b, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4
store i32 %2, ptr null, align 4
br label %for.cond5
for.end8: ; preds = %for.cond5
ret void
}