Debian Codegraph @

llvm/test/CodeGen/SPIRV/vk-pushconstant-layout.ll

raw
1 ; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-vulkan-unknown %s -o - | FileCheck %s
2 ; XFAIL: *
3 ; FIXME(168401): fix the offset of last struct S field.
4
5 %struct.T = type { [3 x <2 x float>] }
6 %struct.S = type <{ float, <3 x float>, %struct.T }>
7
8 ; CHECK-NOT: OpCapability Linkage
9
10 ; CHECK-DAG: %[[#PTR_PCS:]] = OpTypePointer PushConstant %[[#S_S:]]
11
12 ; CHECK-DAG: %[[#F32:]] = OpTypeFloat 32
13 ; CHECK-DAG: %[[#V3F32:]] = OpTypeVector %[[#F32]] 3
14 ; CHECK-DAG: %[[#V2F32:]] = OpTypeVector %[[#F32]] 2
15 ; CHECK-DAG: %[[#UINT:]] = OpTypeInt 32 0
16 ; CHECK-DAG: %[[#UINT_3:]] = OpConstant %[[#UINT]] 3
17
18 ; CHECK-DAG: %[[#S_S]] = OpTypeStruct %[[#F32]] %[[#V3F32]] %[[#S_T:]]
19 ; CHECK-DAG: %[[#S_T]] = OpTypeStruct %[[#ARR:]]
20 ; CHECK-DAG: %[[#ARR]] = OpTypeArray %[[#V2F32]] %[[#UINT_3]]
21
22 ; CHECK-DAG: OpMemberDecorate %[[#S_T]] 0 Offset 0
23 ; CHECK-DAG: OpMemberDecorate %[[#S_S]] 0 Offset 0
24 ; CHECK-DAG: OpMemberDecorate %[[#S_S]] 1 Offset 4
25 ; CHECK-DAG: OpMemberDecorate %[[#S_S]] 2 Offset 16
26 ; CHECK-DAG: OpDecorate %[[#S_S]] Block
27 ; CHECK-DAG: OpDecorate %[[#ARR]] ArrayStride 8
28
29
30 @pcs = external hidden addrspace(13) externally_initialized global %struct.S, align 1
31 ; CHECK: %[[#PCS:]] = OpVariable %[[#PTR_PCS]] PushConstant
32
33 define void @main() #1 {
34 entry:
35 %0 = call token @llvm.experimental.convergence.entry()
36 ret void
37 }
38
39 declare token @llvm.experimental.convergence.entry() #2
40
41 attributes #1 = { convergent noinline norecurse optnone "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" }
42 attributes #2 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }