1
+ ; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-vulkan %s -o - | FileCheck %s
2
+ ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan %s -o - -filetype=obj | spirv-val %}
3
+
4
+ @.str = private unnamed_addr constant [4 x i8 ] c "In3\00 " , align 1
5
+ @.str.2 = private unnamed_addr constant [5 x i8 ] c "Out3\00 " , align 1
6
+
7
+ ; Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none)
8
+ define void @main () local_unnamed_addr #0 {
9
+ ; CHECK: %[[#INT32:]] = OpTypeInt 32 0
10
+ ; CHECK: %[[#INT4:]] = OpTypeVector %[[#INT32]] 4
11
+ ; CHECK: %[[#FLOAT:]] = OpTypeFloat 32
12
+ ; CHECK: %[[#FLOAT4:]] = OpTypeVector %[[#FLOAT]] 4
13
+ ; CHECK: %[[#BUFFER_LOAD:]] = OpLoad %[[#FLOAT4]] %{{[0-9]+}} Aligned 16
14
+ ; CHECK: %[[#VEC_SHUFFLE:]] = OpVectorShuffle %[[#INT4]] %[[#BUFFER_LOAD]] %[[#BUFFER_LOAD]] 0 1 2 3
15
+ %1 = tail call target ("spirv.VulkanBuffer" , [0 x <4 x float >], 12 , 0 ) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0v4f32_12_0t (i32 0 , i32 2 , i32 1 , i32 0 , i1 false , ptr nonnull @.str )
16
+ %2 = tail call target ("spirv.VulkanBuffer" , [0 x <4 x i32 >], 12 , 1 ) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0v4i32_12_1t (i32 0 , i32 5 , i32 1 , i32 0 , i1 false , ptr nonnull @.str.2 )
17
+ %3 = tail call noundef align 16 dereferenceable (16 ) ptr addrspace (11 ) @llvm.spv.resource.getpointer.p11.tspirv.VulkanBuffer_a0v4f32_12_0t (target ("spirv.VulkanBuffer" , [0 x <4 x float >], 12 , 0 ) %1 , i32 0 )
18
+ %4 = load <4 x i32 >, ptr addrspace (11 ) %3 , align 16
19
+ %5 = tail call noundef align 16 dereferenceable (16 ) ptr addrspace (11 ) @llvm.spv.resource.getpointer.p11.tspirv.VulkanBuffer_a0v4i32_12_1t (target ("spirv.VulkanBuffer" , [0 x <4 x i32 >], 12 , 1 ) %2 , i32 0 )
20
+ store <4 x i32 > %4 , ptr addrspace (11 ) %5 , align 16
21
+ ret void
22
+ }
23
+
24
+ attributes #0 = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) "approx-func-fp-math" ="true" "frame-pointer" ="all" "hlsl.numthreads" ="1,1,1" "hlsl.shader" ="compute" "no-infs-fp-math" ="true" "no-nans-fp-math" ="true" "no-signed-zeros-fp-math" ="true" "no-trapping-math" ="true" "stack-protector-buffer-size" ="8" }
0 commit comments