brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · e4ec231 Raw
46 lines · plain
1; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv1.5-vulkan-library %s -o - | FileCheck %s2; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv1.5-vulkan-library %s -o - -filetype=obj | spirv-val %}3 4@.str.b0 = private unnamed_addr constant [3 x i8] c"B0\00", align 15 6; CHECK-DAG: OpCapability Shader7; CHECK-DAG: OpCapability Image1D8; CHECK-DAG: OpCapability Int89; CHECK-NOT: OpCapability10 11; CHECK-DAG: OpDecorate [[Var:%[0-9]+]] DescriptorSet 312; CHECK-DAG: OpDecorate [[Var]] Binding 413 14; CHECK-DAG: [[int:%[0-9]+]] = OpTypeInt 32 015; CHECK-DAG: [[BufferType:%[0-9]+]] = OpTypeImage [[int]] 1D 2 0 0 2 R32i {{$}}16; CHECK-DAG: [[BufferPtrType:%[0-9]+]] = OpTypePointer UniformConstant [[BufferType]]17; CHECK-DAG: [[ArraySize:%[0-9]+]] = OpConstant [[int]] 318; CHECK-DAG: [[One:%[0-9]+]] = OpConstant [[int]] 119; CHECK-DAG: [[Zero:%[0-9]+]] = OpConstant [[int]] 0{{$}}20; CHECK-DAG: [[BufferArrayType:%[0-9]+]] = OpTypeArray [[BufferType]] [[ArraySize]]21; CHECK-DAG: [[ArrayPtrType:%[0-9]+]] = OpTypePointer UniformConstant [[BufferArrayType]]22; CHECK-DAG: [[Var]] = OpVariable [[ArrayPtrType]] UniformConstant23 24; CHECK: {{%[0-9]+}} = OpFunction {{%[0-9]+}} DontInline {{%[0-9]+}}25; CHECK-NEXT: OpLabel26define void @main() #0 {27; CHECK: [[ac:%[0-9]+]] = OpAccessChain [[BufferPtrType]] [[Var]] [[Zero]]28; CHECK: [[buffer:%[0-9]+]] = OpLoad [[BufferType]] [[ac]]29  %buffer0 = call target("spirv.Image", i32, 0, 2, 0, 0, 2, 24)30      @llvm.spv.resource.handlefrombinding.tspirv.Image_f32_0_2_0_0_2_24(31          i32 3, i32 4, i32 3, i32 0, ptr nonnull @.str.b0)32  %ptr0 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", i32, 0, 2, 0, 0, 2, 24) %buffer0, i32 0)33  store i32 0, ptr %ptr0, align 434 35; CHECK: [[ac:%[0-9]+]] = OpAccessChain [[BufferPtrType]] [[Var]] [[One]]36; CHECK: [[buffer:%[0-9]+]] = OpLoad [[BufferType]] [[ac]]37  %buffer1 = call target("spirv.Image", i32, 0, 2, 0, 0, 2, 24)38      @llvm.spv.resource.handlefrombinding.tspirv.Image_f32_0_2_0_0_2_24(39          i32 3, i32 4, i32 3, i32 1, ptr nonnull @.str.b0)40  %ptr1 = tail call noundef nonnull align 4 dereferenceable(4) ptr @llvm.spv.resource.getpointer.p0.tspirv.Image_f32_5_2_0_0_2_0t(target("spirv.Image", i32, 0, 2, 0, 0, 2, 24) %buffer1, i32 0)41  store i32 0, ptr %ptr1, align 442  ret void43}44 45attributes #0 = { convergent noinline norecurse "frame-pointer"="all" "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }46