| 1 |
; RUN: llvm-as %s -o %t.bc |
| 2 |
; RUN: llvm-spirv %t.bc -spirv-text -o %t.txt |
| 3 |
; RUN: FileCheck < %t.txt %s |
| 4 |
|
| 5 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" |
| 6 |
target triple = "spir64" |
| 7 |
|
| 8 |
%opencl.image1d_ro_t = type opaque |
| 9 |
;CHECK: TypeImage [[image1d_t:[0-9]+]] |
| 10 |
%opencl.sampler_t = type opaque |
| 11 |
;CHECK: TypeSampler [[sampler_t:[0-9]+]] |
| 12 |
;CHECK: TypeSampledImage [[sampled_image_t:[0-9]+]] |
| 13 |
|
| 14 |
declare dso_local spir_func i8 addrspace(4)* @_Z20__spirv_SampledImageI14ocl_image1d_roPvET0_T_11ocl_sampler(%opencl.image1d_ro_t addrspace(1)*, %opencl.sampler_t addrspace(2)*) local_unnamed_addr #2 |
| 15 |
|
| 16 |
declare dso_local spir_func <4 x float> @_Z30__spirv_ImageSampleExplicitLodIPvDv4_fiET0_T_T1_if(i8 addrspace(4)*, i32, i32, float) local_unnamed_addr #2 |
| 17 |
|
| 18 |
@__spirv_BuiltInGlobalInvocationId = external dso_local local_unnamed_addr addrspace(2) constant <3 x i64>, align 32 |
| 19 |
|
| 20 |
define weak_odr dso_local spir_kernel void @_ZTS17image_kernel_readILi1EE(%opencl.image1d_ro_t addrspace(1)*, %opencl.sampler_t addrspace(2)*) { |
| 21 |
;CHECK: Function |
| 22 |
;CHECK: FunctionParameter [[image1d_t]] [[image:[0-9]+]] |
| 23 |
;CHECK: FunctionParameter [[sampler_t]] [[sampler:[0-9]+]] |
| 24 |
%3 = load <3 x i64>, <3 x i64> addrspace(2)* @__spirv_BuiltInGlobalInvocationId, align 32 |
| 25 |
%4 = extractelement <3 x i64> %3, i64 0 |
| 26 |
%5 = trunc i64 %4 to i32 |
| 27 |
%6 = tail call spir_func i8 addrspace(4)* @_Z20__spirv_SampledImageI14ocl_image1d_roPvET0_T_11ocl_sampler(%opencl.image1d_ro_t addrspace(1)* %0, %opencl.sampler_t addrspace(2)* %1) |
| 28 |
%7 = tail call spir_func <4 x float> @_Z30__spirv_ImageSampleExplicitLodIPvDv4_fiET0_T_T1_if(i8 addrspace(4)* %6, i32 %5, i32 2, float 0.000000e+00) |
| 29 |
|
| 30 |
;CHECK: SampledImage [[sampled_image_t]] [[sampled_image:[0-9]+]] [[image]] [[sampler]] |
| 31 |
;CHECK: ImageSampleExplicitLod {{[0-9]+}} {{[0-9]+}} [[sampled_image]] {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} |
| 32 |
|
| 33 |
ret void |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
!llvm.module.flags = !{!0} |
| 38 |
!opencl.spir.version = !{!1} |
| 39 |
!spirv.Source = !{!2} |
| 40 |
!llvm.ident = !{!3} |
| 41 |
|
| 42 |
!0 = !{i32 1, !"wchar_size", i32 4} |
| 43 |
!1 = !{i32 1, i32 2} |
| 44 |
!2 = !{i32 4, i32 100000} |
| 45 |
!3 = !{!"clang version 9.0.0 (f66f659153bf7052f47a80bf0bd67895c7b9a8b3)"} |