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
146 lines
6.1 KiB
LLVM
146 lines
6.1 KiB
LLVM
; RUN: llc -mtriple=amdgcn-- -mcpu=verde -disable-promote-alloca-to-vector -disable-promote-alloca-to-lds < %s | FileCheck -check-prefix=FUNC %s
|
|
; RUN: llc -mtriple=amdgcn-- -mcpu=verde < %s | FileCheck -check-prefix=FUNC %s
|
|
; RUN: llc -mtriple=amdgcn-- -mcpu=tonga -disable-promote-alloca-to-vector -disable-promote-alloca-to-lds < %s | FileCheck -check-prefix=FUNC %s
|
|
; RUN: llc -mtriple=amdgcn-- -mcpu=tonga < %s | FileCheck -check-prefix=FUNC %s
|
|
; RUN: llc -mtriple=r600-- -mcpu=redwood < %s | FileCheck --check-prefixes=EG,FUNC %s
|
|
; RUN: opt -S -mtriple=amdgcn-- -passes='amdgpu-promote-alloca,sroa,instcombine' < %s | FileCheck -check-prefix=OPT %s
|
|
|
|
; OPT-LABEL: @vector_read(
|
|
; OPT: %0 = extractelement <4 x i32> <i32 0, i32 1, i32 2, i32 3>, i32 %index
|
|
; OPT: store i32 %0, ptr addrspace(1) %out, align 4
|
|
|
|
; FUNC-LABEL: {{^}}vector_read:
|
|
; EG: MOV
|
|
; EG: MOV
|
|
; EG: MOV
|
|
; EG: MOV
|
|
; EG: MOVA_INT
|
|
define amdgpu_kernel void @vector_read(ptr addrspace(1) %out, i32 %index) {
|
|
entry:
|
|
%tmp = alloca [4 x i32], addrspace(5)
|
|
%y = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 1
|
|
%z = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 2
|
|
%w = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 3
|
|
store i32 0, ptr addrspace(5) %tmp
|
|
store i32 1, ptr addrspace(5) %y
|
|
store i32 2, ptr addrspace(5) %z
|
|
store i32 3, ptr addrspace(5) %w
|
|
%tmp1 = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 %index
|
|
%tmp2 = load i32, ptr addrspace(5) %tmp1
|
|
store i32 %tmp2, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
; OPT-LABEL: @vector_write(
|
|
; OPT: %0 = insertelement <4 x i32> zeroinitializer, i32 1, i32 %w_index
|
|
; OPT: %1 = extractelement <4 x i32> %0, i32 %r_index
|
|
; OPT: store i32 %1, ptr addrspace(1) %out, align 4
|
|
|
|
; FUNC-LABEL: {{^}}vector_write:
|
|
; EG: MOV
|
|
; EG: MOV
|
|
; EG: MOV
|
|
; EG: MOV
|
|
; EG: MOVA_INT
|
|
; EG: MOVA_INT
|
|
define amdgpu_kernel void @vector_write(ptr addrspace(1) %out, i32 %w_index, i32 %r_index) {
|
|
entry:
|
|
%tmp = alloca [4 x i32], addrspace(5)
|
|
%y = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 1
|
|
%z = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 2
|
|
%w = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 3
|
|
store i32 0, ptr addrspace(5) %tmp
|
|
store i32 0, ptr addrspace(5) %y
|
|
store i32 0, ptr addrspace(5) %z
|
|
store i32 0, ptr addrspace(5) %w
|
|
%tmp1 = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 %w_index
|
|
store i32 1, ptr addrspace(5) %tmp1
|
|
%tmp2 = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 %r_index
|
|
%tmp3 = load i32, ptr addrspace(5) %tmp2
|
|
store i32 %tmp3, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
; This test should be optimize to:
|
|
; store i32 0, ptr addrspace(1) %out
|
|
|
|
; OPT-LABEL: @bitcast_gep(
|
|
; OPT-LABEL: store i32 0, ptr addrspace(1) %out, align 4
|
|
|
|
; FUNC-LABEL: {{^}}bitcast_gep:
|
|
; EG: STORE_RAW
|
|
define amdgpu_kernel void @bitcast_gep(ptr addrspace(1) %out, i32 %w_index, i32 %r_index) {
|
|
entry:
|
|
%tmp = alloca [4 x i32], addrspace(5)
|
|
%y = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 1
|
|
%z = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 2
|
|
%w = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 3
|
|
store i32 0, ptr addrspace(5) %tmp
|
|
store i32 0, ptr addrspace(5) %y
|
|
store i32 0, ptr addrspace(5) %z
|
|
store i32 0, ptr addrspace(5) %w
|
|
%tmp1 = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 1
|
|
%tmp4 = load i32, ptr addrspace(5) %tmp1
|
|
store i32 %tmp4, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
; OPT-LABEL: @vector_read_bitcast_gep(
|
|
; OPT: %0 = extractelement <4 x i32> <i32 1065353216, i32 1, i32 2, i32 3>, i32 %index
|
|
; OPT: store i32 %0, ptr addrspace(1) %out, align 4
|
|
define amdgpu_kernel void @vector_read_bitcast_gep(ptr addrspace(1) %out, i32 %index) {
|
|
entry:
|
|
%tmp = alloca [4 x i32], addrspace(5)
|
|
%y = getelementptr inbounds [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 1
|
|
%z = getelementptr inbounds [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 2
|
|
%w = getelementptr inbounds [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 3
|
|
store float 1.0, ptr addrspace(5) %tmp
|
|
store i32 1, ptr addrspace(5) %y
|
|
store i32 2, ptr addrspace(5) %z
|
|
store i32 3, ptr addrspace(5) %w
|
|
%tmp1 = getelementptr inbounds [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 %index
|
|
%tmp2 = load i32, ptr addrspace(5) %tmp1
|
|
store i32 %tmp2, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
; OPT-LABEL: @vector_read_bitcast_alloca(
|
|
; OPT: %0 = extractelement <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 4.000000e+00>, i32 %index
|
|
; OPT: store float %0, ptr addrspace(1) %out, align 4
|
|
define amdgpu_kernel void @vector_read_bitcast_alloca(ptr addrspace(1) %out, i32 %index) {
|
|
entry:
|
|
%tmp = alloca [4 x i32], addrspace(5)
|
|
%y = getelementptr inbounds [4 x float], ptr addrspace(5) %tmp, i32 0, i32 1
|
|
%z = getelementptr inbounds [4 x float], ptr addrspace(5) %tmp, i32 0, i32 2
|
|
%w = getelementptr inbounds [4 x float], ptr addrspace(5) %tmp, i32 0, i32 3
|
|
store float 0.0, ptr addrspace(5) %tmp
|
|
store float 1.0, ptr addrspace(5) %y
|
|
store float 2.0, ptr addrspace(5) %z
|
|
store float 4.0, ptr addrspace(5) %w
|
|
%tmp1 = getelementptr inbounds [4 x float], ptr addrspace(5) %tmp, i32 0, i32 %index
|
|
%tmp2 = load float, ptr addrspace(5) %tmp1
|
|
store float %tmp2, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
; The pointer arguments in local address space should not affect promotion to vector.
|
|
|
|
; OPT-LABEL: @vector_read_with_local_arg(
|
|
; OPT: %0 = extractelement <4 x i32> <i32 0, i32 1, i32 2, i32 3>, i32 %index
|
|
; OPT: store i32 %0, ptr addrspace(1) %out, align 4
|
|
define amdgpu_kernel void @vector_read_with_local_arg(ptr addrspace(3) %stopper, ptr addrspace(1) %out, i32 %index) {
|
|
entry:
|
|
%tmp = alloca [4 x i32], addrspace(5)
|
|
%y = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 1
|
|
%z = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 2
|
|
%w = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 3
|
|
store i32 0, ptr addrspace(5) %tmp
|
|
store i32 1, ptr addrspace(5) %y
|
|
store i32 2, ptr addrspace(5) %z
|
|
store i32 3, ptr addrspace(5) %w
|
|
%tmp1 = getelementptr [4 x i32], ptr addrspace(5) %tmp, i32 0, i32 %index
|
|
%tmp2 = load i32, ptr addrspace(5) %tmp1
|
|
store i32 %tmp2, ptr addrspace(1) %out
|
|
ret void
|
|
}
|