brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 87df0ae Raw
33 lines · plain
1; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s2; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}3 4; CHECK: OpDecorate %[[#ID:]] LinkageAttributes "imageSampler" Export5; CHECK: %[[#ID]] = OpVariable %[[#]] UniformConstant %[[#]]6 7@imageSampler = addrspace(2) constant i32 36, align 48 9define spir_kernel void @sample_kernel(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %input, ptr addrspace(1) nocapture %xOffsets, ptr addrspace(1) nocapture %yOffsets, ptr addrspace(1) nocapture %results) {10  %1 = tail call spir_func i64 @_Z13get_global_idj(i32 0)11  %2 = trunc i64 %1 to i3212  %3 = tail call spir_func i64 @_Z13get_global_idj(i32 1)13  %4 = trunc i64 %3 to i3214  %5 = tail call spir_func i32 @_Z15get_image_width11ocl_image2d(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %input)15  %6 = mul nsw i32 %4, %516  %7 = add nsw i32 %6, %217  %8 = sitofp i32 %2 to float18  %9 = insertelement <2 x float> undef, float %8, i32 019  %10 = sitofp i32 %4 to float20  %11 = insertelement <2 x float> %9, float %10, i32 121  %12 = tail call spir_func <4 x float> @_Z11read_imagef11ocl_image2d11ocl_samplerDv2_f(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0) %input, i32 36, <2 x float> %11)22  %13 = sext i32 %7 to i6423  %14 = getelementptr inbounds <4 x float>, ptr addrspace(1) %results, i64 %1324  store <4 x float> %12, ptr addrspace(1) %14, align 1625  ret void26}27 28declare spir_func i64 @_Z13get_global_idj(i32)29 30declare spir_func i32 @_Z15get_image_width11ocl_image2d(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0))31 32declare spir_func <4 x float> @_Z11read_imagef11ocl_image2d11ocl_samplerDv2_f(target("spirv.Image", void, 1, 0, 0, 0, 0, 0, 0), i32, <2 x float>)33