|
1 | 1 | ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - | FileCheck %s
|
2 | 2 | ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan %s -o - -filetype=obj | spirv-val %}
|
3 | 3 |
|
4 |
| -; CHECK-DAG: %[[#uint:]] = OpTypeInt 32 0 |
5 |
| -; CHECK-DAG: %[[#float:]] = OpTypeFloat 32 |
6 |
| -; CHECK-DAG: %[[#float_fp:]] = OpTypePointer Function %[[#float]] |
7 |
| -; CHECK-DAG: %[[#float_pp:]] = OpTypePointer Private %[[#float]] |
8 |
| -; CHECK-DAG: %[[#uint_fp:]] = OpTypePointer Function %[[#uint]] |
9 |
| -; CHECK-DAG: %[[#uint_0:]] = OpConstant %[[#uint]] 0 |
10 |
| -; CHECK-DAG: %[[#float_0:]] = OpConstant %[[#float]] 0 |
11 |
| -; CHECK-DAG: %[[#sf:]] = OpTypeStruct %[[#float]] |
12 |
| -; CHECK-DAG: %[[#su:]] = OpTypeStruct %[[#uint]] |
13 |
| -; CHECK-DAG: %[[#sfuf:]] = OpTypeStruct %[[#float]] %[[#uint]] %[[#float]] |
14 |
| -; CHECK-DAG: %[[#sf_fp:]] = OpTypePointer Function %[[#sf]] |
15 |
| -; CHECK-DAG: %[[#su_fp:]] = OpTypePointer Function %[[#su]] |
16 |
| -; CHECK-DAG: %[[#sfuf_fp:]] = OpTypePointer Function %[[#sfuf]] |
17 |
| -; CHECK-DAG: %[[#sfuf_pp:]] = OpTypePointer Private %[[#sfuf]] |
| 4 | +; CHECK-DAG: %[[#uint:]] = OpTypeInt 32 0 |
| 5 | +; CHECK-DAG: %[[#float:]] = OpTypeFloat 32 |
| 6 | +; CHECK-DAG: %[[#float_fp:]] = OpTypePointer Function %[[#float]] |
| 7 | +; CHECK-DAG: %[[#float_pp:]] = OpTypePointer Private %[[#float]] |
| 8 | +; CHECK-DAG: %[[#uint_fp:]] = OpTypePointer Function %[[#uint]] |
| 9 | +; CHECK-DAG: %[[#uint_0:]] = OpConstant %[[#uint]] 0 |
| 10 | +; CHECK-DAG: %[[#uint_4:]] = OpConstant %[[#uint]] 4 |
| 11 | +; CHECK-DAG: %[[#float_0:]] = OpConstant %[[#float]] 0 |
| 12 | +; CHECK-DAG: %[[#sf:]] = OpTypeStruct %[[#float]] |
| 13 | +; CHECK-DAG: %[[#su:]] = OpTypeStruct %[[#uint]] |
| 14 | +; CHECK-DAG: %[[#ssu:]] = OpTypeStruct %[[#su]] |
| 15 | +; CHECK-DAG: %[[#sfuf:]] = OpTypeStruct %[[#float]] %[[#uint]] %[[#float]] |
| 16 | +; CHECK-DAG: %[[#uint4:]] = OpTypeVector %[[#uint]] 4 |
| 17 | +; CHECK-DAG: %[[#sv:]] = OpTypeStruct %[[#uint4]] |
| 18 | +; CHECK-DAG: %[[#ssv:]] = OpTypeStruct %[[#sv]] |
| 19 | +; CHECK-DAG: %[[#assv:]] = OpTypeArray %[[#ssv]] %[[#uint_4]] |
| 20 | +; CHECK-DAG: %[[#sassv:]] = OpTypeStruct %[[#assv]] |
| 21 | +; CHECK-DAG: %[[#ssassv:]] = OpTypeStruct %[[#sassv]] |
| 22 | +; CHECK-DAG: %[[#sf_fp:]] = OpTypePointer Function %[[#sf]] |
| 23 | +; CHECK-DAG: %[[#su_fp:]] = OpTypePointer Function %[[#su]] |
| 24 | +; CHECK-DAG: %[[#ssu_fp:]] = OpTypePointer Function %[[#ssu]] |
| 25 | +; CHECK-DAG: %[[#ssv_fp:]] = OpTypePointer Function %[[#ssv]] |
| 26 | +; CHECK-DAG: %[[#ssassv_fp:]] = OpTypePointer Function %[[#ssassv]] |
| 27 | +; CHECK-DAG: %[[#sfuf_fp:]] = OpTypePointer Function %[[#sfuf]] |
| 28 | +; CHECK-DAG: %[[#sfuf_pp:]] = OpTypePointer Private %[[#sfuf]] |
18 | 29 |
|
19 | 30 | %struct.SF = type { float }
|
20 | 31 | %struct.SU = type { i32 }
|
21 | 32 | %struct.SFUF = type { float, i32, float }
|
| 33 | +%struct.SSU = type { %struct.SU } |
| 34 | +%struct.SV = type { <4 x i32> } |
| 35 | +%struct.SSV = type { %struct.SV } |
| 36 | +%struct.SASSV = type { [4 x %struct.SSV] } |
| 37 | +%struct.SSASSV = type { %struct.SASSV } |
22 | 38 |
|
23 | 39 | @gsfuf = external addrspace(10) global %struct.SFUF
|
24 |
| -; CHECK: %[[#gsfuf:]] = OpVariable %[[#sfuf_pp]] Private |
| 40 | +; CHECK-DAG: %[[#gsfuf:]] = OpVariable %[[#sfuf_pp]] Private |
25 | 41 |
|
26 | 42 | define internal spir_func void @foo() {
|
27 | 43 | %1 = alloca %struct.SF, align 4
|
@@ -64,3 +80,35 @@ define internal spir_func void @biz() {
|
64 | 80 | ret void
|
65 | 81 | }
|
66 | 82 |
|
| 83 | +define internal spir_func void @nested_store() { |
| 84 | + %1 = alloca %struct.SSU, align 4 |
| 85 | +; CHECK: %[[#var:]] = OpVariable %[[#ssu_fp]] Function |
| 86 | + |
| 87 | + store i32 0, ptr %1, align 4 |
| 88 | +; CHECK: %[[#tmp:]] = OpInBoundsAccessChain %[[#uint_fp]] %[[#var]] %[[#uint_0]] %[[#uint_0]] |
| 89 | +; CHECK: OpStore %[[#tmp]] %[[#uint_0]] Aligned 4 |
| 90 | + |
| 91 | + ret void |
| 92 | +} |
| 93 | + |
| 94 | +define internal spir_func void @nested_store_vector() { |
| 95 | + %1 = alloca %struct.SSV, align 4 |
| 96 | +; CHECK: %[[#var:]] = OpVariable %[[#ssv_fp]] Function |
| 97 | + |
| 98 | + store i32 0, ptr %1, align 4 |
| 99 | +; CHECK: %[[#tmp:]] = OpInBoundsAccessChain %[[#uint_fp]] %[[#var]] %[[#uint_0]] %[[#uint_0]] %[[#uint_0]] |
| 100 | +; CHECK: OpStore %[[#tmp]] %[[#uint_0]] Aligned 4 |
| 101 | + |
| 102 | + ret void |
| 103 | +} |
| 104 | + |
| 105 | +define internal spir_func void @nested_array_vector() { |
| 106 | + %1 = alloca %struct.SSASSV, align 4 |
| 107 | +; CHECK: %[[#var:]] = OpVariable %[[#ssassv_fp]] Function |
| 108 | + |
| 109 | + store i32 0, ptr %1, align 4 |
| 110 | +; CHECK: %[[#tmp:]] = OpInBoundsAccessChain %[[#uint_fp]] %[[#var]] %[[#uint_0]] %[[#uint_0]] %[[#uint_0]] %[[#uint_0]] %[[#uint_0]] %[[#uint_0]] |
| 111 | +; CHECK: OpStore %[[#tmp]] %[[#uint_0]] Aligned 4 |
| 112 | + |
| 113 | + ret void |
| 114 | +} |
0 commit comments