1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,instcombine,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
5 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
8 // CHECK-LABEL: @test_svcntb(
10 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.vscale.i64()
11 // CHECK-NEXT: [[TMP1:%.*]] = shl nuw nsw i64 [[TMP0]], 4
12 // CHECK-NEXT: ret i64 [[TMP1]]
14 // CPP-CHECK-LABEL: @_Z11test_svcntbv(
15 // CPP-CHECK-NEXT: entry:
16 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.vscale.i64()
17 // CPP-CHECK-NEXT: [[TMP1:%.*]] = shl nuw nsw i64 [[TMP0]], 4
18 // CPP-CHECK-NEXT: ret i64 [[TMP1]]
20 uint64_t test_svcntb()
25 // CHECK-LABEL: @test_svcntb_pat(
27 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 0)
28 // CHECK-NEXT: ret i64 [[TMP0]]
30 // CPP-CHECK-LABEL: @_Z15test_svcntb_patv(
31 // CPP-CHECK-NEXT: entry:
32 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 0)
33 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
35 uint64_t test_svcntb_pat()
37 return svcntb_pat(SV_POW2
);
40 // CHECK-LABEL: @test_svcntb_pat_1(
42 // CHECK-NEXT: ret i64 1
44 // CPP-CHECK-LABEL: @_Z17test_svcntb_pat_1v(
45 // CPP-CHECK-NEXT: entry:
46 // CPP-CHECK-NEXT: ret i64 1
48 uint64_t test_svcntb_pat_1()
50 return svcntb_pat(SV_VL1
);
53 // CHECK-LABEL: @test_svcntb_pat_2(
55 // CHECK-NEXT: ret i64 2
57 // CPP-CHECK-LABEL: @_Z17test_svcntb_pat_2v(
58 // CPP-CHECK-NEXT: entry:
59 // CPP-CHECK-NEXT: ret i64 2
61 uint64_t test_svcntb_pat_2()
63 return svcntb_pat(SV_VL2
);
66 // CHECK-LABEL: @test_svcntb_pat_3(
68 // CHECK-NEXT: ret i64 3
70 // CPP-CHECK-LABEL: @_Z17test_svcntb_pat_3v(
71 // CPP-CHECK-NEXT: entry:
72 // CPP-CHECK-NEXT: ret i64 3
74 uint64_t test_svcntb_pat_3()
76 return svcntb_pat(SV_VL3
);
79 // CHECK-LABEL: @test_svcntb_pat_4(
81 // CHECK-NEXT: ret i64 4
83 // CPP-CHECK-LABEL: @_Z17test_svcntb_pat_4v(
84 // CPP-CHECK-NEXT: entry:
85 // CPP-CHECK-NEXT: ret i64 4
87 uint64_t test_svcntb_pat_4()
89 return svcntb_pat(SV_VL4
);
92 // CHECK-LABEL: @test_svcntb_pat_5(
94 // CHECK-NEXT: ret i64 5
96 // CPP-CHECK-LABEL: @_Z17test_svcntb_pat_5v(
97 // CPP-CHECK-NEXT: entry:
98 // CPP-CHECK-NEXT: ret i64 5
100 uint64_t test_svcntb_pat_5()
102 return svcntb_pat(SV_VL5
);
105 // CHECK-LABEL: @test_svcntb_pat_6(
106 // CHECK-NEXT: entry:
107 // CHECK-NEXT: ret i64 6
109 // CPP-CHECK-LABEL: @_Z17test_svcntb_pat_6v(
110 // CPP-CHECK-NEXT: entry:
111 // CPP-CHECK-NEXT: ret i64 6
113 uint64_t test_svcntb_pat_6()
115 return svcntb_pat(SV_VL6
);
118 // CHECK-LABEL: @test_svcntb_pat_7(
119 // CHECK-NEXT: entry:
120 // CHECK-NEXT: ret i64 7
122 // CPP-CHECK-LABEL: @_Z17test_svcntb_pat_7v(
123 // CPP-CHECK-NEXT: entry:
124 // CPP-CHECK-NEXT: ret i64 7
126 uint64_t test_svcntb_pat_7()
128 return svcntb_pat(SV_VL7
);
131 // CHECK-LABEL: @test_svcntb_pat_8(
132 // CHECK-NEXT: entry:
133 // CHECK-NEXT: ret i64 8
135 // CPP-CHECK-LABEL: @_Z17test_svcntb_pat_8v(
136 // CPP-CHECK-NEXT: entry:
137 // CPP-CHECK-NEXT: ret i64 8
139 uint64_t test_svcntb_pat_8()
141 return svcntb_pat(SV_VL8
);
144 // CHECK-LABEL: @test_svcntb_pat_9(
145 // CHECK-NEXT: entry:
146 // CHECK-NEXT: ret i64 16
148 // CPP-CHECK-LABEL: @_Z17test_svcntb_pat_9v(
149 // CPP-CHECK-NEXT: entry:
150 // CPP-CHECK-NEXT: ret i64 16
152 uint64_t test_svcntb_pat_9()
154 return svcntb_pat(SV_VL16
);
157 // CHECK-LABEL: @test_svcntb_pat_10(
158 // CHECK-NEXT: entry:
159 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 10)
160 // CHECK-NEXT: ret i64 [[TMP0]]
162 // CPP-CHECK-LABEL: @_Z18test_svcntb_pat_10v(
163 // CPP-CHECK-NEXT: entry:
164 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 10)
165 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
167 uint64_t test_svcntb_pat_10()
169 return svcntb_pat(SV_VL32
);
172 // CHECK-LABEL: @test_svcntb_pat_11(
173 // CHECK-NEXT: entry:
174 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 11)
175 // CHECK-NEXT: ret i64 [[TMP0]]
177 // CPP-CHECK-LABEL: @_Z18test_svcntb_pat_11v(
178 // CPP-CHECK-NEXT: entry:
179 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 11)
180 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
182 uint64_t test_svcntb_pat_11()
184 return svcntb_pat(SV_VL64
);
187 // CHECK-LABEL: @test_svcntb_pat_12(
188 // CHECK-NEXT: entry:
189 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 12)
190 // CHECK-NEXT: ret i64 [[TMP0]]
192 // CPP-CHECK-LABEL: @_Z18test_svcntb_pat_12v(
193 // CPP-CHECK-NEXT: entry:
194 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 12)
195 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
197 uint64_t test_svcntb_pat_12()
199 return svcntb_pat(SV_VL128
);
202 // CHECK-LABEL: @test_svcntb_pat_13(
203 // CHECK-NEXT: entry:
204 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 13)
205 // CHECK-NEXT: ret i64 [[TMP0]]
207 // CPP-CHECK-LABEL: @_Z18test_svcntb_pat_13v(
208 // CPP-CHECK-NEXT: entry:
209 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 13)
210 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
212 uint64_t test_svcntb_pat_13()
214 return svcntb_pat(SV_VL256
);
217 // CHECK-LABEL: @test_svcntb_pat_14(
218 // CHECK-NEXT: entry:
219 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 29)
220 // CHECK-NEXT: ret i64 [[TMP0]]
222 // CPP-CHECK-LABEL: @_Z18test_svcntb_pat_14v(
223 // CPP-CHECK-NEXT: entry:
224 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 29)
225 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
227 uint64_t test_svcntb_pat_14()
229 return svcntb_pat(SV_MUL4
);
232 // CHECK-LABEL: @test_svcntb_pat_15(
233 // CHECK-NEXT: entry:
234 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 30)
235 // CHECK-NEXT: ret i64 [[TMP0]]
237 // CPP-CHECK-LABEL: @_Z18test_svcntb_pat_15v(
238 // CPP-CHECK-NEXT: entry:
239 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntb(i32 30)
240 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
242 uint64_t test_svcntb_pat_15()
244 return svcntb_pat(SV_MUL3
);
247 // CHECK-LABEL: @test_svcntb_pat_16(
248 // CHECK-NEXT: entry:
249 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.vscale.i64()
250 // CHECK-NEXT: [[TMP1:%.*]] = shl nuw nsw i64 [[TMP0]], 4
251 // CHECK-NEXT: ret i64 [[TMP1]]
253 // CPP-CHECK-LABEL: @_Z18test_svcntb_pat_16v(
254 // CPP-CHECK-NEXT: entry:
255 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.vscale.i64()
256 // CPP-CHECK-NEXT: [[TMP1:%.*]] = shl nuw nsw i64 [[TMP0]], 4
257 // CPP-CHECK-NEXT: ret i64 [[TMP1]]
259 uint64_t test_svcntb_pat_16()
261 return svcntb_pat(SV_ALL
);