[llvm] [SPIR-V] Add tests for lowering unmangled builtins calls (PR #84319)

Michal Paszkowski via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 05:12:56 PST 2024


================
@@ -0,0 +1,29 @@
+; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
+
+; XFAIL: *
+
+; CHECK: %[[#image1d_t:]] = OpTypeImage
+; CHECK: %[[#sampler_t:]] = OpTypeSampler
+; CHECK: %[[#sampled_image_t:]] = OpTypeSampledImage
+
+declare dso_local spir_func ptr addrspace(4) @__spirv_SampledImage(target("spirv.Image", void, 0, 0, 0, 0, 0, 0, 0) %0, target("spirv.Sampler") %1) local_unnamed_addr
+
+declare dso_local spir_func <4 x float> @__spirv_ImageSampleExplicitLod(ptr addrspace(4) %0, i32 %1, i32 %2, float %3) local_unnamed_addr
+
+ at __spirv_BuiltInGlobalInvocationId = external dso_local local_unnamed_addr addrspace(2) constant <3 x i64>, align 32
+
+define weak_odr dso_local spir_kernel void @_ZTS17image_kernel_readILi1EE(target("spirv.Image", void, 0, 0, 0, 0, 0, 0, 0), target("spirv.Sampler")) {
+; CHECK: OpFunction
+; CHECK: %[[#image:]] = OpFunctionParameter %[[#image1d_t]]
+; CHECK: %[[#sampler:]] = OpFunctionParameter %[[#sampler_t]]
+  %3 = load <3 x i64>, ptr addrspace(2) @__spirv_BuiltInGlobalInvocationId, align 32
----------------
michalpaszkowski wrote:

TODO: Virtual registers need to be named

https://github.com/llvm/llvm-project/pull/84319


More information about the llvm-commits mailing list