-
Notifications
You must be signed in to change notification settings - Fork 219
/
composite_construct_vector_non_constant.spvasm
40 lines (38 loc) · 1.61 KB
/
composite_construct_vector_non_constant.spvasm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
; REQUIRES: spirv-as
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s
; RUN: spirv-val %t.spv
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
; RUN: llvm-dis %t.rev.bc
; RUN: FileCheck < %t.rev.ll %s
; CHECK: define spir_func <3 x i32> @non_constant_vector_elements(i32 %[[#ARG0:]], i32 %[[#ARG1:]])
; CHECK: %[[#VEC0:]] = insertelement <3 x i32> poison, i32 %[[#ARG1]], i32 0
; CHECK: %[[#VEC1:]] = insertelement <3 x i32> %[[#VEC0]], i32 %[[#ARG0]], i32 1
; CHECK: %[[#VEC2:]] = insertelement <3 x i32> %[[#VEC1]], i32 1, i32 2
; CHECK: ret <3 x i32> %[[#VEC2]]
; SPIR-V
; Version: 1.0
; Generator: Khronos LLVM/SPIR-V Translator; 14
; Bound: 23
; Schema: 0
OpCapability Addresses
OpCapability Linkage
OpCapability Kernel
%1 = OpExtInstImport "OpenCL.std"
OpMemoryModel Physical64 OpenCL
OpSource Unknown 0
OpName %vectype "vectype"
OpName %non_constant_vector_elements "non_constant_vector_elements"
OpDecorate %non_constant_vector_elements LinkageAttributes "non_constant_vector_elements" Export
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%vectype = OpTypeVector %uint 3
%5 = OpTypeFunction %vectype %uint %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%non_constant_vector_elements = OpFunction %vectype None %5
%484 = OpFunctionParameter %uint
%485 = OpFunctionParameter %uint
%7 = OpLabel
%14 = OpCompositeConstruct %vectype %485 %484 %uint_1
OpReturnValue %14
OpFunctionEnd