1 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
4 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
5 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
7 ; CHECK-DAG: OpName [[SCALARi32:%.+]] "select_i32"
8 ; CHECK-DAG: OpName [[SCALARPTR:%.+]] "select_ptr"
9 ; CHECK-DAG: OpName [[VEC2i32:%.+]] "select_i32v2"
10 ; CHECK-DAG: OpName [[VEC2i32v2:%.+]] "select_v2i32v2"
12 ; CHECK: [[SCALARi32]] = OpFunction
13 ; CHECK-NEXT: [[C:%.+]] = OpFunctionParameter
14 ; CHECK-NEXT: [[T:%.+]] = OpFunctionParameter
15 ; CHECK-NEXT: [[F:%.+]] = OpFunctionParameter
17 ; CHECK: [[R:%.+]] = OpSelect {{%.+}} [[C]] [[T]] [[F]]
18 ; CHECK: OpReturnValue [[R]]
19 ; CHECK-NEXT: OpFunctionEnd
20 define i32 @select_i32(i1 %c, i32 %t, i32 %f) {
21 %r = select i1 %c, i32 %t, i32 %f
25 ; CHECK: [[SCALARPTR]] = OpFunction
26 ; CHECK-NEXT: [[C:%.+]] = OpFunctionParameter
27 ; CHECK-NEXT: [[T:%.+]] = OpFunctionParameter
28 ; CHECK-NEXT: [[F:%.+]] = OpFunctionParameter
30 ; CHECK: [[R:%.+]] = OpSelect {{%.+}} [[C]] [[T]] [[F]]
31 ; CHECK: OpReturnValue [[R]]
32 ; CHECK-NEXT: OpFunctionEnd
33 define ptr @select_ptr(i1 %c, ptr %t, ptr %f) {
34 %r = select i1 %c, ptr %t, ptr %f
38 ; CHECK: [[VEC2i32]] = OpFunction
39 ; CHECK-NEXT: [[C:%.+]] = OpFunctionParameter
40 ; CHECK-NEXT: [[T:%.+]] = OpFunctionParameter
41 ; CHECK-NEXT: [[F:%.+]] = OpFunctionParameter
43 ; CHECK: [[R:%.+]] = OpSelect {{%.+}} [[C]] [[T]] [[F]]
44 ; CHECK: OpReturnValue [[R]]
45 ; CHECK-NEXT: OpFunctionEnd
46 define <2 x i32> @select_i32v2(i1 %c, <2 x i32> %t, <2 x i32> %f) {
47 %r = select i1 %c, <2 x i32> %t, <2 x i32> %f
51 ; CHECK: [[VEC2i32v2]] = OpFunction
52 ; CHECK-NEXT: [[C:%.+]] = OpFunctionParameter
53 ; CHECK-NEXT: [[T:%.+]] = OpFunctionParameter
54 ; CHECK-NEXT: [[F:%.+]] = OpFunctionParameter
56 ; CHECK: [[R:%.+]] = OpSelect {{%.+}} [[C]] [[T]] [[F]]
57 ; CHECK: OpReturnValue [[R]]
58 ; CHECK-NEXT: OpFunctionEnd
59 define <2 x i32> @select_v2i32v2(<2 x i1> %c, <2 x i32> %t, <2 x i32> %f) {
60 %r = select <2 x i1> %c, <2 x i32> %t, <2 x i32> %f