Skip to content

[LLVM][TableGen] Check validity of IIT encoding for vector types #111152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion llvm/include/llvm/IR/Intrinsics.td
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ class LLVMType<ValueType vt> {
[]);
assert !le(!size(IIT_Vecs), 1), "Duplicate type";

// For vector types, assert that the IIT_Vecs list is not empty.
assert !or(!not(vt.isVector), !not(!empty(IIT_Vecs))),
"Invalid IIT encoding for vector type v" # vt.nElem # vt.ElementType;

list<int> Sig = !listconcat(
!if(vt.isScalable, [IIT_SCALABLE_VEC.Number], []),
!foreach(iit, IIT_Vecs, iit.Number),
Expand Down Expand Up @@ -518,7 +522,6 @@ def llvm_v128i1_ty : LLVMType<v128i1>; // 128 x i1
def llvm_v256i1_ty : LLVMType<v256i1>; // 256 x i1
def llvm_v512i1_ty : LLVMType<v512i1>; // 512 x i1
def llvm_v1024i1_ty : LLVMType<v1024i1>; //1024 x i1
def llvm_v2048i1_ty : LLVMType<v2048i1>; //2048 x i1

def llvm_v1i8_ty : LLVMType<v1i8>; // 1 x i8
def llvm_v2i8_ty : LLVMType<v2i8>; // 2 x i8
Expand Down
Loading