Skip to content

Commit 8f01283

Browse files
committed
[CIR][CodeGen] Remove invalid int7 test cases
1 parent 16f41bb commit 8f01283

File tree

2 files changed

+1
-40
lines changed

2 files changed

+1
-40
lines changed

clang/lib/CIR/CodeGen/CIRGenExpr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ void CIRGenFunction::buildStoreThroughExtVectorComponentLValue(RValue Src,
771771
// of the Elts constant array will be one past the size of the vector.
772772
// Ignore the last element here, if it is greater than the mask size.
773773
if (getAccessedFieldNo(NumSrcElts - 1, Elts) == Mask.size())
774-
NumSrcElts--;
774+
llvm_unreachable("NYI");
775775

776776
// modify when what gets shuffled in
777777
for (unsigned i = 0; i != NumSrcElts; ++i)

clang/test/CIR/CodeGen/vectype-ext.cpp

-39
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ typedef double vd2 __attribute__((ext_vector_type(2)));
99
typedef long vl2 __attribute__((ext_vector_type(2)));
1010
typedef unsigned short vus2 __attribute__((ext_vector_type(2)));
1111

12-
typedef int vi7 __attribute__((ext_vector_type(7)));
13-
1412
// CIR: cir.func {{@.*vector_int_test.*}}
1513
// LLVM: define void {{@.*vector_int_test.*}}
1614
void vector_int_test(int x) {
@@ -181,10 +179,6 @@ void test_load() {
181179

182180
vi2 b;
183181

184-
vi7 c = {};
185-
// CIR: %[[#PVECC:]] = cir.alloca !cir.vector<!s32i x 7>
186-
// LLVM: %[[#PVECC:]] = alloca <7 x i32>
187-
188182
b = a.wz;
189183
// CIR: %[[#LOAD1:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
190184
// 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>
@@ -204,21 +198,6 @@ void test_load() {
204198
// LLVM-NEXT: %[[#EXTRACT1:]] = extractelement <4 x i32> %[[#LOAD8]], i64 2
205199
// LLVM-NEXT: store i32 %[[#EXTRACT1]], ptr %{{[0-9]+}}, align 4
206200

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-
222201
}
223202

224203
// CIR: cir.func {{@.*test_store.*}}
@@ -232,10 +211,6 @@ void test_store() {
232211
// CIR-NEXT: %[[#PVECB:]] = cir.alloca !cir.vector<!s32i x 2>
233212
// LLVM-NEXT: %[[#PVECB:]] = alloca <2 x i32>
234213

235-
vi7 c = {};
236-
// CIR-NEXT: %[[#PVECC:]] = cir.alloca !cir.vector<!s32i x 7>
237-
// LLVM-NEXT: %[[#PVECC:]] = alloca <7 x i32>
238-
239214
a.xy = b;
240215
// CIR: %[[#LOAD4RHS:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 2>>, !cir.vector<!s32i x 2>
241216
// CIR-NEXT: %[[#LOAD5LHS:]] = cir.load %{{[0-9]+}} : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
@@ -275,20 +250,6 @@ void test_store() {
275250
// LLVM-NEXT: %[[#RESULT:]] = shufflevector <4 x i32> %[[#VECA]], <4 x i32> %[[#EXTVECB]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
276251
// LLVM-NEXT: store <4 x i32> %[[#RESULT]], ptr %[[#PVECA]], align 16
277252

278-
// c.hi is c[4, 5, 6, 7], in which 7 should be ignored in CIRGen for store
279-
c.hi = a;
280-
281-
// CIR-NEXT: %[[#VECA:]] = cir.load %[[#PVECA]] : !cir.ptr<!cir.vector<!s32i x 4>>, !cir.vector<!s32i x 4>
282-
// CIR-NEXT: %[[#VECC:]] = cir.load %[[#PVECC]] : !cir.ptr<!cir.vector<!s32i x 7>>, !cir.vector<!s32i x 7>
283-
// CIR-NEXT: %[[#EXTVECA:]] = cir.vec.shuffle(%[[#VECA]], %[[#VECA]] : !cir.vector<!s32i x 4>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<-1> : !s32i, #cir.int<-1> : !s32i, #cir.int<-1> : !s32i] : !cir.vector<!s32i x 7>
284-
// CIR-NEXT: %[[#RESULT:]] = cir.vec.shuffle(%[[#VECC]], %[[#EXTVECA]] : !cir.vector<!s32i x 7>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<7> : !s32i, #cir.int<8> : !s32i, #cir.int<9> : !s32i] : !cir.vector<!s32i x 7>
285-
// CIR-NEXT: cir.store %[[#RESULT]], %[[#PVECC]] : !cir.vector<!s32i x 7>, !cir.ptr<!cir.vector<!s32i x 7>>
286-
287-
// LLVM-NEXT: %[[#VECA:]] = load <4 x i32>, ptr %[[#PVECA]], align 16
288-
// LLVM-NEXT: %[[#VECC:]] = load <7 x i32>, ptr %[[#PVECC]], align 32
289-
// LLVM-NEXT: %[[#EXTVECA:]] = shufflevector <4 x i32> %[[#VECA]], <4 x i32> %[[#VECA]], <7 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison>
290-
// LLVM-NEXT: %[[#RESULT:]] = shufflevector <7 x i32> %[[#VECC]], <7 x i32> %[[#EXTVECA]], <7 x i32> <i32 0, i32 1, i32 2, i32 3, i32 7, i32 8, i32 9>
291-
// LLVM-NEXT: store <7 x i32> %[[#RESULT]], ptr %[[#PVECC]], align 32
292253
}
293254

294255
// CIR: cir.func {{@.*test_build_lvalue.*}}

0 commit comments

Comments
 (0)