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
149 lines
6.9 KiB
LLVM
149 lines
6.9 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter "br" --filter "^.*:"
|
|
; RUN: opt -passes="print<block-freq>,loop-vectorize" -force-vector-width=4 -force-vector-interleave=1 -S < %s | FileCheck %s
|
|
; RUN: opt -passes="print<block-freq>,loop-vectorize" -force-vector-width=4 -force-vector-interleave=4 -S < %s | FileCheck %s -check-prefix=CHECK-MASKED
|
|
; RUN: opt -passes="print<block-freq>,loop-vectorize" -force-vector-width=4 -force-vector-interleave=1 \
|
|
; RUN: -scalable-vectorization=on -force-target-supports-scalable-vectors -S < %s | FileCheck %s -check-prefix=CHECK-SCALABLE
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
@a = global [1024 x i32] zeroinitializer, align 16
|
|
@b = global [1024 x i32] zeroinitializer, align 16
|
|
|
|
; Check correctness of profile info for vectorization without epilog.
|
|
define void @_Z3foov() {
|
|
; CHECK-LABEL: @_Z3foov(
|
|
; CHECK: entry:
|
|
; CHECK: br label [[VECTOR_PH:%.*]]
|
|
; CHECK: vector.ph:
|
|
; CHECK: br label [[VECTOR_BODY:%.*]]
|
|
; CHECK: vector.body:
|
|
; CHECK: br i1 [[TMP4:%.*]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !prof [[PROF0:![0-9]+]], !llvm.loop [[LOOP1:![0-9]+]]
|
|
; CHECK: middle.block:
|
|
; CHECK: br label [[FOR_BODY:%.*]]
|
|
; CHECK: for.cond.cleanup:
|
|
;
|
|
; CHECK-MASKED-LABEL: @_Z3foov(
|
|
; CHECK-MASKED: entry:
|
|
; CHECK-MASKED: br label [[VECTOR_PH:%.*]]
|
|
; CHECK-MASKED: vector.ph:
|
|
; CHECK-MASKED: br label [[VECTOR_BODY:%.*]]
|
|
; CHECK-MASKED: vector.body:
|
|
; CHECK-MASKED: br i1 [[TMP16:%.*]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !prof [[PROF0:![0-9]+]], !llvm.loop [[LOOP1:![0-9]+]]
|
|
; CHECK-MASKED: middle.block:
|
|
; CHECK-MASKED: br label [[FOR_BODY:%.*]]
|
|
; CHECK-MASKED: for.cond.cleanup:
|
|
;
|
|
; CHECK-SCALABLE-LABEL: @_Z3foov(
|
|
; CHECK-SCALABLE: entry:
|
|
; CHECK-SCALABLE: br i1 [[MIN_ITERS_CHECK:%.*]], label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]], !prof [[PROF0:![0-9]+]]
|
|
; CHECK-SCALABLE: vector.ph:
|
|
; CHECK-SCALABLE: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP9:%.*]], i64 0
|
|
; CHECK-SCALABLE: [[BROADCAST_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[BROADCAST_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
|
|
; CHECK-SCALABLE: br label [[VECTOR_BODY:%.*]]
|
|
; CHECK-SCALABLE: vector.body:
|
|
; CHECK-SCALABLE: [[VEC_IND_NEXT:%.*]] = add <vscale x 4 x i32> [[VEC_IND:%.*]], [[BROADCAST_SPLAT]]
|
|
; CHECK-SCALABLE: br i1 [[TMP11:%.*]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !prof [[PROF1:![0-9]+]], !llvm.loop [[LOOP2:![0-9]+]]
|
|
; CHECK-SCALABLE: middle.block:
|
|
; CHECK-SCALABLE: br i1 [[CMP_N:%.*]], label [[FOR_COND_CLEANUP:%.*]], label [[SCALAR_PH]], !prof [[PROF6:![0-9]+]]
|
|
; CHECK-SCALABLE: scalar.ph:
|
|
; CHECK-SCALABLE: br label [[FOR_BODY:%.*]]
|
|
; CHECK-SCALABLE: for.cond.cleanup:
|
|
; CHECK-SCALABLE: for.body:
|
|
; CHECK-SCALABLE: br i1 [[EXITCOND:%.*]], label [[FOR_COND_CLEANUP]], label [[FOR_BODY]], !prof [[PROF7:![0-9]+]], !llvm.loop [[LOOP8:![0-9]+]]
|
|
;
|
|
entry:
|
|
br label %for.body
|
|
|
|
for.cond.cleanup:
|
|
ret void
|
|
|
|
for.body:
|
|
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
|
|
%arrayidx = getelementptr inbounds [1024 x i32], ptr @b, i64 0, i64 %iv
|
|
%0 = load i32, ptr %arrayidx, align 4
|
|
%1 = trunc i64 %iv to i32
|
|
%mul = mul nsw i32 %0, %1
|
|
%arrayidx2 = getelementptr inbounds [1024 x i32], ptr @a, i64 0, i64 %iv
|
|
%2 = load i32, ptr %arrayidx2, align 4
|
|
%add = add nsw i32 %2, %mul
|
|
store i32 %add, ptr %arrayidx2, align 4
|
|
%iv.next = add nuw nsw i64 %iv, 1
|
|
%exitcond = icmp eq i64 %iv.next, 1024
|
|
br i1 %exitcond, label %for.cond.cleanup, label %for.body, !prof !0
|
|
}
|
|
|
|
; Check correctness of profile info for vectorization with epilog.
|
|
define void @_Z3foo2v() {
|
|
; CHECK-LABEL: @_Z3foo2v(
|
|
; CHECK: entry:
|
|
; CHECK: br label [[VECTOR_PH:%.*]]
|
|
; CHECK: vector.ph:
|
|
; CHECK: br label [[VECTOR_BODY:%.*]]
|
|
; CHECK: vector.body:
|
|
; CHECK: br i1 [[TMP4:%.*]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !prof [[PROF0]], !llvm.loop [[LOOP5:![0-9]+]]
|
|
; CHECK: middle.block:
|
|
; CHECK: br label [[SCALAR_PH:%.*]]
|
|
; CHECK: scalar.ph:
|
|
; CHECK: br label [[FOR_BODY:%.*]]
|
|
; CHECK: for.cond.cleanup:
|
|
; CHECK: for.body:
|
|
; CHECK: br i1 [[EXITCOND:%.*]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY]], !prof [[PROF6:![0-9]+]], !llvm.loop [[LOOP7:![0-9]+]]
|
|
;
|
|
; CHECK-MASKED-LABEL: @_Z3foo2v(
|
|
; CHECK-MASKED: entry:
|
|
; CHECK-MASKED: br label [[VECTOR_PH:%.*]]
|
|
; CHECK-MASKED: vector.ph:
|
|
; CHECK-MASKED: br label [[VECTOR_BODY:%.*]]
|
|
; CHECK-MASKED: vector.body:
|
|
; CHECK-MASKED: br i1 [[TMP16:%.*]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !prof [[PROF0]], !llvm.loop [[LOOP5:![0-9]+]]
|
|
; CHECK-MASKED: middle.block:
|
|
; CHECK-MASKED: br label [[SCALAR_PH:%.*]]
|
|
; CHECK-MASKED: scalar.ph:
|
|
; CHECK-MASKED: br label [[FOR_BODY:%.*]]
|
|
; CHECK-MASKED: for.cond.cleanup:
|
|
; CHECK-MASKED: for.body:
|
|
; CHECK-MASKED: br i1 [[EXITCOND:%.*]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY]], !prof [[PROF6:![0-9]+]], !llvm.loop [[LOOP7:![0-9]+]]
|
|
;
|
|
; CHECK-SCALABLE-LABEL: @_Z3foo2v(
|
|
; CHECK-SCALABLE: entry:
|
|
; CHECK-SCALABLE: br i1 [[MIN_ITERS_CHECK:%.*]], label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]], !prof [[PROF0]]
|
|
; CHECK-SCALABLE: vector.ph:
|
|
; CHECK-SCALABLE: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP9:%.*]], i64 0
|
|
; CHECK-SCALABLE: [[BROADCAST_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[BROADCAST_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
|
|
; CHECK-SCALABLE: br label [[VECTOR_BODY:%.*]]
|
|
; CHECK-SCALABLE: vector.body:
|
|
; CHECK-SCALABLE: [[VEC_IND_NEXT:%.*]] = add <vscale x 4 x i32> [[VEC_IND:%.*]], [[BROADCAST_SPLAT]]
|
|
; CHECK-SCALABLE: br i1 [[TMP11:%.*]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !prof [[PROF1]], !llvm.loop [[LOOP10:![0-9]+]]
|
|
; CHECK-SCALABLE: middle.block:
|
|
; CHECK-SCALABLE: br i1 [[CMP_N:%.*]], label [[FOR_COND_CLEANUP:%.*]], label [[SCALAR_PH]], !prof [[PROF6]]
|
|
; CHECK-SCALABLE: scalar.ph:
|
|
; CHECK-SCALABLE: br label [[FOR_BODY:%.*]]
|
|
; CHECK-SCALABLE: for.cond.cleanup:
|
|
; CHECK-SCALABLE: for.body:
|
|
; CHECK-SCALABLE: br i1 [[EXITCOND:%.*]], label [[FOR_COND_CLEANUP]], label [[FOR_BODY]], !prof [[PROF11:![0-9]+]], !llvm.loop [[LOOP12:![0-9]+]]
|
|
;
|
|
entry:
|
|
br label %for.body
|
|
|
|
for.cond.cleanup:
|
|
ret void
|
|
|
|
for.body:
|
|
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
|
|
%arrayidx = getelementptr inbounds [1024 x i32], ptr @b, i64 0, i64 %iv
|
|
%0 = load i32, ptr %arrayidx, align 4
|
|
%1 = trunc i64 %iv to i32
|
|
%mul = mul nsw i32 %0, %1
|
|
%arrayidx2 = getelementptr inbounds [1024 x i32], ptr @a, i64 0, i64 %iv
|
|
%2 = load i32, ptr %arrayidx2, align 4
|
|
%add = add nsw i32 %2, %mul
|
|
store i32 %add, ptr %arrayidx2, align 4
|
|
%iv.next = add nuw nsw i64 %iv, 1
|
|
%exitcond = icmp eq i64 %iv.next, 1027
|
|
br i1 %exitcond, label %for.cond.cleanup, label %for.body, !prof !1
|
|
}
|
|
|
|
|
|
!0 = !{!"branch_weights", i32 1, i32 1023}
|
|
!1 = !{!"branch_weights", i32 1, i32 1026}
|