Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/transcoding/OpAllAny.ll

raw
1 ; RUN: llvm-as %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -spirv-text -o %t.txt
3 ; RUN: FileCheck < %t.txt %s --check-prefix=CHECK-SPIRV
4 ; RUN: llvm-spirv %t.bc -o %t.spv
5 ; RUN: spirv-val %t.spv
6 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.spv.bc --spirv-target-env=SPV-IR
7 ; RUN: llvm-dis < %t.rev.spv.bc | FileCheck %s --check-prefix=CHECK-SPV-IR
8 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc
9 ; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM
10
11 ; This test checks SYCL relational builtin any and all with vector input types.
12
13 ; CHECK-SPIRV: 2 TypeBool [[BoolTypeID:[0-9]+]]
14
15 ; CHECK-SPIRV: 4 Any [[BoolTypeID]]
16 ; CHECK-SPIRV: 4 Any [[BoolTypeID]]
17 ; CHECK-SPIRV: 4 Any [[BoolTypeID]]
18 ; CHECK-SPIRV: 4 Any [[BoolTypeID]]
19 ; CHECK-SPIRV: 4 All [[BoolTypeID]]
20 ; CHECK-SPIRV: 4 All [[BoolTypeID]]
21 ; CHECK-SPIRV: 4 All [[BoolTypeID]]
22 ; CHECK-SPIRV: 4 All [[BoolTypeID]]
23
24 ; CHECK-SPV-IR: call spir_func i1 @_Z11__spirv_AnyDv2_c(<2 x i8>
25 ; CHECK-SPV-IR: call spir_func i1 @_Z11__spirv_AnyDv2_c(<2 x i8>
26 ; CHECK-SPV-IR: call spir_func i1 @_Z11__spirv_AnyDv2_c(<2 x i8>
27 ; CHECK-SPV-IR: call spir_func i1 @_Z11__spirv_AnyDv2_c(<2 x i8>
28 ; CHECK-SPV-IR: call spir_func i1 @_Z11__spirv_AllDv2_c(<2 x i8>
29 ; CHECK-SPV-IR: call spir_func i1 @_Z11__spirv_AllDv2_c(<2 x i8>
30 ; CHECK-SPV-IR: call spir_func i1 @_Z11__spirv_AllDv2_c(<2 x i8>
31 ; CHECK-SPV-IR: call spir_func i1 @_Z11__spirv_AllDv2_c(<2 x i8>
32
33 ; CHECK-LLVM: call spir_func i32 @_Z3anyDv2_c(<2 x i8>
34 ; CHECK-LLVM: call spir_func i32 @_Z3anyDv2_c(<2 x i8>
35 ; CHECK-LLVM: call spir_func i32 @_Z3anyDv2_c(<2 x i8>
36 ; CHECK-LLVM: call spir_func i32 @_Z3anyDv2_c(<2 x i8>
37 ; CHECK-LLVM: call spir_func i32 @_Z3allDv2_c(<2 x i8>
38 ; CHECK-LLVM: call spir_func i32 @_Z3allDv2_c(<2 x i8>
39 ; CHECK-LLVM: call spir_func i32 @_Z3allDv2_c(<2 x i8>
40 ; CHECK-LLVM: call spir_func i32 @_Z3allDv2_c(<2 x i8>
41
42 target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
43 target triple = "spir"
44
45 ; Function Attrs: convergent mustprogress nofree norecurse nounwind willreturn writeonly
46 define dso_local spir_func void @test_vector(i32 addrspace(4)* nocapture writeonly %out, <2 x i8> %c, <2 x i16> %s, <2 x i32> %i, <2 x i64> %l) local_unnamed_addr #0 {
47 entry:
48 %call = tail call spir_func i32 @_Z3anyDv2_c(<2 x i8> %c) #2
49 %call1 = tail call spir_func i32 @_Z3anyDv2_s(<2 x i16> %s) #2
50 %add = add nsw i32 %call1, %call
51 %call2 = tail call spir_func i32 @_Z3anyDv2_i(<2 x i32> %i) #2
52 %add3 = add nsw i32 %add, %call2
53 %call4 = tail call spir_func i32 @_Z3anyDv2_l(<2 x i64> %l) #2
54 %add5 = add nsw i32 %add3, %call4
55 %call6 = tail call spir_func i32 @_Z3allDv2_c(<2 x i8> %c) #2
56 %add7 = add nsw i32 %add5, %call6
57 %call8 = tail call spir_func i32 @_Z3allDv2_s(<2 x i16> %s) #2
58 %add9 = add nsw i32 %add7, %call8
59 %call10 = tail call spir_func i32 @_Z3allDv2_i(<2 x i32> %i) #2
60 %add11 = add nsw i32 %add9, %call10
61 %call12 = tail call spir_func i32 @_Z3allDv2_l(<2 x i64> %l) #2
62 %add13 = add nsw i32 %add11, %call12
63 store i32 %add13, i32 addrspace(4)* %out, align 4, !tbaa !3
64 ret void
65 }
66
67 ; Function Attrs: convergent mustprogress nofree nounwind readnone willreturn
68 declare spir_func i32 @_Z3anyDv2_c(<2 x i8>) local_unnamed_addr #1
69
70 ; Function Attrs: convergent mustprogress nofree nounwind readnone willreturn
71 declare spir_func i32 @_Z3anyDv2_s(<2 x i16>) local_unnamed_addr #1
72
73 ; Function Attrs: convergent mustprogress nofree nounwind readnone willreturn
74 declare spir_func i32 @_Z3anyDv2_i(<2 x i32>) local_unnamed_addr #1
75
76 ; Function Attrs: convergent mustprogress nofree nounwind readnone willreturn
77 declare spir_func i32 @_Z3anyDv2_l(<2 x i64>) local_unnamed_addr #1
78
79 ; Function Attrs: convergent mustprogress nofree nounwind readnone willreturn
80 declare spir_func i32 @_Z3allDv2_c(<2 x i8>) local_unnamed_addr #1
81
82 ; Function Attrs: convergent mustprogress nofree nounwind readnone willreturn
83 declare spir_func i32 @_Z3allDv2_s(<2 x i16>) local_unnamed_addr #1
84
85 ; Function Attrs: convergent mustprogress nofree nounwind readnone willreturn
86 declare spir_func i32 @_Z3allDv2_i(<2 x i32>) local_unnamed_addr #1
87
88 ; Function Attrs: convergent mustprogress nofree nounwind readnone willreturn
89 declare spir_func i32 @_Z3allDv2_l(<2 x i64>) local_unnamed_addr #1
90
91 attributes #0 = { convergent mustprogress nofree norecurse nounwind willreturn writeonly "frame-pointer"="none" "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
92 attributes #1 = { convergent mustprogress nofree nounwind readnone willreturn "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
93 attributes #2 = { convergent nounwind readnone willreturn }
94
95 !llvm.module.flags = !{!0}
96 !opencl.ocl.version = !{!1}
97 !opencl.spir.version = !{!1}
98 !llvm.ident = !{!2}
99
100 !0 = !{i32 1, !"wchar_size", i32 4}
101 !1 = !{i32 2, i32 0}
102 !2 = !{!"clang version 14.0.0"}
103 !3 = !{!4, !4, i64 0}
104 !4 = !{!"int", !5, i64 0}
105 !5 = !{!"omnipotent char", !6, i64 0}
106 !6 = !{!"Simple C/C++ TBAA"}