76 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc -verify-machineinstrs -O3 -mtriple=spirv1.6-unknown-vulkan1.3-compute %s -o - | FileCheck %s3; RUN: %if spirv-tools %{ llc -O3 -mtriple=spirv1.6-unknown-vulkan1.3-compute %s -o - -filetype=obj | spirv-val %}4 5; struct S1 {6; int4 i;7; float4 f;8; };9; struct S2 {10; float4 f;11; int4 i;12; };13;14; StructuredBuffer<S1> In : register(t1);15; RWStructuredBuffer<S2> Out : register(u0);16;17; [numthreads(1,1,1)]18; void main(uint GI : SV_GroupIndex) {19; Out[GI].f = In[GI].f;20; Out[GI].i = In[GI].i;21; }22 23%struct.S1 = type { <4 x i32>, <4 x float> }24%struct.S2 = type { <4 x float>, <4 x i32> }25 26@.str = private unnamed_addr constant [3 x i8] c"In\00", align 127@.str.2 = private unnamed_addr constant [4 x i8] c"Out\00", align 128 29define void @main() local_unnamed_addr #0 {30; CHECK-LABEL: main31; CHECK: %42 = OpFunction %2 None %3 ; -- Begin function main32; CHECK-NEXT: %1 = OpLabel33; CHECK-NEXT: %43 = OpVariable %27 Function %3734; CHECK-NEXT: %44 = OpVariable %26 Function %3835; CHECK-NEXT: %45 = OpCopyObject %19 %3936; CHECK-NEXT: %46 = OpCopyObject %16 %4037; CHECK-NEXT: %47 = OpLoad %4 %4138; CHECK-NEXT: %48 = OpAccessChain %13 %45 %28 %4739; CHECK-NEXT: %49 = OpInBoundsAccessChain %9 %48 %3040; CHECK-NEXT: %50 = OpLoad %8 %49 Aligned 141; CHECK-NEXT: %51 = OpAccessChain %11 %46 %28 %4742; CHECK-NEXT: %52 = OpInBoundsAccessChain %9 %51 %2843; CHECK-NEXT: OpStore %52 %50 Aligned 144; CHECK-NEXT: %53 = OpAccessChain %6 %48 %2845; CHECK-NEXT: %54 = OpLoad %5 %53 Aligned 146; CHECK-NEXT: %55 = OpInBoundsAccessChain %6 %51 %3047; CHECK-NEXT: OpStore %55 %54 Aligned 148; CHECK-NEXT: OpReturn49; CHECK-NEXT: OpFunctionEnd50entry:51 %0 = tail call target("spirv.VulkanBuffer", [0 x %struct.S1], 12, 0) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0s_struct.S1s_12_0t(i32 0, i32 1, i32 1, i32 0, ptr nonnull @.str)52 %1 = tail call target("spirv.VulkanBuffer", [0 x %struct.S2], 12, 1) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0s_struct.S2s_12_1t(i32 0, i32 0, i32 1, i32 0, ptr nonnull @.str.2)53 %2 = tail call i32 @llvm.spv.flattened.thread.id.in.group()54 %3 = tail call noundef align 1 dereferenceable(32) ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.VulkanBuffer_a0s_struct.S1s_12_0t(target("spirv.VulkanBuffer", [0 x %struct.S1], 12, 0) %0, i32 %2)55 %f.i = getelementptr inbounds nuw i8, ptr addrspace(11) %3, i64 1656 %4 = load <4 x float>, ptr addrspace(11) %f.i, align 157 %5 = tail call noundef align 1 dereferenceable(32) ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.VulkanBuffer_a0s_struct.S2s_12_1t(target("spirv.VulkanBuffer", [0 x %struct.S2], 12, 1) %1, i32 %2)58 store <4 x float> %4, ptr addrspace(11) %5, align 159 %6 = load <4 x i32>, ptr addrspace(11) %3, align 160 %i6.i = getelementptr inbounds nuw i8, ptr addrspace(11) %5, i64 1661 store <4 x i32> %6, ptr addrspace(11) %i6.i, align 162 ret void63}64 65declare i32 @llvm.spv.flattened.thread.id.in.group()66 67declare target("spirv.VulkanBuffer", [0 x %struct.S1], 12, 0) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0s_struct.S1s_12_0t(i32, i32, i32, i32, ptr)68 69declare target("spirv.VulkanBuffer", [0 x %struct.S2], 12, 1) @llvm.spv.resource.handlefrombinding.tspirv.VulkanBuffer_a0s_struct.S2s_12_1t(i32, i32, i32, i32, ptr)70 71declare ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.VulkanBuffer_a0s_struct.S2s_12_1t(target("spirv.VulkanBuffer", [0 x %struct.S2], 12, 1), i32)72 73declare ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.VulkanBuffer_a0s_struct.S1s_12_0t(target("spirv.VulkanBuffer", [0 x %struct.S1], 12, 0), i32)74 75attributes #0 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" }76