Files
TheRock/compiler/spirv-llvm-translator/test/GEPOperator.spvasm
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

56 lines
3.2 KiB
Plaintext

; It's possible that access to builtin variable is represented by
; GetElementPtrConstantExpr rather than GetElementPtrInst. This
; test case presents a pattern that results into a ConstantExpr.
; REQUIRES: spirv-as
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s
; RUN: spirv-val %t.spv
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s
OpCapability Kernel
OpCapability Addresses
OpCapability Int64
OpCapability Int8
OpCapability GenericPointer
OpCapability Linkage
OpMemoryModel Physical64 OpenCL
OpEntryPoint Kernel %foo "test"
OpDecorate %__spirv_BuiltInWorkgroupSize Constant
OpDecorate %__spirv_BuiltInWorkgroupSize Alignment 32
OpDecorate %__spirv_BuiltInWorkgroupSize LinkageAttributes "__spirv_BuiltInWorkgroupSize" Import
OpDecorate %__spirv_BuiltInWorkgroupSize BuiltIn WorkgroupSize
%void = OpTypeVoid
%ulong = OpTypeInt 64 0
%uint = OpTypeInt 32 0
%uchar = OpTypeInt 8 0
%v3ulong = OpTypeVector %ulong 3
%_ptr_CW_uchar = OpTypePointer CrossWorkgroup %uchar
%_ptr_CW_v3ulong = OpTypePointer CrossWorkgroup %v3ulong
%_ptr_CW_ulong = OpTypePointer CrossWorkgroup %ulong
%foo_type = OpTypeFunction %void
%uint_0 = OpConstant %uint 0
%ulong_8 = OpConstant %ulong 8
%ulong_16 = OpConstant %ulong 16
%__spirv_BuiltInWorkgroupSize = OpVariable %_ptr_CW_v3ulong CrossWorkgroup
%c1 = OpSpecConstantOp %_ptr_CW_uchar InBoundsPtrAccessChain %__spirv_BuiltInWorkgroupSize %uint_0 %ulong_8
%c2 = OpSpecConstantOp %_ptr_CW_uchar InBoundsPtrAccessChain %__spirv_BuiltInWorkgroupSize %uint_0 %ulong_16
%foo = OpFunction %void None %foo_type
%entry = OpLabel
%pv0 = OpBitcast %_ptr_CW_ulong %__spirv_BuiltInWorkgroupSize
%v0 = OpLoad %ulong %pv0 Aligned 32
%pv1 = OpBitcast %_ptr_CW_ulong %c1
%v1 = OpLoad %ulong %pv1 Aligned 8
%idx1 = OpIMul %ulong %v0 %v1
%pv2 = OpBitcast %_ptr_CW_ulong %c2
%v2 = OpLoad %ulong %pv2 Aligned 16
%idx2 = OpIMul %ulong %idx1 %v2
OpReturn
OpFunctionEnd
; CHECK-NOT: getelementptr
; CHECK-NOT: load
; CHECK: %[[#V0:]] = call spir_func i64 @_Z14get_local_sizej(i32 0)
; CHECK: %[[#V1:]] = call spir_func i64 @_Z14get_local_sizej(i32 8)
; CHECK: %[[#Idx1:]] = mul i64 %[[#V0]], %[[#V1]]
; CHECK: %[[#V2:]] = call spir_func i64 @_Z14get_local_sizej(i32 16)
; CHECK: %[[#Idx2:]] = mul i64 %[[#Idx1]], %[[#V2]]