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
119 lines
5.8 KiB
LLVM
119 lines
5.8 KiB
LLVM
; ModuleID = ''
|
|
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
|
|
target triple = "spir-unknown-unknown"
|
|
|
|
; RUN: llvm-as %s -o %t.bc
|
|
; RUN: llvm-spirv %t.bc -spirv-text -o %t.spt
|
|
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
|
|
; RUN: llvm-spirv %t.bc -o %t.spv
|
|
; RUN: spirv-val %t.spv
|
|
; RUN: llvm-spirv -r %t.spv -o %t.bc
|
|
; RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-LLVM
|
|
; RUN: %if spirv-backend %{ llc -O0 -mtriple=spirv32-unknown-unknown -filetype=obj %s -o %t.llc.spv %}
|
|
; RUN: %if spirv-backend %{ llvm-spirv -r %t.llc.spv -o %t.llc.rev.bc %}
|
|
; RUN: %if spirv-backend %{ llvm-dis %t.llc.rev.bc -o %t.llc.rev.ll %}
|
|
; RUN: %if spirv-backend %{ FileCheck %s --check-prefix=CHECK-LLC < %t.llc.rev.ll %}
|
|
|
|
; Check 'LLVM ==> SPIR-V ==> LLVM' conversion of extractvalue/insertvalue.
|
|
|
|
%struct.arr = type { [7 x float] }
|
|
%struct.st = type { %struct.inner }
|
|
%struct.inner = type { float }
|
|
; CHECK-LLVM: %struct.arr = type { [7 x float] }
|
|
; CHECK-LLVM: %struct.st = type { %struct.inner }
|
|
; CHECK-LLVM: %struct.inner = type { float }
|
|
|
|
; CHECK-LLVM: define spir_func void @array_test
|
|
; CHECK-LLVM-LABEL: entry
|
|
; CHECK-LLVM: %0 = getelementptr inbounds %struct.arr, ptr addrspace(1) %object, i32 0, i32 0
|
|
; CHECK-LLVM: %1 = load [7 x float], ptr addrspace(1) %0, align 4
|
|
; CHECK-LLVM: %2 = extractvalue [7 x float] %1, 4
|
|
; CHECK-LLVM: %3 = extractvalue [7 x float] %1, 2
|
|
; CHECK-LLVM: %4 = fadd float %2, %3
|
|
; CHECK-LLVM: %5 = insertvalue [7 x float] %1, float %4, 5
|
|
; CHECK-LLVM: store [7 x float] %5, ptr addrspace(1) %0
|
|
|
|
; CHECK-LLC-LABEL: define spir_func void @array_test
|
|
; CHECK-LLC: %0 = getelementptr inbounds %struct.arr, ptr addrspace(1) %object, i32 0, i32 0
|
|
; CHECK-LLC: %1 = load [7 x float], ptr addrspace(1) %0, align 4
|
|
; CHECK-LLC: %2 = extractvalue [7 x float] %1, 4
|
|
; CHECK-LLC: %3 = extractvalue [7 x float] %1, 2
|
|
; CHECK-LLC: %4 = fadd float %2, %3
|
|
; CHECK-LLC: %5 = insertvalue [7 x float] %1, float %4, 5
|
|
; CHECK-LLC: store [7 x float] %5, ptr addrspace(1) %0, align 4
|
|
|
|
; CHECK-SPIRV-LABEL: 5 Function
|
|
; CHECK-SPIRV-NEXT: FunctionParameter {{[0-9]+}} [[object:[0-9]+]]
|
|
; CHECK-SPIRV: 6 InBoundsPtrAccessChain {{[0-9]+}} {{[0-9]+}} [[object]] {{[0-9]+}} {{[0-9]+}}
|
|
; CHECK-SPIRV: 6 Load {{[0-9]+}} [[extracted_array:[0-9]+]] {{[0-9]+}} {{[0-9]+}} 4
|
|
; CHECK-SPIRV: 5 CompositeExtract {{[0-9]+}} [[elem_4:[0-9]+]] [[extracted_array]] 4
|
|
; CHECK-SPIRV: 5 CompositeExtract {{[0-9]+}} [[elem_2:[0-9]+]] [[extracted_array]] 2
|
|
; CHECK-SPIRV: 5 FAdd {{[0-9]+}} [[add:[0-9]+]] [[elem_4]] [[elem_2]]
|
|
; CHECK-SPIRV: 6 CompositeInsert {{[0-9]+}} [[inserted_array:[0-9]+]] [[add]] [[extracted_array]] 5
|
|
; CHECK-SPIRV: 5 Store {{[0-9]+}} [[inserted_array]]
|
|
; CHECK-SPIRV-LABEL: 1 FunctionEnd
|
|
|
|
; Function Attrs: nounwind
|
|
define spir_func void @array_test(ptr addrspace(1) %object) #0 {
|
|
entry:
|
|
%0 = getelementptr inbounds %struct.arr, ptr addrspace(1) %object, i32 0, i32 0
|
|
%1 = load [7 x float], ptr addrspace(1) %0, align 4
|
|
%2 = extractvalue [7 x float] %1, 4
|
|
%3 = extractvalue [7 x float] %1, 2
|
|
%4 = fadd float %2, %3
|
|
%5 = insertvalue [7 x float] %1, float %4, 5
|
|
store [7 x float] %5, ptr addrspace(1) %0
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LLVM: define spir_func void @struct_test
|
|
; CHECK-LLVM-LABEL: entry
|
|
; CHECK-LLVM: %0 = getelementptr inbounds %struct.st, ptr addrspace(1) %object, i32 0, i32 0
|
|
; CHECK-LLVM: %1 = load %struct.inner, ptr addrspace(1) %0, align 4
|
|
; CHECK-LLVM: %2 = extractvalue %struct.inner %1, 0
|
|
; CHECK-LLVM: %3 = fadd float %2, 1.000000e+00
|
|
; CHECK-LLVM: %4 = insertvalue %struct.inner %1, float %3, 0
|
|
; CHECK-LLVM: store %struct.inner %4, ptr addrspace(1) %0
|
|
|
|
; CHECK-LLC-LABEL: define spir_func void @struct_test
|
|
; CHECK-LLC: %0 = getelementptr inbounds %struct.st, ptr addrspace(1) %object, i32 0, i32 0
|
|
; CHECK-LLC: %1 = load %struct.inner, ptr addrspace(1) %0, align 4
|
|
; CHECK-LLC: %2 = extractvalue %struct.inner %1, 0
|
|
; CHECK-LLC: %3 = fadd float %2, 1.000000e+00
|
|
; CHECK-LLC: %4 = insertvalue %struct.inner %1, float %3, 0
|
|
; CHECK-LLC: store %struct.inner %4, ptr addrspace(1) %{{.*}}, align 4
|
|
|
|
; CHECK-SPIRV-LABEL: 5 Function
|
|
; CHECK-SPIRV-NEXT: FunctionParameter {{[0-9]+}} [[object:[0-9]+]]
|
|
; CHECK-SPIRV: 6 InBoundsPtrAccessChain {{[0-9]+}} {{[0-9]+}} [[object]] {{[0-9]+}} {{[0-9]+}}
|
|
; CHECK-SPIRV: 6 Load {{[0-9]+}} [[extracted_struct:[0-9]+]] {{[0-9]+}} {{[0-9]+}} 4
|
|
; CHECK-SPIRV: 5 CompositeExtract {{[0-9]+}} [[elem:[0-9]+]] [[extracted_struct]] 0
|
|
; CHECK-SPIRV: 5 FAdd {{[0-9]+}} [[add:[0-9]+]] [[elem]] {{[0-9]+}}
|
|
; CHECK-SPIRV: 6 CompositeInsert {{[0-9]+}} [[inserted_struct:[0-9]+]] [[add]] [[extracted_struct]] 0
|
|
; CHECK-SPIRV: 5 Store {{[0-9]+}} [[inserted_struct]]
|
|
; CHECK-SPIRV-LABEL: 1 FunctionEnd
|
|
|
|
; Function Attrs: nounwind
|
|
define spir_func void @struct_test(ptr addrspace(1) %object) #0 {
|
|
entry:
|
|
%0 = getelementptr inbounds %struct.st, ptr addrspace(1) %object, i32 0, i32 0
|
|
%1 = load %struct.inner, ptr addrspace(1) %0, align 4
|
|
%2 = extractvalue %struct.inner %1, 0
|
|
%3 = fadd float %2, 1.000000e+00
|
|
%4 = insertvalue %struct.inner %1, float %3, 0
|
|
store %struct.inner %4, ptr addrspace(1) %0
|
|
ret void
|
|
}
|
|
|
|
attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
|
|
|
!opencl.enable.FP_CONTRACT = !{}
|
|
!opencl.spir.version = !{!0}
|
|
!opencl.ocl.version = !{!0}
|
|
!opencl.used.extensions = !{!1}
|
|
!opencl.used.optional.core.features = !{!1}
|
|
!opencl.compiler.options = !{!1}
|
|
|
|
!0 = !{i32 1, i32 2}
|
|
!1 = !{}
|