@@ -174,13 +174,18 @@ void vector_double_test(int x, double y) {
174
174
// CIR: %{{[0-9]+}} = cir.cast(float_to_int, %{{[0-9]+}} : !cir.vector<!cir.double x 2>), !cir.vector<!u16i x 2>
175
175
}
176
176
177
- // CIR: cir.func {{@.*vector_swizzle.*}}
178
- // LLVM: define void {{@.*vector_swizzle.*}}
179
- void vector_swizzle () {
180
-
177
+ // CIR: cir.func {{@.*test_load.*}}
178
+ // LLVM: define void {{@.*test_load.*}}
179
+ void test_load () {
181
180
vi4 a = { 1 , 2 , 3 , 4 };
182
181
183
- vi2 b = a.wz ;
182
+ vi2 b;
183
+
184
+ vi7 c = {};
185
+ // CIR: %[[#PVECC:]] = cir.alloca !cir.vector<!s32i x 7>
186
+ // LLVM: %[[#PVECC:]] = alloca <7 x i32>
187
+
188
+ b = a.wz ;
184
189
// CIR: %[[#LOAD1:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
185
190
// CIR-NEXT: %[[#SHUFFLE1:]] = cir.vec.shuffle(%[[#LOAD1]], %[[#LOAD1]] : !cir.vector<!s32i x 4>) [#cir.int<3> : !s32i, #cir.int<2> : !s32i] : !cir.vector<!s32i x 2>
186
191
// CIR-NEXT: cir.store %[[#SHUFFLE1]], %{{[0-9]+}} : !cir.vector<!s32i x 2>, !cir.ptr<!cir.vector<!s32i x 2>>
@@ -189,54 +194,6 @@ void vector_swizzle() {
189
194
// LLVM-NEXT: %[[#SHUFFLE1:]] = shufflevector <4 x i32> %[[#LOAD1]], <4 x i32> %[[#LOAD1]], <2 x i32> <i32 3, i32 2>
190
195
// LLVM-NEXT: store <2 x i32> %[[#SHUFFLE1]], ptr %{{[0-9]+}}, align 8
191
196
192
- a.wz = a.xy ;
193
- // CIR-NEXT: %[[#LOAD2:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
194
- // CIR-NEXT: %[[#SHUFFLE2:]] = cir.vec.shuffle(%[[#LOAD2]], %[[#LOAD2]] : !cir.vector<!s32i x 4>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i] : !cir.vector<!s32i x 2>
195
- // CIR-NEXT: %[[#LOAD3:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
196
- // CIR-NEXT: %[[#SHUFFLE3:]] = cir.vec.shuffle(%[[#SHUFFLE2]], %[[#SHUFFLE2]] : !cir.vector<!s32i x 2>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<-1> : !s32i, #cir.int<-1> : !s32i] : !cir.vector<!s32i x 4>
197
- // CIR-NEXT: %[[#SHUFFLE4:]] = cir.vec.shuffle(%[[#LOAD3]], %[[#SHUFFLE3]] : !cir.vector<!s32i x 4>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<5> : !s32i, #cir.int<4> : !s32i] : !cir.vector<!s32i x 4>
198
- // CIR-NEXT: cir.store %[[#SHUFFLE4]], %{{[0-9]+}} : !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>
199
-
200
- // LLVM-NEXT: %[[#LOAD2:]] = load <4 x i32>, ptr %{{[0-9]+}}, align 16
201
- // LLVM-NEXT: %[[#SHUFFLE2:]] = shufflevector <4 x i32> %[[#LOAD2]], <4 x i32> %[[#LOAD2]], <2 x i32> <i32 0, i32 1>
202
- // LLVM-NEXT: %[[#LOAD3:]] = load <4 x i32>, ptr %{{[0-9]+}}, align 16
203
- // LLVM-NEXT: %[[#SHUFFLE3:]] = shufflevector <2 x i32> %[[#SHUFFLE2]], <2 x i32> %[[#SHUFFLE2]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
204
- // LLVM-NEXT: %[[#SHUFFLE4:]] = shufflevector <4 x i32> %[[#LOAD3]], <4 x i32> %[[#SHUFFLE3]], <4 x i32> <i32 0, i32 1, i32 5, i32 4>
205
- // LLVM-NEXT: store <4 x i32> %[[#SHUFFLE4]], ptr %{{[0-9]+}}, align 16
206
-
207
- a.xy = b;
208
- // CIR-NEXT: %[[#LOAD4RHS:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 2>>, !cir.vector<!s32i x 2>
209
- // CIR-NEXT: %[[#LOAD5LHS:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
210
- // CIR-NEXT: %[[#SHUFFLE5:]] = cir.vec.shuffle(%[[#LOAD4RHS]], %[[#LOAD4RHS]] : !cir.vector<!s32i x 2>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<-1> : !s32i, #cir.int<-1> : !s32i] : !cir.vector<!s32i x 4>
211
- // CIR-NEXT: %[[#SHUFFLE6:]] = cir.vec.shuffle(%[[#LOAD5LHS]], %[[#SHUFFLE5]] : !cir.vector<!s32i x 4>) [#cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<!s32i x 4>
212
- // CIR-NEXT: cir.store %[[#SHUFFLE6]], %{{[0-9]+}} : !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>
213
-
214
- // LLVM-NEXT: %[[#LOAD4RHS:]] = load <2 x i32>, ptr %{{[0-9]+}}, align 8
215
- // LLVM-NEXT: %[[#LOAD5LHS:]] = load <4 x i32>, ptr %{{[0-9]+}}, align 16
216
- // LLVM-NEXT: %[[#SHUFFLE5:]] = shufflevector <2 x i32> %[[#LOAD4RHS]], <2 x i32> %[[#LOAD4RHS]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
217
- // LLVM-NEXT: %[[#SHUFFLE6:]] = shufflevector <4 x i32> %[[#LOAD5LHS]], <4 x i32> %[[#SHUFFLE5]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
218
- // LLVM-NEXT: store <4 x i32> %[[#SHUFFLE6]], ptr %{{[0-9]+}}, align 16
219
-
220
- b = a.yw ;
221
- // CIR-NEXT: %[[#LOAD6:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
222
- // CIR-NEXT: %[[#SHUFFLE7:]] = cir.vec.shuffle(%[[#LOAD6]], %[[#LOAD6]] : !cir.vector<!s32i x 4>) [#cir.int<1> : !s32i, #cir.int<3> : !s32i] : !cir.vector<!s32i x 2>
223
- // CIR-NEXT: cir.store %[[#SHUFFLE7]], %{{[0-9]+}} : !cir.vector<!s32i x 2>, !cir.ptr<!cir.vector<!s32i x 2>>
224
-
225
- // LLVM-NEXT: %[[#LOAD6:]] = load <4 x i32>, ptr %{{[0-9]+}}, align 16
226
- // LLVM-NEXT: %[[#SHUFFLE7:]] = shufflevector <4 x i32> %[[#LOAD6]], <4 x i32> %[[#LOAD6]], <2 x i32> <i32 1, i32 3>
227
- // LLVM-NEXT: store <2 x i32> %[[#SHUFFLE7]], ptr %{{[0-9]+}}, align 8
228
-
229
- a.s0 = 1 ;
230
- // CIR-NEXT: cir.const #cir.int<1>
231
- // CIR-NEXT: %[[#LOAD7:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
232
- // CIR-NEXT: %[[#INSERT_INDEX:]] = cir.const #cir.int<0> : !s64i
233
- // CIR-NEXT: %[[#INSERT1:]] = cir.vec.insert %{{[0-9]+}}, %[[#LOAD7]][%[[#INSERT_INDEX]] : !s64i] : !cir.vector<!s32i x 4>
234
- // CIR-NEXT: cir.store %[[#INSERT1]], %{{[0-9]+}} : !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>
235
-
236
- // LLVM-NEXT: %[[#LOAD7:]] = load <4 x i32>, ptr %{{[0-9]+}}, align 16
237
- // LLVM-NEXT: %[[#INSERT1:]] = insertelement <4 x i32> %[[#LOAD7]], i32 1, i64 0
238
- // LLVM-NEXT: store <4 x i32> %[[#INSERT1]], ptr %{{[0-9]+}}, align 16
239
-
240
197
int one_elem_load = a.s2 ;
241
198
// CIR-NEXT: %[[#LOAD8:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
242
199
// CIR-NEXT: %[[#EXTRACT_INDEX:]] = cir.const #cir.int<2> : !s64i
@@ -247,11 +204,26 @@ void vector_swizzle() {
247
204
// LLVM-NEXT: %[[#EXTRACT1:]] = extractelement <4 x i32> %[[#LOAD8]], i64 2
248
205
// LLVM-NEXT: store i32 %[[#EXTRACT1]], ptr %{{[0-9]+}}, align 4
249
206
207
+
208
+ // OpenCL C Specification 6.3.7. Vector Components
209
+ // The suffixes .lo (or .even) and .hi (or .odd) for a 3-component vector type
210
+ // operate as if the 3-component vector type is a 4-component vector type with
211
+ // the value in the w component undefined.
212
+ a = c.hi ;
213
+
214
+ // CIR-NEXT: %[[#VECC:]] = cir.load %[[#PVECC]] : !cir.ptr<!cir.vector<!s32i x 7>>, !cir.vector<!s32i x 7>
215
+ // CIR-NEXT: %[[#HIPART:]] = cir.vec.shuffle(%[[#VECC]], %[[#VECC]] : !cir.vector<!s32i x 7>) [#cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i] : !cir.vector<!s32i x 4>
216
+ // CIR-NEXT: cir.store %[[#HIPART]], %{{[0-9]+}} : !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>
217
+
218
+ // LLVM-NEXT: %[[#VECC:]] = load <7 x i32>, ptr %[[#PVECC]], align 32
219
+ // LLVM-NEXT: %[[#HIPART:]] = shufflevector <7 x i32> %[[#VECC]], <7 x i32> %[[#VECC]], <4 x i32> <i32 4, i32 5, i32 6, i32 7>
220
+ // LLVM-NEXT: store <4 x i32> %[[#HIPART]], ptr %{{[0-9]+}}, align 16
221
+
250
222
}
251
223
252
- // CIR: cir.func {{@.*vector_extend .*}}
253
- // LLVM: define void {{@.*vector_extend .*}}
254
- void vector_extend () {
224
+ // CIR: cir.func {{@.*test_store .*}}
225
+ // LLVM: define void {{@.*test_store .*}}
226
+ void test_store () {
255
227
vi4 a;
256
228
// CIR: %[[#PVECA:]] = cir.alloca !cir.vector<!s32i x 4>
257
229
// LLVM: %[[#PVECA:]] = alloca <4 x i32>
@@ -264,33 +236,45 @@ void vector_extend() {
264
236
// CIR-NEXT: %[[#PVECC:]] = cir.alloca !cir.vector<!s32i x 7>
265
237
// LLVM-NEXT: %[[#PVECC:]] = alloca <7 x i32>
266
238
239
+ a.xy = b;
240
+ // CIR: %[[#LOAD4RHS:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 2>>, !cir.vector<!s32i x 2>
241
+ // CIR-NEXT: %[[#LOAD5LHS:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
242
+ // CIR-NEXT: %[[#SHUFFLE5:]] = cir.vec.shuffle(%[[#LOAD4RHS]], %[[#LOAD4RHS]] : !cir.vector<!s32i x 2>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<-1> : !s32i, #cir.int<-1> : !s32i] : !cir.vector<!s32i x 4>
243
+ // CIR-NEXT: %[[#SHUFFLE6:]] = cir.vec.shuffle(%[[#LOAD5LHS]], %[[#SHUFFLE5]] : !cir.vector<!s32i x 4>) [#cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<!s32i x 4>
244
+ // CIR-NEXT: cir.store %[[#SHUFFLE6]], %{{[0-9]+}} : !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>
245
+
246
+ // LLVM: %[[#LOAD4RHS:]] = load <2 x i32>, ptr %{{[0-9]+}}, align 8
247
+ // LLVM-NEXT: %[[#LOAD5LHS:]] = load <4 x i32>, ptr %{{[0-9]+}}, align 16
248
+ // LLVM-NEXT: %[[#SHUFFLE5:]] = shufflevector <2 x i32> %[[#LOAD4RHS]], <2 x i32> %[[#LOAD4RHS]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
249
+ // LLVM-NEXT: %[[#SHUFFLE6:]] = shufflevector <4 x i32> %[[#LOAD5LHS]], <4 x i32> %[[#SHUFFLE5]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
250
+ // LLVM-NEXT: store <4 x i32> %[[#SHUFFLE6]], ptr %{{[0-9]+}}, align 16
251
+
252
+ // load single element
253
+ a.s0 = 1 ;
254
+ // CIR-NEXT: cir.const #cir.int<1>
255
+ // CIR-NEXT: %[[#LOAD7:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
256
+ // CIR-NEXT: %[[#INSERT_INDEX:]] = cir.const #cir.int<0> : !s64i
257
+ // CIR-NEXT: %[[#INSERT1:]] = cir.vec.insert %{{[0-9]+}}, %[[#LOAD7]][%[[#INSERT_INDEX]] : !s64i] : !cir.vector<!s32i x 4>
258
+ // CIR-NEXT: cir.store %[[#INSERT1]], %{{[0-9]+}} : !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>
259
+
260
+ // LLVM-NEXT: %[[#LOAD7:]] = load <4 x i32>, ptr %{{[0-9]+}}, align 16
261
+ // LLVM-NEXT: %[[#INSERT1:]] = insertelement <4 x i32> %[[#LOAD7]], i32 1, i64 0
262
+ // LLVM-NEXT: store <4 x i32> %[[#INSERT1]], ptr %{{[0-9]+}}, align 16
263
+
264
+ // extend length from 2 to 4, then merge two vectors
267
265
a.lo = b;
268
- // CIR: %[[#VECB:]] = cir.load %[[#PVECB]] : !cir.ptr<!cir.vector<!s32i x 2>>, !cir.vector<!s32i x 2>
266
+ // CIR: %[[#VECB:]] = cir.load %[[#PVECB]] : !cir.ptr<!cir.vector<!s32i x 2>>, !cir.vector<!s32i x 2>
269
267
// CIR-NEXT: %[[#VECA:]] = cir.load %[[#PVECA]] : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
270
268
// CIR-NEXT: %[[#EXTVECB:]] = cir.vec.shuffle(%[[#VECB]], %[[#VECB]] : !cir.vector<!s32i x 2>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<-1> : !s32i, #cir.int<-1> : !s32i] : !cir.vector<!s32i x 4>
271
269
// CIR-NEXT: %[[#RESULT:]] = cir.vec.shuffle(%[[#VECA]], %[[#EXTVECB]] : !cir.vector<!s32i x 4>) [#cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<!s32i x 4>
272
270
// CIR-NEXT: cir.store %[[#RESULT]], %[[#PVECA]] : !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>
273
271
274
- // LLVM: %[[#VECB:]] = load <2 x i32>, ptr %[[#PVECB]], align 8
272
+ // LLVM: %[[#VECB:]] = load <2 x i32>, ptr %[[#PVECB]], align 8
275
273
// LLVM-NEXT: %[[#VECA:]] = load <4 x i32>, ptr %[[#PVECA]], align 16
276
274
// LLVM-NEXT: %[[#EXTVECB:]] = shufflevector <2 x i32> %[[#VECB]], <2 x i32> %[[#VECB]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
277
275
// LLVM-NEXT: %[[#RESULT:]] = shufflevector <4 x i32> %[[#VECA]], <4 x i32> %[[#EXTVECB]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
278
276
// LLVM-NEXT: store <4 x i32> %[[#RESULT]], ptr %[[#PVECA]], align 16
279
277
280
- // OpenCL C Specification 6.3.7. Vector Components
281
- // The suffixes .lo (or .even) and .hi (or .odd) for a 3-component vector type
282
- // operate as if the 3-component vector type is a 4-component vector type with
283
- // the value in the w component undefined.
284
- a = c.hi ;
285
-
286
- // CIR-NEXT: %[[#VECC:]] = cir.load %[[#PVECC]] : !cir.ptr<!cir.vector<!s32i x 7>>, !cir.vector<!s32i x 7>
287
- // CIR-NEXT: %[[#HIPART:]] = cir.vec.shuffle(%[[#VECC]], %[[#VECC]] : !cir.vector<!s32i x 7>) [#cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i] : !cir.vector<!s32i x 4>
288
- // CIR-NEXT: cir.store %[[#HIPART]], %[[#PVECA]] : !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>
289
-
290
- // LLVM-NEXT: %[[#VECC:]] = load <7 x i32>, ptr %[[#PVECC]], align 32
291
- // LLVM-NEXT: %[[#HIPART:]] = shufflevector <7 x i32> %[[#VECC]], <7 x i32> %[[#VECC]], <4 x i32> <i32 4, i32 5, i32 6, i32 7>
292
- // LLVM-NEXT: store <4 x i32> %[[#HIPART]], ptr %[[#PVECA]], align 16
293
-
294
278
// c.hi is c[4, 5, 6, 7], in which 7 should be ignored in CIRGen for store
295
279
c.hi = a;
296
280
@@ -307,4 +291,42 @@ void vector_extend() {
307
291
// LLVM-NEXT: store <7 x i32> %[[#RESULT]], ptr %[[#PVECC]], align 32
308
292
}
309
293
310
- // TODO(cir): Enable concat test when OpenCL lands
294
+ // CIR: cir.func {{@.*test_build_lvalue.*}}
295
+ // LLVM: define void {{@.*test_build_lvalue.*}}
296
+ void test_build_lvalue () {
297
+ // special cases only
298
+
299
+ vi4 *pv, v;
300
+
301
+ // CIR: %[[#ALLOCAPV:]] = cir.alloca !cir.ptr<!cir.vector<!s32i x 4>>, !cir.ptr<!cir.ptr<!cir.vector<!s32i x 4>>>, ["pv"] {alignment = 8 : i64}
302
+ // CIR-NEXT: %[[#ALLOCAV:]] = cir.alloca !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>, ["v"] {alignment = 16 : i64}
303
+ // CIR-NEXT: %[[#ALLOCAS:]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["s", init] {alignment = 4 : i64}
304
+ // CIR-NEXT: %[[#ALLOCATMP:]] = cir.alloca !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>, ["tmp"] {alignment = 16 : i64}
305
+ // CIR-NEXT: %[[#ALLOCAR:]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["r", init] {alignment = 4 : i64}
306
+
307
+ pv->x = 99 ;
308
+ // CIR: %[[#VAL:]] = cir.const #cir.int<99> : !s32i
309
+ // CIR-NEXT: %[[#PV:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.ptr<!cir.vector<!s32i x 4>>>, !cir.ptr<!cir.vector<!s32i x 4>>
310
+ // CIR-NEXT: %[[#V:]] = cir.load %[[#PV]] : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
311
+ // CIR-NEXT: %[[#IDX:]] = cir.const #cir.int<0> : !s64i
312
+ // CIR-NEXT: %[[#RESULT:]] = cir.vec.insert %[[#VAL]], %[[#V]][%[[#IDX]] : !s64i] : !cir.vector<!s32i x 4>
313
+ // CIR-NEXT: cir.store %[[#RESULT]], %[[#PV]] : !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>
314
+
315
+ int s = (v+v).x ;
316
+
317
+ // CIR-NEXT: %[[#LOAD1:]] = cir.load %[[#ALLOCAV]] : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
318
+ // CIR-NEXT: %[[#LOAD2:]] = cir.load %[[#ALLOCAV]] : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
319
+ // CIR-NEXT: %[[#SUM:]] = cir.binop(add, %[[#LOAD1]], %[[#LOAD2]]) : !cir.vector<!s32i x 4>
320
+ // CIR-NEXT: cir.store %[[#SUM]], %[[#ALLOCATMP]] : !cir.vector<!s32i x 4>, !cir.ptr<!cir.vector<!s32i x 4>>
321
+ // CIR-NEXT: %[[#TMP:]] = cir.load %[[#ALLOCATMP]] : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
322
+ // CIR-NEXT: %[[#IDX:]] = cir.const #cir.int<0> : !s64i
323
+ // CIR-NEXT: %[[#RESULT:]] = cir.vec.extract %[[#TMP]][%[[#IDX]] : !s64i] : !cir.vector<!s32i x 4>
324
+ // CIR-NEXT: cir.store %[[#RESULT]], %[[#ALLOCAS]] : !s32i, !cir.ptr<!s32i>
325
+
326
+ int r = v.xy .x ;
327
+ // CIR-NEXT: %[[#V:]] = cir.load %[[#ALLOCAV]] : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
328
+ // CIR-NEXT: %[[#IDX:]] = cir.const #cir.int<0> : !s64i
329
+ // CIR-NEXT: %[[#RESULT:]] = cir.vec.extract %[[#V]][%[[#IDX]] : !s64i] : !cir.vector<!s32i x 4>
330
+ // CIR-NEXT: cir.store %[[#RESULT]], %[[#ALLOCAR]] : !s32i, !cir.ptr<!s32i>
331
+
332
+ }
0 commit comments