Debian Codegraph @

clang/test/CodeGen/attr-arm-sve-vector-bits-bitcast.c

raw
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 6
2 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +bf16 -mvscale-min=1 -mvscale-max=1 -O1 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-128
3 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +bf16 -mvscale-min=2 -mvscale-max=2 -O1 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-256
4 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +bf16 -mvscale-min=4 -mvscale-max=4 -O1 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-512
5
6 // REQUIRES: aarch64-registered-target
7
8 #include <arm_sve.h>
9
10 #define N __ARM_FEATURE_SVE_BITS
11
12 typedef svint64_t fixed_int64_t __attribute__((arm_sve_vector_bits(N)));
13 typedef svfloat64_t fixed_float64_t __attribute__((arm_sve_vector_bits(N)));
14 typedef svbfloat16_t fixed_bfloat16_t __attribute__((arm_sve_vector_bits(N)));
15 typedef svbool_t fixed_bool_t __attribute__((arm_sve_vector_bits(N)));
16
17 #define DEFINE_STRUCT(ty) \
18 struct struct_##ty { \
19 fixed_##ty##_t x, y[3]; \
20 } struct_##ty;
21
22 DEFINE_STRUCT(int64)
23 DEFINE_STRUCT(float64)
24 DEFINE_STRUCT(bfloat16)
25 DEFINE_STRUCT(bool)
26
27 //===----------------------------------------------------------------------===//
28 // int64
29 //===----------------------------------------------------------------------===//
30
31 // CHECK-128-LABEL: define dso_local <vscale x 2 x i64> @read_int64(
32 // CHECK-128-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
33 // CHECK-128-NEXT: [[ENTRY:.*:]]
34 // CHECK-128-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 16
35 // CHECK-128-NEXT: [[TMP0:%.*]] = load <2 x i64>, ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6:![0-9]+]]
36 // CHECK-128-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 2 x i64> @llvm.vector.insert.nxv2i64.v2i64(<vscale x 2 x i64> poison, <2 x i64> [[TMP0]], i64 0)
37 // CHECK-128-NEXT: ret <vscale x 2 x i64> [[CAST_SCALABLE]]
38 //
39 // CHECK-256-LABEL: define dso_local <vscale x 2 x i64> @read_int64(
40 // CHECK-256-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
41 // CHECK-256-NEXT: [[ENTRY:.*:]]
42 // CHECK-256-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 32
43 // CHECK-256-NEXT: [[TMP0:%.*]] = load <4 x i64>, ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6:![0-9]+]]
44 // CHECK-256-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 2 x i64> @llvm.vector.insert.nxv2i64.v4i64(<vscale x 2 x i64> poison, <4 x i64> [[TMP0]], i64 0)
45 // CHECK-256-NEXT: ret <vscale x 2 x i64> [[CAST_SCALABLE]]
46 //
47 // CHECK-512-LABEL: define dso_local <vscale x 2 x i64> @read_int64(
48 // CHECK-512-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
49 // CHECK-512-NEXT: [[ENTRY:.*:]]
50 // CHECK-512-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 64
51 // CHECK-512-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6:![0-9]+]]
52 // CHECK-512-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 2 x i64> @llvm.vector.insert.nxv2i64.v8i64(<vscale x 2 x i64> poison, <8 x i64> [[TMP0]], i64 0)
53 // CHECK-512-NEXT: ret <vscale x 2 x i64> [[CAST_SCALABLE]]
54 //
55 svint64_t read_int64(struct struct_int64 *s) {
56 return s->y[0];
57 }
58
59 // CHECK-128-LABEL: define dso_local void @write_int64(
60 // CHECK-128-SAME: ptr noundef writeonly captures(none) initializes((16, 32)) [[S:%.*]], <vscale x 2 x i64> [[X:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
61 // CHECK-128-NEXT: [[ENTRY:.*:]]
62 // CHECK-128-NEXT: [[CAST_FIXED:%.*]] = tail call <2 x i64> @llvm.vector.extract.v2i64.nxv2i64(<vscale x 2 x i64> [[X]], i64 0)
63 // CHECK-128-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 16
64 // CHECK-128-NEXT: store <2 x i64> [[CAST_FIXED]], ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
65 // CHECK-128-NEXT: ret void
66 //
67 // CHECK-256-LABEL: define dso_local void @write_int64(
68 // CHECK-256-SAME: ptr noundef writeonly captures(none) initializes((32, 64)) [[S:%.*]], <vscale x 2 x i64> [[X:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
69 // CHECK-256-NEXT: [[ENTRY:.*:]]
70 // CHECK-256-NEXT: [[CAST_FIXED:%.*]] = tail call <4 x i64> @llvm.vector.extract.v4i64.nxv2i64(<vscale x 2 x i64> [[X]], i64 0)
71 // CHECK-256-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 32
72 // CHECK-256-NEXT: store <4 x i64> [[CAST_FIXED]], ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
73 // CHECK-256-NEXT: ret void
74 //
75 // CHECK-512-LABEL: define dso_local void @write_int64(
76 // CHECK-512-SAME: ptr noundef writeonly captures(none) initializes((64, 128)) [[S:%.*]], <vscale x 2 x i64> [[X:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
77 // CHECK-512-NEXT: [[ENTRY:.*:]]
78 // CHECK-512-NEXT: [[CAST_FIXED:%.*]] = tail call <8 x i64> @llvm.vector.extract.v8i64.nxv2i64(<vscale x 2 x i64> [[X]], i64 0)
79 // CHECK-512-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 64
80 // CHECK-512-NEXT: store <8 x i64> [[CAST_FIXED]], ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
81 // CHECK-512-NEXT: ret void
82 //
83 void write_int64(struct struct_int64 *s, svint64_t x) {
84 s->y[0] = x;
85 }
86
87 //===----------------------------------------------------------------------===//
88 // float64
89 //===----------------------------------------------------------------------===//
90
91 // CHECK-128-LABEL: define dso_local <vscale x 2 x double> @read_float64(
92 // CHECK-128-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0]] {
93 // CHECK-128-NEXT: [[ENTRY:.*:]]
94 // CHECK-128-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 16
95 // CHECK-128-NEXT: [[TMP0:%.*]] = load <2 x double>, ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
96 // CHECK-128-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 2 x double> @llvm.vector.insert.nxv2f64.v2f64(<vscale x 2 x double> poison, <2 x double> [[TMP0]], i64 0)
97 // CHECK-128-NEXT: ret <vscale x 2 x double> [[CAST_SCALABLE]]
98 //
99 // CHECK-256-LABEL: define dso_local <vscale x 2 x double> @read_float64(
100 // CHECK-256-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0]] {
101 // CHECK-256-NEXT: [[ENTRY:.*:]]
102 // CHECK-256-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 32
103 // CHECK-256-NEXT: [[TMP0:%.*]] = load <4 x double>, ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
104 // CHECK-256-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 2 x double> @llvm.vector.insert.nxv2f64.v4f64(<vscale x 2 x double> poison, <4 x double> [[TMP0]], i64 0)
105 // CHECK-256-NEXT: ret <vscale x 2 x double> [[CAST_SCALABLE]]
106 //
107 // CHECK-512-LABEL: define dso_local <vscale x 2 x double> @read_float64(
108 // CHECK-512-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0]] {
109 // CHECK-512-NEXT: [[ENTRY:.*:]]
110 // CHECK-512-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 64
111 // CHECK-512-NEXT: [[TMP0:%.*]] = load <8 x double>, ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
112 // CHECK-512-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 2 x double> @llvm.vector.insert.nxv2f64.v8f64(<vscale x 2 x double> poison, <8 x double> [[TMP0]], i64 0)
113 // CHECK-512-NEXT: ret <vscale x 2 x double> [[CAST_SCALABLE]]
114 //
115 svfloat64_t read_float64(struct struct_float64 *s) {
116 return s->y[0];
117 }
118
119 // CHECK-128-LABEL: define dso_local void @write_float64(
120 // CHECK-128-SAME: ptr noundef writeonly captures(none) initializes((16, 32)) [[S:%.*]], <vscale x 2 x double> [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
121 // CHECK-128-NEXT: [[ENTRY:.*:]]
122 // CHECK-128-NEXT: [[CAST_FIXED:%.*]] = tail call <2 x double> @llvm.vector.extract.v2f64.nxv2f64(<vscale x 2 x double> [[X]], i64 0)
123 // CHECK-128-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 16
124 // CHECK-128-NEXT: store <2 x double> [[CAST_FIXED]], ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
125 // CHECK-128-NEXT: ret void
126 //
127 // CHECK-256-LABEL: define dso_local void @write_float64(
128 // CHECK-256-SAME: ptr noundef writeonly captures(none) initializes((32, 64)) [[S:%.*]], <vscale x 2 x double> [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
129 // CHECK-256-NEXT: [[ENTRY:.*:]]
130 // CHECK-256-NEXT: [[CAST_FIXED:%.*]] = tail call <4 x double> @llvm.vector.extract.v4f64.nxv2f64(<vscale x 2 x double> [[X]], i64 0)
131 // CHECK-256-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 32
132 // CHECK-256-NEXT: store <4 x double> [[CAST_FIXED]], ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
133 // CHECK-256-NEXT: ret void
134 //
135 // CHECK-512-LABEL: define dso_local void @write_float64(
136 // CHECK-512-SAME: ptr noundef writeonly captures(none) initializes((64, 128)) [[S:%.*]], <vscale x 2 x double> [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
137 // CHECK-512-NEXT: [[ENTRY:.*:]]
138 // CHECK-512-NEXT: [[CAST_FIXED:%.*]] = tail call <8 x double> @llvm.vector.extract.v8f64.nxv2f64(<vscale x 2 x double> [[X]], i64 0)
139 // CHECK-512-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 64
140 // CHECK-512-NEXT: store <8 x double> [[CAST_FIXED]], ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
141 // CHECK-512-NEXT: ret void
142 //
143 void write_float64(struct struct_float64 *s, svfloat64_t x) {
144 s->y[0] = x;
145 }
146
147 //===----------------------------------------------------------------------===//
148 // bfloat16
149 //===----------------------------------------------------------------------===//
150
151 // CHECK-128-LABEL: define dso_local <vscale x 8 x bfloat> @read_bfloat16(
152 // CHECK-128-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0]] {
153 // CHECK-128-NEXT: [[ENTRY:.*:]]
154 // CHECK-128-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 16
155 // CHECK-128-NEXT: [[TMP0:%.*]] = load <8 x bfloat>, ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
156 // CHECK-128-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 8 x bfloat> @llvm.vector.insert.nxv8bf16.v8bf16(<vscale x 8 x bfloat> poison, <8 x bfloat> [[TMP0]], i64 0)
157 // CHECK-128-NEXT: ret <vscale x 8 x bfloat> [[CAST_SCALABLE]]
158 //
159 // CHECK-256-LABEL: define dso_local <vscale x 8 x bfloat> @read_bfloat16(
160 // CHECK-256-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0]] {
161 // CHECK-256-NEXT: [[ENTRY:.*:]]
162 // CHECK-256-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 32
163 // CHECK-256-NEXT: [[TMP0:%.*]] = load <16 x bfloat>, ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
164 // CHECK-256-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 8 x bfloat> @llvm.vector.insert.nxv8bf16.v16bf16(<vscale x 8 x bfloat> poison, <16 x bfloat> [[TMP0]], i64 0)
165 // CHECK-256-NEXT: ret <vscale x 8 x bfloat> [[CAST_SCALABLE]]
166 //
167 // CHECK-512-LABEL: define dso_local <vscale x 8 x bfloat> @read_bfloat16(
168 // CHECK-512-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0]] {
169 // CHECK-512-NEXT: [[ENTRY:.*:]]
170 // CHECK-512-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 64
171 // CHECK-512-NEXT: [[TMP0:%.*]] = load <32 x bfloat>, ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
172 // CHECK-512-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 8 x bfloat> @llvm.vector.insert.nxv8bf16.v32bf16(<vscale x 8 x bfloat> poison, <32 x bfloat> [[TMP0]], i64 0)
173 // CHECK-512-NEXT: ret <vscale x 8 x bfloat> [[CAST_SCALABLE]]
174 //
175 svbfloat16_t read_bfloat16(struct struct_bfloat16 *s) {
176 return s->y[0];
177 }
178
179 // CHECK-128-LABEL: define dso_local void @write_bfloat16(
180 // CHECK-128-SAME: ptr noundef writeonly captures(none) initializes((16, 32)) [[S:%.*]], <vscale x 8 x bfloat> [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
181 // CHECK-128-NEXT: [[ENTRY:.*:]]
182 // CHECK-128-NEXT: [[CAST_FIXED:%.*]] = tail call <8 x bfloat> @llvm.vector.extract.v8bf16.nxv8bf16(<vscale x 8 x bfloat> [[X]], i64 0)
183 // CHECK-128-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 16
184 // CHECK-128-NEXT: store <8 x bfloat> [[CAST_FIXED]], ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
185 // CHECK-128-NEXT: ret void
186 //
187 // CHECK-256-LABEL: define dso_local void @write_bfloat16(
188 // CHECK-256-SAME: ptr noundef writeonly captures(none) initializes((32, 64)) [[S:%.*]], <vscale x 8 x bfloat> [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
189 // CHECK-256-NEXT: [[ENTRY:.*:]]
190 // CHECK-256-NEXT: [[CAST_FIXED:%.*]] = tail call <16 x bfloat> @llvm.vector.extract.v16bf16.nxv8bf16(<vscale x 8 x bfloat> [[X]], i64 0)
191 // CHECK-256-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 32
192 // CHECK-256-NEXT: store <16 x bfloat> [[CAST_FIXED]], ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
193 // CHECK-256-NEXT: ret void
194 //
195 // CHECK-512-LABEL: define dso_local void @write_bfloat16(
196 // CHECK-512-SAME: ptr noundef writeonly captures(none) initializes((64, 128)) [[S:%.*]], <vscale x 8 x bfloat> [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
197 // CHECK-512-NEXT: [[ENTRY:.*:]]
198 // CHECK-512-NEXT: [[CAST_FIXED:%.*]] = tail call <32 x bfloat> @llvm.vector.extract.v32bf16.nxv8bf16(<vscale x 8 x bfloat> [[X]], i64 0)
199 // CHECK-512-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 64
200 // CHECK-512-NEXT: store <32 x bfloat> [[CAST_FIXED]], ptr [[Y]], align 16, !tbaa [[CHAR_TBAA6]]
201 // CHECK-512-NEXT: ret void
202 //
203 void write_bfloat16(struct struct_bfloat16 *s, svbfloat16_t x) {
204 s->y[0] = x;
205 }
206
207 //===----------------------------------------------------------------------===//
208 // bool
209 //===----------------------------------------------------------------------===//
210
211 // CHECK-128-LABEL: define dso_local <vscale x 16 x i1> @read_bool(
212 // CHECK-128-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0]] {
213 // CHECK-128-NEXT: [[ENTRY:.*:]]
214 // CHECK-128-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 2
215 // CHECK-128-NEXT: [[TMP0:%.*]] = load <2 x i8>, ptr [[Y]], align 2, !tbaa [[CHAR_TBAA6]]
216 // CHECK-128-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 2 x i8> @llvm.vector.insert.nxv2i8.v2i8(<vscale x 2 x i8> poison, <2 x i8> [[TMP0]], i64 0)
217 // CHECK-128-NEXT: [[TMP1:%.*]] = bitcast <vscale x 2 x i8> [[CAST_SCALABLE]] to <vscale x 16 x i1>
218 // CHECK-128-NEXT: ret <vscale x 16 x i1> [[TMP1]]
219 //
220 // CHECK-256-LABEL: define dso_local <vscale x 16 x i1> @read_bool(
221 // CHECK-256-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0]] {
222 // CHECK-256-NEXT: [[ENTRY:.*:]]
223 // CHECK-256-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 4
224 // CHECK-256-NEXT: [[TMP0:%.*]] = load <4 x i8>, ptr [[Y]], align 2, !tbaa [[CHAR_TBAA6]]
225 // CHECK-256-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 2 x i8> @llvm.vector.insert.nxv2i8.v4i8(<vscale x 2 x i8> poison, <4 x i8> [[TMP0]], i64 0)
226 // CHECK-256-NEXT: [[TMP1:%.*]] = bitcast <vscale x 2 x i8> [[CAST_SCALABLE]] to <vscale x 16 x i1>
227 // CHECK-256-NEXT: ret <vscale x 16 x i1> [[TMP1]]
228 //
229 // CHECK-512-LABEL: define dso_local <vscale x 16 x i1> @read_bool(
230 // CHECK-512-SAME: ptr noundef readonly captures(none) [[S:%.*]]) local_unnamed_addr #[[ATTR0]] {
231 // CHECK-512-NEXT: [[ENTRY:.*:]]
232 // CHECK-512-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 8
233 // CHECK-512-NEXT: [[TMP0:%.*]] = load <8 x i8>, ptr [[Y]], align 2, !tbaa [[CHAR_TBAA6]]
234 // CHECK-512-NEXT: [[CAST_SCALABLE:%.*]] = tail call <vscale x 2 x i8> @llvm.vector.insert.nxv2i8.v8i8(<vscale x 2 x i8> poison, <8 x i8> [[TMP0]], i64 0)
235 // CHECK-512-NEXT: [[TMP1:%.*]] = bitcast <vscale x 2 x i8> [[CAST_SCALABLE]] to <vscale x 16 x i1>
236 // CHECK-512-NEXT: ret <vscale x 16 x i1> [[TMP1]]
237 //
238 svbool_t read_bool(struct struct_bool *s) {
239 return s->y[0];
240 }
241
242 // CHECK-128-LABEL: define dso_local void @write_bool(
243 // CHECK-128-SAME: ptr noundef writeonly captures(none) initializes((2, 4)) [[S:%.*]], <vscale x 16 x i1> [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
244 // CHECK-128-NEXT: [[ENTRY:.*:]]
245 // CHECK-128-NEXT: [[TMP0:%.*]] = bitcast <vscale x 16 x i1> [[X]] to <vscale x 2 x i8>
246 // CHECK-128-NEXT: [[CAST_FIXED:%.*]] = tail call <2 x i8> @llvm.vector.extract.v2i8.nxv2i8(<vscale x 2 x i8> [[TMP0]], i64 0)
247 // CHECK-128-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 2
248 // CHECK-128-NEXT: store <2 x i8> [[CAST_FIXED]], ptr [[Y]], align 2, !tbaa [[CHAR_TBAA6]]
249 // CHECK-128-NEXT: ret void
250 //
251 // CHECK-256-LABEL: define dso_local void @write_bool(
252 // CHECK-256-SAME: ptr noundef writeonly captures(none) initializes((4, 8)) [[S:%.*]], <vscale x 16 x i1> [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
253 // CHECK-256-NEXT: [[ENTRY:.*:]]
254 // CHECK-256-NEXT: [[TMP0:%.*]] = bitcast <vscale x 16 x i1> [[X]] to <vscale x 2 x i8>
255 // CHECK-256-NEXT: [[CAST_FIXED:%.*]] = tail call <4 x i8> @llvm.vector.extract.v4i8.nxv2i8(<vscale x 2 x i8> [[TMP0]], i64 0)
256 // CHECK-256-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 4
257 // CHECK-256-NEXT: store <4 x i8> [[CAST_FIXED]], ptr [[Y]], align 2, !tbaa [[CHAR_TBAA6]]
258 // CHECK-256-NEXT: ret void
259 //
260 // CHECK-512-LABEL: define dso_local void @write_bool(
261 // CHECK-512-SAME: ptr noundef writeonly captures(none) initializes((8, 16)) [[S:%.*]], <vscale x 16 x i1> [[X:%.*]]) local_unnamed_addr #[[ATTR2]] {
262 // CHECK-512-NEXT: [[ENTRY:.*:]]
263 // CHECK-512-NEXT: [[TMP0:%.*]] = bitcast <vscale x 16 x i1> [[X]] to <vscale x 2 x i8>
264 // CHECK-512-NEXT: [[CAST_FIXED:%.*]] = tail call <8 x i8> @llvm.vector.extract.v8i8.nxv2i8(<vscale x 2 x i8> [[TMP0]], i64 0)
265 // CHECK-512-NEXT: [[Y:%.*]] = getelementptr inbounds nuw i8, ptr [[S]], i64 8
266 // CHECK-512-NEXT: store <8 x i8> [[CAST_FIXED]], ptr [[Y]], align 2, !tbaa [[CHAR_TBAA6]]
267 // CHECK-512-NEXT: ret void
268 //
269 void write_bool(struct struct_bool *s, svbool_t x) {
270 s->y[0] = x;
271 }
272 //.
273 // CHECK-128: [[META4:![0-9]+]] = !{!"omnipotent char", [[META5:![0-9]+]], i64 0}
274 // CHECK-128: [[META5]] = !{!"Simple C/C++ TBAA"}
275 // CHECK-128: [[CHAR_TBAA6]] = !{[[META4]], [[META4]], i64 0}
276 //.
277 // CHECK-256: [[META4:![0-9]+]] = !{!"omnipotent char", [[META5:![0-9]+]], i64 0}
278 // CHECK-256: [[META5]] = !{!"Simple C/C++ TBAA"}
279 // CHECK-256: [[CHAR_TBAA6]] = !{[[META4]], [[META4]], i64 0}
280 //.
281 // CHECK-512: [[META4:![0-9]+]] = !{!"omnipotent char", [[META5:![0-9]+]], i64 0}
282 // CHECK-512: [[META5]] = !{!"Simple C/C++ TBAA"}
283 // CHECK-512: [[CHAR_TBAA6]] = !{[[META4]], [[META4]], i64 0}
284 //.