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
103 lines
2.5 KiB
LLVM
103 lines
2.5 KiB
LLVM
; RUN: opt < %s -passes=loop-vectorize -S | FileCheck %s
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
; This cannot be correctly vectorized with type i1.
|
|
define i8 @test_01(i8 %c) #0 {
|
|
|
|
; CHECK-LABEL: @test_01(
|
|
; CHECK-NOT: vector.body:
|
|
; CHECK-NOT: zext i1 {{.*}} to i8
|
|
|
|
entry:
|
|
br label %loop
|
|
|
|
exit:
|
|
ret i8 %accum.plus
|
|
|
|
loop:
|
|
%accum.phi = phi i8 [ %c, %entry ], [ %accum.plus, %loop ]
|
|
%iv = phi i32 [ 1, %entry ], [ %iv.next, %loop ]
|
|
%accum.and = and i8 %accum.phi, 1
|
|
%accum.plus = add nuw nsw i8 %accum.and, 3
|
|
%iv.next = add nuw nsw i32 %iv, 1
|
|
%cond = icmp ugt i32 %iv, 191
|
|
br i1 %cond, label %exit, label %loop
|
|
}
|
|
|
|
; TODO: This can be vectorized with type i1 because the result is not used.
|
|
define void @test_02(i8 %c) #0 {
|
|
|
|
; CHECK-LABEL: @test_02(
|
|
; CHECK-NOT: vector.body:
|
|
|
|
entry:
|
|
br label %loop
|
|
|
|
exit:
|
|
%lcssa = phi i8 [ %accum.plus, %loop ]
|
|
ret void
|
|
|
|
loop:
|
|
%accum.phi = phi i8 [ %c, %entry ], [ %accum.plus, %loop ]
|
|
%iv = phi i32 [ 1, %entry ], [ %iv.next, %loop ]
|
|
%accum.and = and i8 %accum.phi, 1
|
|
%accum.plus = add nuw nsw i8 %accum.and, 3
|
|
%iv.next = add nuw nsw i32 %iv, 1
|
|
%cond = icmp ugt i32 %iv, 191
|
|
br i1 %cond, label %exit, label %loop
|
|
}
|
|
|
|
; This can be vectorized with type i1 because the result is truncated properly.
|
|
define i1 @test_03(i8 %c) #0 {
|
|
|
|
; CHECK-LABEL: @test_03(
|
|
; CHECK: vector.body:
|
|
; CHECK: zext i1 {{.*}} to i8
|
|
|
|
entry:
|
|
br label %loop
|
|
|
|
exit:
|
|
%lcssa = phi i8 [ %accum.plus, %loop ]
|
|
%trunc = trunc i8 %lcssa to i1
|
|
ret i1 %trunc
|
|
|
|
loop:
|
|
%accum.phi = phi i8 [ %c, %entry ], [ %accum.plus, %loop ]
|
|
%iv = phi i32 [ 1, %entry ], [ %iv.next, %loop ]
|
|
%accum.and = and i8 %accum.phi, 1
|
|
%accum.plus = add nuw nsw i8 %accum.and, 3
|
|
%iv.next = add nuw nsw i32 %iv, 1
|
|
%cond = icmp ugt i32 %iv, 191
|
|
br i1 %cond, label %exit, label %loop
|
|
}
|
|
|
|
; This cannot be vectorized with type i1 because the result is truncated to a
|
|
; wrong type.
|
|
; TODO: It can also be vectorized with type i32 (or maybe i4?)
|
|
define i4 @test_04(i8 %c) #0 {
|
|
|
|
; CHECK-LABEL: @test_04(
|
|
; CHECK-NOT: vector.body:
|
|
; CHECK-NOT: zext i1 {{.*}} to i8
|
|
|
|
entry:
|
|
br label %loop
|
|
|
|
exit:
|
|
%lcssa = phi i8 [ %accum.plus, %loop ]
|
|
%trunc = trunc i8 %lcssa to i4
|
|
ret i4 %trunc
|
|
|
|
loop:
|
|
%accum.phi = phi i8 [ %c, %entry ], [ %accum.plus, %loop ]
|
|
%iv = phi i32 [ 1, %entry ], [ %iv.next, %loop ]
|
|
%accum.and = and i8 %accum.phi, 1
|
|
%accum.plus = add nuw nsw i8 %accum.and, 3
|
|
%iv.next = add nuw nsw i32 %iv, 1
|
|
%cond = icmp ugt i32 %iv, 191
|
|
br i1 %cond, label %exit, label %loop
|
|
}
|