Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/SLPVectorizer/slp-umax-rdx-matcher-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

69 lines
2.5 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=slp-vectorizer -S < %s | FileCheck %s
; Given LLVM IR caused associative reduction matching routine crash in SLP.
; The routines begins with select as integer Umax reduction kind
; and then follows to llvm.umax intrinsic call which also matched
; to UMax and thus same reduction kind is returned.
; The routine's later code merely assumes the instruction to be a select.
define dso_local void @test(i1 %arg) {
; CHECK-LABEL: @test(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 %arg, label [[NEXT:%.*]], label [[THEN:%.*]]
; CHECK: then:
; CHECK-NEXT: [[UM:%.*]] = call i8 @llvm.umax.i8(i8 0, i8 undef)
; CHECK-NEXT: [[SELCMP:%.*]] = icmp ult i8 [[UM]], undef
; CHECK-NEXT: [[I0:%.*]] = select i1 [[SELCMP]], i8 undef, i8 [[UM]]
; CHECK-NEXT: br label [[NEXT]]
; CHECK: next:
; CHECK-NEXT: [[T7_0:%.*]] = phi i8 [ undef, [[ENTRY:%.*]] ], [ [[I0]], [[THEN]] ]
; CHECK-NEXT: ret void
;
entry:
br i1 %arg, label %next, label %then
then:
%um = call i8 @llvm.umax.i8(i8 0, i8 undef)
%selcmp = icmp ult i8 %um, undef
%i0 = select i1 %selcmp, i8 undef, i8 %um
br label %next
next:
%t7.0 = phi i8 [ undef, %entry ], [ %i0, %then ]
ret void
}
declare i8 @llvm.umax.i8(i8, i8)
declare i32 @llvm.smin.i32(i32, i32)
declare i32 @llvm.umin.i32(i32, i32)
; Given LLVM IR caused crash in SLP.
define void @test2() {
; CHECK-LABEL: @test2(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = call <4 x i32> @llvm.smin.v4i32(<4 x i32> <i32 3, i32 2, i32 1, i32 undef>, <4 x i32> <i32 undef, i32 undef, i32 undef, i32 0>)
; CHECK-NEXT: [[TMP1:%.*]] = sub nsw <4 x i32> undef, [[TMP0]]
; CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.vector.reduce.umin.v4i32(<4 x i32> [[TMP1]])
; CHECK-NEXT: [[TMP3:%.*]] = call i32 @llvm.umin.i32(i32 [[TMP2]], i32 77)
; CHECK-NEXT: [[E:%.*]] = icmp ugt i32 [[TMP3]], 1
; CHECK-NEXT: ret void
;
entry:
%smin0 = call i32 @llvm.smin.i32(i32 undef, i32 0)
%smin1 = call i32 @llvm.smin.i32(i32 undef, i32 1)
%smin2 = call i32 @llvm.smin.i32(i32 undef, i32 2)
%smin3 = call i32 @llvm.smin.i32(i32 undef, i32 3)
%a = sub nsw i32 undef, %smin0
%b = sub nsw i32 undef, %smin1
%c = sub nsw i32 undef, %smin2
%d = sub nsw i32 undef, %smin3
%umin0 = call i32 @llvm.umin.i32(i32 %d, i32 %c)
%umin1 = call i32 @llvm.umin.i32(i32 %umin0, i32 %b)
%umin2 = call i32 @llvm.umin.i32(i32 %umin1, i32 %a)
%umin3 = call i32 @llvm.umin.i32(i32 %umin2, i32 77)
%e = icmp ugt i32 %umin3, 1
ret void
}