@@ -7,50 +7,56 @@ target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:
77declare target ("spirv.VulkanBuffer" , [0 x i32 ], 12 , 0 ) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0i32_12_0t (i32 , i32 , i32 , i32 , i1 ) #0
88
99; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(none)
10- declare target ("spirv.Image" , i32 , 5 , 2 , 0 , 0 , 2 , 0 ) @llvm.spv.resource.handlefrombinding.tspirv.Image_i32_5_2_0_0_2_0t (i32 , i32 , i32 , i32 , i1 ) #0
11-
12- ; CHECK-DAG: OpDecorate [[BufferVar:%.+]] DescriptorSet 0
13- ; CHECK-DAG: OpDecorate [[BufferVar]] Binding 0
14- ; CHECK-DAG: OpDecorate [[BufferType:%.+]] Block
15- ; STVEN-CHECK-DAG: OpMemberDecorate [[BufferType]] 0 Offset 0 // The decoration is not output correctly in the assembly output
16- ; CHECK-DAG: OpMemberDecorate [[BufferType]] 0 NonWritable
17- ; CHECK-DAG: OpDecorate [[ImageVar:%.+]] DescriptorSet 0
18- ; CHECK-DAG: OpDecorate [[ImageVar]] Binding 1
19-
20-
21- ; CHECK-DAG: [[ArrayType:%.+]] = OpTypeRuntimeArray
22- ; CHECK-DAG: [[BufferType]] = OpTypeStruct [[ArrayType]]
23- ; CHECK-DAG: [[BufferPtrType:%.+]] = OpTypePointer StorageBuffer [[BufferType]]
24- ; CHECK-DAG: [[int:%[0-9]+]] = OpTypeInt 32 0
10+ declare target ("spirv.VulkanBuffer" , [0 x i32 ], 12 , 1 ) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0i32_12_1t (i32 , i32 , i32 , i32 , i1 ) #0
11+
12+ ; CHECK: OpDecorate [[BufferVar:%.+]] DescriptorSet 0
13+ ; CHECK: OpDecorate [[BufferVar]] Binding 0
14+ ; CHECK: OpDecorate [[BufferType:%.+]] Block
15+ ; CHECK: OpMemberDecorate [[BufferType]] 0 NonWritable
16+ ; CHECK-DISABLE: OpMemberDecorate [[RWBufferType]] 0 Offset 0 // The 0 at the end is not output for some reason
17+ ; CHECK: OpDecorate [[RWBufferVar:%.+]] DescriptorSet 0
18+ ; CHECK: OpDecorate [[RWBufferVar]] Binding 1
19+ ; CHECK: OpDecorate [[RWBufferType:%.+]] Block
20+ ; CHECK-DISABLE: OpMemberDecorate [[BufferType]] 0 Offset 0 // Same as above
21+
22+
23+ ; CHECK: [[int:%[0-9]+]] = OpTypeInt 32 0
24+ ; CHECK: [[ArrayType:%.+]] = OpTypeRuntimeArray
25+ ; CHECK: [[RWBufferType]] = OpTypeStruct [[ArrayType]]
26+ ; CHECK: [[RWBufferPtrType:%.+]] = OpTypePointer StorageBuffer [[RWBufferType]]
27+ ; CHECK: [[BufferType]] = OpTypeStruct [[ArrayType]]
28+ ; CHECK: [[BufferPtrType:%.+]] = OpTypePointer StorageBuffer [[BufferType]]
2529; CHECK-DAG: [[zero:%[0-9]+]] = OpConstant [[int]] 0
2630; CHECK-DAG: [[one:%[0-9]+]] = OpConstant [[int]] 1
2731; CHECK-DAG: [[BufferVar]] = OpVariable [[BufferPtrType]] StorageBuffer
28- ; CHECK-DAG: [[ImageVar ]] = OpVariable {{.*}} UniformConstant
32+ ; CHECK-DAG: [[RWBufferVar ]] = OpVariable [[RWBufferPtrType]] StorageBuffer
2933
3034; Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none)
3135define void @main () local_unnamed_addr #1 {
3236entry:
33- ; CHECK: [[BufferHandle:%.+]] = OpCopyObject [[BufferPtrType]] [[BufferVar]]
34- %i_h.i.i = tail call target ("spirv.VulkanBuffer" , [0 x i32 ], 12 , 0 ) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0i32_12_0t (i32 0 , i32 0 , i32 1 , i32 0 , i1 false )
3537
36- %o_h.i.i = tail call target ("spirv.Image" , i32 , 5 , 2 , 0 , 0 , 2 , 0 ) @llvm.spv.resource.handlefrombinding.tspirv.Image_i32_5_2_0_0_2_0t (i32 0 , i32 1 , i32 1 , i32 0 , i1 false )
38+ ; CHECK-DAG: [[BufferHandle:%.+]] = OpCopyObject [[BufferPtrType]] [[BufferVar]]
39+ ; CHECK-DAG: [[RWBufferHandle:%.+]] = OpCopyObject [[RWBufferPtrType]] [[RWBufferVar]]
40+ %_ZL1i_h.i.i = tail call target ("spirv.VulkanBuffer" , [0 x i32 ], 12 , 0 ) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0i32_12_0t (i32 0 , i32 0 , i32 1 , i32 0 , i1 false )
41+
42+ %_ZL1o_h.i.i = tail call target ("spirv.VulkanBuffer" , [0 x i32 ], 12 , 1 ) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0i32_12_1t (i32 0 , i32 1 , i32 1 , i32 0 , i1 false )
3743
3844; CHECK: [[AC:%.+]] = OpAccessChain {{.*}} [[BufferHandle]] [[zero]] [[one]]
39- %0 = tail call noundef align 4 dereferenceable (4 ) ptr addrspace (11 ) @llvm.spv.resource.getpointer.p11.tspirv.VulkanBuffer_a0i32_12_0t (target ("spirv.VulkanBuffer" , [0 x i32 ], 12 , 0 ) %i_h .i.i , i32 1 )
45+ %0 = tail call noundef nonnull align 4 dereferenceable (4 ) ptr addrspace (11 ) @llvm.spv.resource.getpointer.p11.tspirv.VulkanBuffer_a0i32_12_0t (target ("spirv.VulkanBuffer" , [0 x i32 ], 12 , 0 ) %_ZL1i_h .i.i , i32 1 )
4046
4147; CHECK: [[LD:%.+]] = OpLoad [[int]] [[AC]] Aligned 4
4248 %1 = load i32 , ptr addrspace (11 ) %0 , align 4 , !tbaa !3
4349
44- ; CHECK: [[ImageHandle :%.+]] = OpLoad {{.*}} [[ImageVar ]]
45- %2 = tail call noundef align 4 dereferenceable (4 ) ptr addrspace (11 ) @llvm.spv.resource.getpointer.p11.tspirv.Image_i32_5_2_0_0_2_0t (target ("spirv.Image " , i32 , 5 , 2 , 0 , 0 , 2 , 0 ) %o_h .i.i , i32 0 )
50+ ; CHECK: [[AC :%.+]] = OpAccessChain {{.*}} [[RWBufferHandle]] [[zero]] [[zero ]]
51+ %2 = tail call noundef nonnull align 4 dereferenceable (4 ) ptr addrspace (11 ) @llvm.spv.resource.getpointer.p11.tspirv.VulkanBuffer_a0i32_12_1t (target ("spirv.VulkanBuffer " , [ 0 x i32 ], 12 , 1 ) %_ZL1o_h .i.i , i32 0 )
4652
47- ; CHECK: OpImageWrite [[ImageHandle]] [[zero ]] [[LD]]
53+ ; CHECK: OpStore [[AC ]] [[LD]]
4854 store i32 %1 , ptr addrspace (11 ) %2 , align 4 , !tbaa !3
4955 ret void
5056}
5157
5258; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(none)
53- declare ptr addrspace (11 ) @llvm.spv.resource.getpointer.p11.tspirv.Image_i32_5_2_0_0_2_0t (target ("spirv.Image " , i32 , 5 , 2 , 0 , 0 , 2 , 0 ), i32 ) #0
59+ declare ptr addrspace (11 ) @llvm.spv.resource.getpointer.p11.tspirv.VulkanBuffer_a0i32_12_1t (target ("spirv.VulkanBuffer " , [ 0 x i32 ], 12 , 1 ), i32 ) #0
5460
5561; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(none)
5662declare ptr addrspace (11 ) @llvm.spv.resource.getpointer.p11.tspirv.VulkanBuffer_a0i32_12_0t (target ("spirv.VulkanBuffer" , [0 x i32 ], 12 , 0 ), i32 ) #0
0 commit comments