Debian Codegraph @

llvm/test/CodeGen/SPIRV/hlsl-resources/UnknownBufferLoad.ll

raw
1 ; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv1.6-vulkan1.3-library %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv1.6-vulkan1.3-library %s -o - -filetype=obj | spirv-val %}
3
4 @.str = private unnamed_addr constant [4 x i8] c"Buf\00", align 1
5
6 ; CHECK: OpCapability StorageImageReadWithoutFormat
7 ; CHECK: OpName [[IntBufferVar:%[0-9]+]] "Buf"
8 ; CHECK-DAG: OpDecorate [[IntBufferVar]] DescriptorSet 16
9 ; CHECK-DAG: OpDecorate [[IntBufferVar]] Binding 7
10
11 ; CHECK-DAG: [[int:%[0-9]+]] = OpTypeInt 32 0
12 ; CHECK-DAG: [[zero:%[0-9]+]] = OpConstant [[int]] 0
13 ; CHECK-DAG: [[v4_int:%[0-9]+]] = OpTypeVector [[int]] 4
14 ; CHECK-DAG: [[RWBufferTypeInt:%[0-9]+]] = OpTypeImage [[int]] Buffer 2 0 0 2 Unknown {{$}}
15 ; CHECK-DAG: [[IntBufferPtrType:%[0-9]+]] = OpTypePointer UniformConstant [[RWBufferTypeInt]]
16 ; CHECK-DAG: [[IntBufferVar]] = OpVariable [[IntBufferPtrType]] UniformConstant
17
18 ; CHECK: {{%[0-9]+}} = OpFunction {{%[0-9]+}} DontInline {{%[0-9]+}}
19 ; CHECK-NEXT: OpLabel
20 define void @RWBufferLoad_Vec4_I32() #0 {
21 ; CHECK: [[buffer:%[0-9]+]] = OpLoad [[RWBufferTypeInt]] [[IntBufferVar]]
22 %buffer0 = call target("spirv.Image", i32, 5, 2, 0, 0, 2, 0)
23 @llvm.spv.resource.handlefrombinding.tspirv.Image_f32_5_2_0_0_2_0(
24 i32 16, i32 7, i32 1, i32 0, ptr nonnull @.str)
25
26 ; CHECK: OpImageRead [[v4_int]] [[buffer]] [[zero]]
27 %data0 = call <4 x i32> @llvm.spv.resource.load.typedbuffer(
28 target("spirv.Image", i32, 5, 2, 0, 0, 2, 0) %buffer0, i32 0)
29
30 ret void
31 }
32
33 attributes #0 = { convergent noinline norecurse "frame-pointer"="all" "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }