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
94 lines
4.9 KiB
LLVM
94 lines
4.9 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals none --version 5
|
|
; RUN: opt -p loop-vectorize -force-vector-width=4 -force-vector-interleave=2 -S %s | FileCheck --check-prefix=VF4IC2 %s
|
|
; RUN: opt -p loop-vectorize -force-vector-width=8 -force-vector-interleave=1 -S %s | FileCheck --check-prefix=VF8IC1 %s
|
|
|
|
; Test case from https://github.com/llvm/llvm-project/issues/153946.
|
|
; %shr and thus %early.cond will be poison from %iv == 4 onwards.
|
|
; Make sure the mask being poison does not propagate across lanes in the
|
|
; OR reduction when computing the early exit condition in the vector loop.
|
|
define noundef i32 @f(i32 noundef %g) {
|
|
; VF4IC2-LABEL: define noundef i32 @f(
|
|
; VF4IC2-SAME: i32 noundef [[G:%.*]]) {
|
|
; VF4IC2-NEXT: [[ENTRY:.*:]]
|
|
; VF4IC2-NEXT: br label %[[VECTOR_PH:.*]]
|
|
; VF4IC2: [[VECTOR_PH]]:
|
|
; VF4IC2-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i32> poison, i32 [[G]], i64 0
|
|
; VF4IC2-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT]], <4 x i32> poison, <4 x i32> zeroinitializer
|
|
; VF4IC2-NEXT: br label %[[VECTOR_BODY:.*]]
|
|
; VF4IC2: [[VECTOR_BODY]]:
|
|
; VF4IC2-NEXT: [[TMP2:%.*]] = ashr <4 x i32> [[BROADCAST_SPLAT]], <i32 0, i32 8, i32 16, i32 24>
|
|
; VF4IC2-NEXT: [[TMP3:%.*]] = ashr <4 x i32> [[BROADCAST_SPLAT]], <i32 32, i32 40, i32 48, i32 56>
|
|
; VF4IC2-NEXT: [[TMP4:%.*]] = icmp ne <4 x i32> [[TMP2]], zeroinitializer
|
|
; VF4IC2-NEXT: [[TMP5:%.*]] = icmp ne <4 x i32> [[TMP3]], zeroinitializer
|
|
; VF4IC2-NEXT: [[TMP17:%.*]] = freeze <4 x i1> [[TMP4]]
|
|
; VF4IC2-NEXT: [[TMP18:%.*]] = freeze <4 x i1> [[TMP5]]
|
|
; VF4IC2-NEXT: [[TMP6:%.*]] = or <4 x i1> [[TMP17]], [[TMP18]]
|
|
; VF4IC2-NEXT: [[TMP7:%.*]] = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> [[TMP6]])
|
|
; VF4IC2-NEXT: br i1 [[TMP7]], label %[[VECTOR_EARLY_EXIT:.*]], label %[[MIDDLE_BLOCK:.*]]
|
|
; VF4IC2: [[MIDDLE_BLOCK]]:
|
|
; VF4IC2-NEXT: br label %[[MIDDLE_BLOCK1:.*]]
|
|
; VF4IC2: [[MIDDLE_BLOCK1]]:
|
|
; VF4IC2-NEXT: [[TMP8:%.*]] = extractelement <4 x i32> [[TMP3]], i64 3
|
|
; VF4IC2-NEXT: br label %[[RETURN:.*]]
|
|
; VF4IC2: [[VECTOR_EARLY_EXIT]]:
|
|
; VF4IC2-NEXT: [[TMP9:%.*]] = call i64 @llvm.experimental.cttz.elts.i64.v4i1(<4 x i1> [[TMP5]], i1 false)
|
|
; VF4IC2-NEXT: [[TMP10:%.*]] = add i64 4, [[TMP9]]
|
|
; VF4IC2-NEXT: [[TMP11:%.*]] = call i64 @llvm.experimental.cttz.elts.i64.v4i1(<4 x i1> [[TMP4]], i1 false)
|
|
; VF4IC2-NEXT: [[TMP12:%.*]] = add i64 0, [[TMP11]]
|
|
; VF4IC2-NEXT: [[TMP13:%.*]] = icmp ne i64 [[TMP11]], 4
|
|
; VF4IC2-NEXT: [[TMP14:%.*]] = select i1 [[TMP13]], i64 [[TMP12]], i64 [[TMP10]]
|
|
; VF4IC2-NEXT: [[TMP15:%.*]] = trunc i64 [[TMP14]] to i32
|
|
; VF4IC2-NEXT: br label %[[RETURN]]
|
|
; VF4IC2: [[RETURN]]:
|
|
; VF4IC2-NEXT: [[RES:%.*]] = phi i32 [ [[TMP8]], %[[MIDDLE_BLOCK1]] ], [ [[TMP15]], %[[VECTOR_EARLY_EXIT]] ]
|
|
; VF4IC2-NEXT: ret i32 [[RES]]
|
|
;
|
|
; VF8IC1-LABEL: define noundef i32 @f(
|
|
; VF8IC1-SAME: i32 noundef [[G:%.*]]) {
|
|
; VF8IC1-NEXT: [[ENTRY:.*:]]
|
|
; VF8IC1-NEXT: br label %[[VECTOR_PH:.*]]
|
|
; VF8IC1: [[VECTOR_PH]]:
|
|
; VF8IC1-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <8 x i32> poison, i32 [[G]], i64 0
|
|
; VF8IC1-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <8 x i32> [[BROADCAST_SPLATINSERT]], <8 x i32> poison, <8 x i32> zeroinitializer
|
|
; VF8IC1-NEXT: br label %[[VECTOR_BODY:.*]]
|
|
; VF8IC1: [[VECTOR_BODY]]:
|
|
; VF8IC1-NEXT: [[TMP1:%.*]] = ashr <8 x i32> [[BROADCAST_SPLAT]], <i32 0, i32 8, i32 16, i32 24, i32 32, i32 40, i32 48, i32 56>
|
|
; VF8IC1-NEXT: [[TMP2:%.*]] = icmp ne <8 x i32> [[TMP1]], zeroinitializer
|
|
; VF8IC1-NEXT: [[TMP8:%.*]] = freeze <8 x i1> [[TMP2]]
|
|
; VF8IC1-NEXT: [[TMP3:%.*]] = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> [[TMP8]])
|
|
; VF8IC1-NEXT: br i1 [[TMP3]], label %[[VECTOR_EARLY_EXIT:.*]], label %[[MIDDLE_BLOCK:.*]]
|
|
; VF8IC1: [[MIDDLE_BLOCK]]:
|
|
; VF8IC1-NEXT: br label %[[MIDDLE_BLOCK1:.*]]
|
|
; VF8IC1: [[MIDDLE_BLOCK1]]:
|
|
; VF8IC1-NEXT: [[TMP4:%.*]] = extractelement <8 x i32> [[TMP1]], i64 7
|
|
; VF8IC1-NEXT: br label %[[RETURN:.*]]
|
|
; VF8IC1: [[VECTOR_EARLY_EXIT]]:
|
|
; VF8IC1-NEXT: [[TMP5:%.*]] = call i64 @llvm.experimental.cttz.elts.i64.v8i1(<8 x i1> [[TMP2]], i1 false)
|
|
; VF8IC1-NEXT: [[TMP6:%.*]] = trunc i64 [[TMP5]] to i32
|
|
; VF8IC1-NEXT: br label %[[RETURN]]
|
|
; VF8IC1: [[RETURN]]:
|
|
; VF8IC1-NEXT: [[RES:%.*]] = phi i32 [ [[TMP4]], %[[MIDDLE_BLOCK1]] ], [ [[TMP6]], %[[VECTOR_EARLY_EXIT]] ]
|
|
; VF8IC1-NEXT: ret i32 [[RES]]
|
|
;
|
|
entry:
|
|
br label %loop.header
|
|
|
|
loop.header:
|
|
%iv = phi i32 [ 0, %entry ], [ %iv.next, %loop.latch ]
|
|
%mul = shl nuw nsw i32 %iv, 3
|
|
%shr = ashr i32 %g, %mul
|
|
%early.cond = icmp eq i32 %shr, 0
|
|
br i1 %early.cond, label %loop.latch, label %return
|
|
|
|
loop.latch:
|
|
%iv.next = add nuw nsw i32 %iv, 1
|
|
%ec = icmp eq i32 %iv.next, 8
|
|
br i1 %ec, label %return, label %loop.header
|
|
|
|
return:
|
|
%res = phi i32 [ %shr, %loop.latch ], [ %iv, %loop.header ]
|
|
ret i32 %res
|
|
}
|
|
|
|
|