@@ -7,50 +7,56 @@ target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:
7
7
declare target ("spirv.VulkanBuffer" , [0 x i32 ], 12 , 0 ) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0i32_12_0t (i32 , i32 , i32 , i32 , i1 ) #0
8
8
9
9
; 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]]
25
29
; CHECK-DAG: [[zero:%[0-9]+]] = OpConstant [[int]] 0
26
30
; CHECK-DAG: [[one:%[0-9]+]] = OpConstant [[int]] 1
27
31
; CHECK-DAG: [[BufferVar]] = OpVariable [[BufferPtrType]] StorageBuffer
28
- ; CHECK-DAG: [[ImageVar ]] = OpVariable {{.*}} UniformConstant
32
+ ; CHECK-DAG: [[RWBufferVar ]] = OpVariable [[RWBufferPtrType]] StorageBuffer
29
33
30
34
; Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none)
31
35
define void @main () local_unnamed_addr #1 {
32
36
entry:
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 )
35
37
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 )
37
43
38
44
; 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 )
40
46
41
47
; CHECK: [[LD:%.+]] = OpLoad [[int]] [[AC]] Aligned 4
42
48
%1 = load i32 , ptr addrspace (11 ) %0 , align 4 , !tbaa !3
43
49
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 )
46
52
47
- ; CHECK: OpImageWrite [[ImageHandle]] [[zero ]] [[LD]]
53
+ ; CHECK: OpStore [[AC ]] [[LD]]
48
54
store i32 %1 , ptr addrspace (11 ) %2 , align 4 , !tbaa !3
49
55
ret void
50
56
}
51
57
52
58
; 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
54
60
55
61
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(none)
56
62
declare 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