Skip to content

Commit ed0f407

Browse files
authored
[LLVM][TableGen] Check validity of IIT encoding for vector types (#111152)
Add assert to verify that the `IIT_Vecs` list for IIT encoding of vector types is not empty for vector types (else it will generate an invalid IIT encoding). Remove `llvm_v2048i1_ty` for which this assert fails, since the `Intrinsics.td` file does not define any IIT encoding for vectors of size 2048.
1 parent b91f0de commit ed0f407

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@ class LLVMType<ValueType vt> {
372372
[]);
373373
assert !le(!size(IIT_Vecs), 1), "Duplicate type";
374374

375+
// For vector types, assert that the IIT_Vecs list is not empty.
376+
assert !or(!not(vt.isVector), !not(!empty(IIT_Vecs))),
377+
"Invalid IIT encoding for vector type v" # vt.nElem # vt.ElementType;
378+
375379
list<int> Sig = !listconcat(
376380
!if(vt.isScalable, [IIT_SCALABLE_VEC.Number], []),
377381
!foreach(iit, IIT_Vecs, iit.Number),
@@ -518,7 +522,6 @@ def llvm_v128i1_ty : LLVMType<v128i1>; // 128 x i1
518522
def llvm_v256i1_ty : LLVMType<v256i1>; // 256 x i1
519523
def llvm_v512i1_ty : LLVMType<v512i1>; // 512 x i1
520524
def llvm_v1024i1_ty : LLVMType<v1024i1>; //1024 x i1
521-
def llvm_v2048i1_ty : LLVMType<v2048i1>; //2048 x i1
522525

523526
def llvm_v1i8_ty : LLVMType<v1i8>; // 1 x i8
524527
def llvm_v2i8_ty : LLVMType<v2i8>; // 2 x i8

0 commit comments

Comments
 (0)